Closed ul closed 6 years ago
Hey! Thanks for reporting this. This was a conscious decision of ours to include a lot of libraries called “otherlibs” that are included in ocaml but not linked. The ones we link are Bigarray, Unix, Threads, Dynlink and Nums. You can also specify compiler-libs and we’ll do the right thing. Note here that the increase is just additional kB and not multiplicative. And you have some control over it by setting ocaml-dependencies to the minimal set that you want.
So my question here would be why do you need a smaller binary? What’s your current usecase?
Yes, that decision sounds reasonable. I was just surprised having huge binary for helloworld, not that it is crucial for my usecase. Though I'm reimplementing really simple utility as an exercise, and having it already in 106K as Nim output sets the bar ;-)
Ok. Please come back when / if this becomes an issue. We have a lot to do so knowing what you really need is super helpful for us to prioritize tasks :)
With minimal setup https://gist.github.com/ul/7b54ddef9f19d34b271fe7ba52dfd574 I get
Setting
"ocaml-dependencies": []
gives 201K, while plainocamlopt Main.ml
gives 193K