Eval without JIT

102 views
Skip to first unread message

Christian Rorvik

unread,
Oct 20, 2016, 7:37:25 AM10/20/16
to julia-users
I have a soft realtime system embedding julia for customizing some of the logic in the system. From time to time I send updates to this system in the form of expressions or scripts that will be parsed and evaluated. These are only evaluated once and never again, so my intuition would be that it's probably cheaper to interpret the code than to JIT compile and run it. Is there any mechanism for controlling what eval() does?

Steven G. Johnson

unread,
Oct 20, 2016, 8:22:51 AM10/20/16
to julia-users
eval() already uses an interpreter without JIT for sufficiently simple expressions.

Christian Rorvik

unread,
Oct 20, 2016, 8:44:11 AM10/20/16
to julia-users
I see, so there's a heuristic, but no way to hint it or tell it what to do directly?

Isaiah Norton

unread,
Oct 20, 2016, 9:43:33 AM10/20/16
to julia...@googlegroups.com
There is a startup option that controls this: `--compile=off` (internally corresponds to `jl_options.compile_enabled`). I don't think there is a function to modify the value at runtime. However, some types of statements are not currently supported by the interpreter, so this is not really feasible yet (see the heuristics in src/toplevel.c:`jl_eval_with_compiler_p`  [1]).

Full interpretability (with the exception of `ccall`) is an active goal [2], in order to support static compilation. When that is complete, it may make sense to add a `jl_enable_compiler(bool)` runtime function.
Reply all
Reply to author
Forward
0 new messages