rewrite-clj

https://github.com/clj-commons/rewrite-clj
2019-11-02T00:57:35.015400Z

i hope we can figure out some way to reduce the size of native-images built with the rewrite-cljc -- iirc, there was a more than 20 MB increase. i wonder if native-image has some kind of tree-shaking or there's some nice way to exclude the cljs stuff for clj native-image builds.

lread 2019-11-02T01:47:41.018700Z

@sogaiu that is interesting. I wonder, do you think anybody would be bothered by a 20mb increase?

2019-11-02T01:48:09.018900Z

yes

lread 2019-11-02T01:48:54.020400Z

why is that?

2019-11-02T01:48:57.020500Z

especially for cmd line programs - if you look around a bit i think you'll find such emissions :)

2019-11-02T01:50:17.022200Z

well, i can give you a concrete situation off the top of my head, but i don't have a good summary atm -- if i think of a good summary i will report πŸ™‚

2019-11-02T01:50:24.022500Z

in the mean time, here is a use case

2019-11-02T01:50:57.023700Z

i use native image binaries for plugins and extensions (for atom and vscode) -- each one being bigger means longer download times

lread 2019-11-02T01:51:29.024400Z

true

2019-11-02T01:52:09.025800Z

perhaps it is premature to be concerned -- it's just something i've been considering for some time and i've noticed other people being concerned about size

2019-11-02T01:52:14.026100Z

but may be it is unwarranted

2019-11-02T01:53:19.027600Z

it could be that native-image will get tree shaking if it doesn't have it already, so may be time will take care of the issue too

lread 2019-11-02T01:54:38.028800Z

I might be macOS upgrade biased... I just updated to macOS 10.15.1 today and if I remember right, it was over 4gb. :simple_smile:

2019-11-02T01:55:10.029300Z

well, it isn't exactly an analogous situation

lread 2019-11-02T01:55:32.030300Z

no but it might have biased my thinking

2019-11-02T01:56:07.030900Z

ok πŸ™‚ how often would you say you update macos?

lread 2019-11-02T01:57:14.032100Z

so your concern is currently download times of updates, right?

2019-11-02T01:57:43.032900Z

it is one concern, yes, but i wouldn't say it's the only one

lread 2019-11-02T01:57:58.033600Z

(ya I didn’t mean the bias was sound)

2019-11-02T01:58:03.033800Z

ha ha ha

2019-11-02T01:58:10.034100Z

how many sound biases have you met?

lread 2019-11-02T01:58:31.034300Z

:simple_smile:

2019-11-02T02:00:31.035700Z

for plugins and extensions, it gets worse because to do it well atm, you may need to bundle 3 diff binaries

2019-11-02T02:00:50.036100Z

that's 3 native-image binaries per plugin / extension

2019-11-02T02:01:17.036400Z

so each user has to unfortunately download unwanted bits

2019-11-02T02:01:43.036800Z

if i'm the only one with this concern though, it shouldn't be a burden on anyone else

lread 2019-11-02T02:04:54.038300Z

it’s not a concern I currently share with you, but I can certainly acknowlege it

2019-11-02T02:06:45.040400Z

well, it's a very specific case, so no worries - if it's easy to do something about it, it would be nice :)

πŸ‘ 1
borkdude 2019-11-02T08:10:08.042600Z

FWIW if rewrite-cljc stays close to the implementation of rewrite-clj there should be no difference in binary size: the CLJS branches are ignored during read time.

πŸ‘ 1
borkdude 2019-11-02T08:11:12.043500Z

20mb is twice the size of clj-kondo

borkdude 2019-11-02T13:01:27.044900Z

sorry, incorrect: clj-kondo packs 15mb right now. the minimal size of a clj binary seems to be around 10mb

lread 2019-11-02T13:56:34.045500Z

thanks for info!