Xing Shi
Xing Shi

Reputation: 2230

What happens when we run a julia-lang script?

In my understanding, julia is a script language with a JIT compiler. But in java, you can find *.class files; In python, you can find *.pyc files. This means java and python need first convert its language to bytecode, then using VM to run this bytecode. However, I can not find the bytecode files for julia like *.jlc. Any ideas?

Upvotes: 6

Views: 1415

Answers (2)

P i
P i

Reputation: 30704

This is covered in the manual: http://docs.julialang.org/en/release-0.5/devdocs/eval/

Leah Hanson has written an excellent article here on the 5 steps Julia performs to get from Julia code to native Assembly code:

Upvotes: 0

Uli Köhler
Uli Köhler

Reputation: 13750

Actually there is functionality to dump the LLVM bitcode in Julia:

See jl_dump_bitcode.

Thanks to Isiah for pointing out that it is possible to use code_llvm to read the bitcode in the interpreter.

Note that in julia_trampoline this function is used, depending on a build_path option. However this does not seem like an end-user interface to me.

In contrast to other JIT-based software like NodeJS (V8), it is however technically possible to dump the LLVM bitcode.

Upvotes: 5

Related Questions