Hacker News new | ask | show | jobs
by syrusakbary 500 days ago
Indeed, we need to improve further the base binary size!

Most of the size comes from the LLVM backend, which is a bit heavy. Wasmer ships many backends by default, and if you were to use Wasmer headless that would be just a bit less than a Mb.

If you want, you can always customize the build with only the backends that you are interested in using.

Note: I've seen some builds of LLVM under 5-10Mb, but those require heavy customization. Is clear that we have still some work to do to reduce size on the general build!

1 comments

So you are shipping all of llvm?
Well, if you want to just-in-time compile, then it seems like a compiler is one way to go.

They are now in the size realm of Lisp and Smalltalk. Forth may lean towards the lighter side.

Lisp and Smalltalk are 266 MB?

tcc is 100KB

https://www.bellard.org/tcc/

Squeak Smalltalk is 53 MB on Windows (excluding sources). 48 MB of that is the image with UI framework and so on, but it's not immediately easy to say which library/ui parts are core.
TCC doesn't do much optimization in turn, while commercial implementations of Lisp and Smalltalk are surely much larger than that.
I'm not sure what your point is. The person I replied to was justifying a 266MB binary by saying a compiler was included. Are you saying optimization would make tcc 2,660 times as big?
The point is that LLVM does much, much more than TCC and, while it is definitely possible that LLVM could have done that in a smaller binary, TCC is probably not a good thing to compare with because it only does a bare minimum. I should also note that LLVM is a cross-compiler by default...