Parse or compile without execution

Viewed 102

Newbie question. After working on for a while on a Julia script, what are the recommended ways to test for syntax errors and compilability without running the code? (For example, in Python I'd execute the following command from the system shell: python -m py_compile myprogram.py).

2 Answers

You can use JET.jl for obtaining possible compilation errors. It's rather new, but already had shown itself as a very useful tool.

For syntax errors, a current setup of Julia on Visual Studio Code will tend to flag such things as missing parentheses and many typos with highlighting as you enter the code.

Compilation of functions prior to running code in Julia is not always possible, since changing arguments to a function dynamically can cause additional just-in-time compilation of the function based on changes in argument type. Test scripts for individual functions do work.

Related