Choosing which files or functions to compile ?

Is there any way to tell julia not to compile specific files / modules or functions ?

This is because, although Julia runs fast, debugging is slow, especially when debugging a package, as it requires recompiling (almost) everything at each debugging iteration. I see there’s a ‘–compile=no’ option which almost does to do what I want, i.e., don’t compile stuff when in a debugging iteration. But then julia spits out so many warnings as to make this mode unusable.

Have you tried using Revise.jl?

1 Like

Yes, and it does improve things a bit. I was wondering if there was a pythonlike mode in which julia would create and directly use bytecode instead of going through a full time-consuming compilation.

Full compile caching is something that’s planned but is still likely to be a ways off. In the meantime, once you get the hang of using Revise.jl you should be able to keep REPL sessions open for a very long time during development and most compilation that you have to sit through should be very fast. It’s still challenging in the early stages of developing a package when you’re changing the type graph or if you’re dealing with lots of macros or code generation, but for 90% of what’s involved in developing most packages or scripts you should be able to have REPL’s open all day. It also let’s you interact with source code in a way that, as far as I know, cannot be done in Python, so it’s worth spending some time getting used to what’s possible with Revise.jl. I personally definitely didn’t take full advantage of Revise until a few weeks after I started using it, in retrospect I wish I had gotten with the program sooner.

Also you might want to check out Rebugger.jl for something more closely resembling actual debugging.

1 Like