3 ms·
Do you guys know if it's possible to generate self-standing C++ code from Julia code? (i.e., code that you can then compile into another project, and will not r
by jeanl 6y ago
Do you guys know if it's possible to generate self-standing C++ code from Julia code? (i.e., code that you can then compile into another project, and will not require any interpreter to run or anything like that)? And if it's possible do you know how good the generated code is (in terms of speed)?
- ellisv 6y agoYou can create binaries from Julia and there are APIs to call Julia code from C/C++ https://julialang.github.io/PackageCompiler.jl/dev/devdocs/binaries_part_2/ https://julialang.github.io/PackageCompiler.jl/dev/devdocs/b... https://docs.julialang.org/en/v1/manual/embedding/ https://docs.julialang.org/en/v1/manual/embedding/
- ViralBShah 6y agoWe did have this once upon a time, going from Julia->LLVM->C using the llvm-cbe project (https://github.com/JuliaComputing/llvm-cbe https://github.com/JuliaComputing/llvm-cbe). It is not supported any more, since there are easier ways to achieve what you are asking for. If your code does eval, then there is no way out. If you can ensure your code and dependencies does not have dynamic things that need compilation at runtime, it is fairly easy to remove the dependency on bundling LLVM. Speed is the same, since you are then just running cached native code.
- deleted 6y ago[deleted]