I recently ported one of my simulations to Julia and I discovered several type errors only at run-time. I wish to statically analyze my Julia code. MATLAB has a similar problem in only finding many errors at run-time.
The only tool I found (TypeCheck.jl) performs a small subset of the static analysis that I would expect from a compiler.
Is there a static analyzer for Julia scripts so I can avoid many of what are now run-time errors?
Is there something that I could use with the LLVM JIT compiler? (I don't know much about how the Julia compiling works and what is and isn't possible)
Is this even possible due to the nature of Julia?
A Beautiful Type System. One of the first things you'll be told is that Julia is dynamically typed. That is, statically typed (C++, Java, Haskell) versus dynamically typed (Lisp, Python, JavaScript).
Julia uses a just-in-time (JIT) compiler that is referred to as "just-ahead-of-time" (JAOT) in the Julia community, as Julia compiles all code (by default) to machine code before running it.
I think the answer depends on which kind of run-time error you want, since Julia's compile-time occurs at a point in time that most compiled languages would call run-time.
If you type the inputs of all of your functions and also type all of the variables in all of your functions, you'll be able to get a lot of type errors at Julia's compile-time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With