News for hackers. Stuff that matters.
Re:Julia 1.6 Highlights by noisy_boy on Thursday March 25, 2021 @12:27PM (#26582236)
How easy it is to produce a compiled executable in 1.6? I took a cursory look at the docs but couldn't spot the steps for doing so.
Re:Julia 1.6 Highlights by dklend122 on Thursday March 25, 2021 @12:29PM (#26582256)
That's coming. Pieces are there but still need polish and integration. Fib was around 44kb with no runtime required.

Check out staticcompiler.jl

Re:Julia 1.6 Highlights by superdimwit on Thursday March 25, 2021 @03:25PM (#26584338)
In your experience, what are the current limitations?
Re:Julia 1.6 Highlights by eigenspace on Thursday March 25, 2021 @04:32PM (#26585019)
There's all sorts of limitations right now. E.g. you can't allocate an array right now, dynamic dispatch is prohibited, there are some bugs too.

Most of this is just a relic from StaticCompiler.jl being a very straightforward slight repurposing of GPUCompiler.jl. It will take some work to make it robust on CPU code, but the path to doing so it pretty strightforward. It just requires dedicated work, but it's not a top priority for anyone who has the know-how currently.

Re:Julia 1.6 Highlights by triztian on Thursday March 25, 2021 @05:34PM (#26585700)
I'd love to be able to contribute to this, somewhat new to Julia, but I'm sure I could help with something ...

Do you have any links to what has been currently done?

EDIT: Found this thread so far: https://discourse.julialang.org/t/statically-compiled-and-st...

Re:Julia 1.6 Highlights by eigenspace on Thursday March 25, 2021 @05:43PM (#26585810)
This is the PR to look at if you want to try and help: https://github.com/tshort/StaticCompiler.jl/pull/46

I think this isn't really a great place for beginners though unfortunately. This project is tightly coupled to undocumented internals of not only julia's compiler, but also LLVM.jl and GPUCompiler.jl. It'll require a lot of learning to be able to meaningfully contribute at this stage.

Re:Julia 1.6 Highlights by patagurbon on Thursday March 25, 2021 @09:01PM (#26587714)
Where do you recommend an experienced Julia user start working on internals/core tools?
Re:Julia 1.6 Highlights by Tarrosion on Thursday March 25, 2021 @09:17PM (#26587808)
What's the difference between StaticCompiler.jl and PackageCompiler.jl? Doesn't the latter also let you build "apps"?
Re:Julia 1.6 Highlights by ced on Thursday March 25, 2021 @12:45PM (#26582478)
We did it for production code installed at client sites, and it has been very easy for us. YMMV
Re:Julia 1.6 Highlights by triztian on Thursday March 25, 2021 @12:56PM (#26582601)
I’ve also looked for this, does it mean that I have to install julia on the target machine and it’ll recompile when running?

Or are there steps to produce a binary (much like Go or C or Rust)??

Re:Julia 1.6 Highlights by cbkeller on Thursday March 25, 2021 @01:16PM (#26582822)
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.

Re:Julia 1.6 Highlights by triztian on Thursday March 25, 2021 @05:32PM (#26585680)
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?

Re:Julia 1.6 Highlights by eigenspace on Thursday March 25, 2021 @05:35PM (#26585712)
Re:Julia 1.6 Highlights by ku-man on Thursday March 25, 2021 @02:25PM (#26583624)
You forgot to mention that a 'Hello World' standalone file is about 0.5 GB!
Re:Julia 1.6 Highlights by tfehring on Friday March 26, 2021 @01:18AM (#26588968)
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.
Re:Julia 1.6 Highlights by pansa2 on Friday March 26, 2021 @01:27AM (#26589006)
Elsewhere someone says “Fib was around 44kb with no runtime required”. Which is correct?
Re:Julia 1.6 Highlights by newswasboring on Friday March 26, 2021 @03:03AM (#26589495)
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.

Re:Julia 1.6 Highlights by pansa2 on Friday March 26, 2021 @06:49AM (#26590588)
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.
Re:Julia 1.6 Highlights by Sukera on Thursday March 25, 2021 @01:21PM (#26582886)
You probably want to check out PackageCompiler.jl (https://julialang.github.io/PackageCompiler.jl/dev/)