4 ms·
It doesn't take long to compile a small change. But the way compilation works is different than other languages. Julia doesn't cache compiled code (well, it cac
by jakobnissen 5y ago
It doesn't take long to compile a small change. But the way compilation works is different than other languages. Julia doesn't cache compiled code (well, it caches some of it), because that's fiendishly hard to do in a dynamic language that allows dynamically redefining what functions mean. So whenever you start a new Julia process, it has to compile tons of things from scratch.
You can use the Revise.jl package, however. It keeps track of the files you've imported and updates the code whenever a file is changed. This causes only minor latency, similar to an incremental build.
- lamontcg 5y agoJulia isn't that unique, most dynamic languages compile code on startup into bytecode and execute it on a JIT VM, and they all allow dynamically redefining the world at runtime as well. Revise.jl inside the REPL is annoying as hell to use when you start messing with structs. It isn't a big ask to just have `julia whatever.jl` not take minutes to compile the entire world. Stop defending it like every Apple fanboy on mac forums trying to convince me that the touchbar is great. And Revise.jl kind of proves the fact that incremental compilation is entirely possible. If it wasn't possible at all due to $maximum_dynamic_insanity that wouldn't even work.
- BadInformatics 5y ago> Revise.jl inside the REPL is annoying as hell to use when you start messing with structs. > And Revise.jl kind of proves the fact that incremental compilation is entirely possible. If it wasn't possible at all due to $maximum_dynamic_insanity that wouldn't even work. I agree it's disengenuous to say that Revise is the answer to all problems when struct redefinition is still not possible. Yes you can toss them in a module, but then why allow defining them in global scope at all? Thus far I haven't seen any theoretical limitations either, since Common Lisp variants seem to be able to do something similar. That said, I would not look at most other dynamic languages for this. Having a mandatory VM is an express non-goal in Julia, and if you want one then you'll have to face off against all the other people asking for better static compilation. Again, compiled lisps show us that a VM isn't even necessary to get this level of dynamism or low latency incremental compilation. The claim around having to recompile the entire world has already been addressed in a sibling thread, so I'll not rehash it here.