3 ms·
I see that the julia page says that Julia can call out to C functions[0], but can C functions call into Julia? ie: make a program "myprog" like: cc -o myprog
by bch 13y ago
I see that the julia page says that Julia can call out to C functions[0], but can C functions call into Julia? ie: make a program "myprog" like:
cc -o myprog myprog.c -ljulia
and be able to call julia_domath()?
edit: reference to julia documentation
[0] http://docs.julialang.org/en/latest/manual/calling-c-and-fortran-code/ http://docs.julialang.org/en/latest/manual/calling-c-and-for...
- sveme 13y agoIt is a bit hidden, but calling julia from C is possible in the 0.3 prerelease: http://docs.julialang.org/en/latest/manual/embedding/ http://docs.julialang.org/en/latest/manual/embedding/
- bch 13y agoThat is _exactly_ what I was imagining, and very exciting. Let the experimenting begin!
- bch 13y agoI don't see an 0.3.0rc or obvious github branch -- what's the best way to follow 0.3.0?
- ihnorton 13y agoNo RC yet, 0.3-pre is the github trunk.
- zmk_ 13y agoYou can get compiled nightlies at http://status.julialang.org/ http://status.julialang.org/ Otherwise building the master branch will get you prerelease.
- pygy_ 13y agoIt is developed on the master branch, and there's a v0.3 milestone for the related issues. https://github.com/JuliaLang/julia/issues?milestone=7&page=1&state=open https://github.com/JuliaLang/julia/issues?milestone=7&page=1... You can find recent binaries here: http://status.julialang.org/ http://status.julialang.org/ You can also check the dev mailing list: https://groups.google.com/forum/?fromgroups#!forum/julia-dev https://groups.google.com/forum/?fromgroups#!forum/julia-dev
- ihnorton 13y agoJulia can call out to C functions[0], but can C functions call into Julia? There are several aspects to this: - Julia cannot generate linkable shared libraries, yet. - There is a fairly small "libjulia" C API (the embedding reference in another comment), but this is a means to interact with/control the program "julia" (for dynamic interop. or IDE use, for example). "libjulia" does not export symbols for arbitrary Julia code. - It is possible to generate a C-callable function pointer from a Julia function at runtime and to pass this into a C routine controlled by Julia (for example, to pass a comparator to a sorting routine, or an objective function to an optimizer).