Hacker News new | ask | show | jobs
by cbkeller 1908 days ago
Currently you can make a relocatable “bundle” / “app” with PackageCompiler.jl, but the bundle itself includes a Julia runtime.

Making a nice small static binary is technically possible using an approach similar to what GPUCompiler.jl does, but the CPU equivalent of that isn’t quite ready for primetime.

2 comments

Thank you for your reply! PackageCompiler looks like the right way.

Do you happen have any links to the static binary procedure? Or links to the current state of efforts for this?

You forgot to mention that a 'Hello World' standalone file is about 0.5 GB!
I think something to that effect was implicit in "the bundle itself includes a Julia runtime," but I vouched for this comment anyway since it's an important limitation and the parent comment evidently wasn't explicit enough to prevent confusion.
Elsewhere someone says “Fib was around 44kb with no runtime required”. Which is correct?
They are talking about two different systems. Static compilation is a separate project which is trying to include only those compiled code that is required. That isn't ready yet for normal people like me, but if you have the knowhow and your program meets certain requirements you can get a tiny binary.

PackageCompiler.jl just compiles everything and packages it up. It generates huge files, because it doesn't discriminate on which compiled stuff to include.

I see, thanks. Looks like static compilation will only work if the entire program is “type stable”, which AFAICT means that the type of every variable can be deduced statically.