timeframe for static compilation?

560 views
Skip to first unread message

Tracy Wadleigh

unread,
Feb 21, 2013, 11:21:55 AM2/21/13
to juli...@googlegroups.com
I occasionally see people vaguely refer to a time in the future when Julia supports static compilation. Is this just a "maybe some day" thing, or do the devs have anything like a plan for this? I wasn't able to find anything on the mailing lists or among the github issues related to this.

I'm asking this (and probably will be asking more questions in the near future) because I'm putting together an article about Julia for our company's internal newsletter, and it's a topic I'd like to address therein.

Thanks in advance for your responses.

Viral Shah

unread,
Feb 22, 2013, 12:45:25 AM2/22/13
to juli...@googlegroups.com
There isn't a definite timeframe. Jeff has been doing a lot of foundational work that takes us in that direction.

However, is there a specific reason you want static compilation? Take a look at the basic julia repl. You can already link libjulia in your own programs - that is how the REPL works. A documented libjulia API would certainly make this a lot easier to do.

-viral

Tracy Wadleigh

unread,
Feb 22, 2013, 6:02:27 AM2/22/13
to juli...@googlegroups.com
I work for a scientific consulting company. We spend the majority of our time doing R&D-ish prototyping, right where Julia lives. However, at some point we have to translate our work into deliverable products (which, right now, mostly means MATLAB/IDL -> C++). Static compilation is one way to potentially avoid having to do anything extra for that final step before we make delivery to our customers (and would be one more opportunity to lower the barrier to adoption for my colleagues).

Thinking about it a little, though, it would probably be sufficient for our purposes in many cases just to be able to deliver a single standalone executable, even if that were just a bundle of source and interpreter. 

Krzysztof Kamieniecki

unread,
Feb 22, 2013, 11:06:12 AM2/22/13
to juli...@googlegroups.com
+1 
In my case my company has proprietary algorithms that we want to obfuscate as much as possible.

BTW, Is there an issue/bug for this?

Pierre-Yves Gérardy

unread,
Feb 22, 2013, 1:12:57 PM2/22/13
to juli...@googlegroups.com
LÖVE has a simple yet interesting strategy for this, relying on the fact that the indices of Zip files is located at the end of the archives. 

You can tack on a zip file to the love binary. When you run it, if the binary detects that its tail is a zip, it loads it using PhysFS, and runs the main script.

That won't help with obfuscation, though.

-- Pierre-Yves

Jeff Bezanson

unread,
Feb 22, 2013, 2:31:53 PM2/22/13
to juli...@googlegroups.com
Building system images is a potential approach to obfuscation, and
also speeds up loading a bit. You basically just require() your code
then tell julia to save off its state. I should document how to do
this, but the incantation is at the end of sysimg.jl.

Tim Holy

unread,
Feb 22, 2013, 2:50:54 PM2/22/13
to juli...@googlegroups.com
On Friday, February 22, 2013 02:31:53 PM Jeff Bezanson wrote:
> Building system images is a potential approach to obfuscation, and
> also speeds up loading a bit. You basically just require() your code
> then tell julia to save off its state. I should document how to do
> this, but the incantation is at the end of sysimg.jl.

I had never noticed that, and should have known to look there. Thanks for the
pointer, Jeff!

--Tim

Krzysztof Kamieniecki

unread,
Feb 22, 2013, 7:48:25 PM2/22/13
to juli...@googlegroups.com
Thanks Jeff, I'll take a look at this. How does saving the state work with external resources? In my case resources allocated in the NIVIDIA/CUDA library/drivers? Is there somewhere I could look into existing implementation (open files perhaps?) 

Jeff Bezanson

unread,
Feb 22, 2013, 10:14:40 PM2/22/13
to juli...@googlegroups.com
That is an area that needs work. We need the ability to run init-time
code, and possibly customize saving and restoring.
Reply all
Reply to author
Forward
0 new messages