3 ms·
Unfortunately Julia is a “repl-based language”. You are expected to open a repl and work in it for as long as possible so that your compilations all remain cach
by bobbylarrybobby 5y ago
Unfortunately Julia is a “repl-based language”. You are expected to open a repl and work in it for as long as possible so that your compilations all remain cached. Packages like Revise can help reevaluate code that changes so that you don’t have to leave the repl.
I do wish that Julia would start up in an interpreted mode and compile in the background so that it would be fast enough when first opened and then attain maximum speed later on. (I think this is how JavaScript engines work?)
- eigenspace 5y agoYou can have what you want here by using DaemonMode.jl https://github.com/dmolina/DaemonMode.jl https://github.com/dmolina/DaemonMode.jl
- snicker7 5y agoIt would be nice if their was an "offline version" of this, e.g. automagically cache all compiled code to disk. Daemon mode isn't restart-friendly.
- adgjlsfhk1 5y agoThat's basically what PackageCompiler does. That said, StaticCompiler.jl is expected to improve the state of this in the future.
- snicker7 5y agoNot quite. PackageCompiler isn't automagic. The sysimage doesn't get automatically updated in the REPL. You have to create one manually (and this requires tracing instead of static type inference which Julia can do). So the workflow isn't zero-friction. And StaticCompiler hasn't been updated in over a year. The problem with Julia tooling in general is that they feel 90% done. And tooling is, in my opinion, more important than the language itself.
- eigenspace 5y ago> So the workflow isn't zero-friction. And StaticCompiler hasn't been updated in over a year. There's much more recent work here: https://github.com/tshort/StaticCompiler.jl/pull/46 https://github.com/tshort/StaticCompiler.jl/pull/46 and apparently some more is still ongoing privately. That said, yeah. I would not recommend Julia currently for people who truly believe they need AOT compilation, and that they need to trigger AOT compilation very often and with low friction. That definitely needs more work, but it's happening. That said, a lot of people overestimate how much they actually need AOT compilation. Julia has some fantastic tooling in other areas though. Especially the package management and interactive analysis tools.
- tsimionescu 5y ago> (I think this is how JavaScript engines work?) Yes, modern V8 does this, as does the JVM. Common Lisp runtimes also often support this, though I think they usually leave it up to the programmer to choose when to compile a function, they don't always do it automatically. The .NET CLR also behaves like Julia - JIT compile on first execution of every function.
- Sanguinaire 5y agoI really wish there was an option for better non-REPL usage - basically Cargo for package installation and ahead-of-time compilation, but with the Julia syntax and ethos.