-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Julia -> Mathematica #8
Comments
In theory this should be fairly simple, just a case of registering a C function pointer (created from a Julia function) with MathLink, which can accept some Mathematica expression objects and return a new one. Unfortunately I never actually figured out how to do this, if the API exists in MathLink I couldn't see it. MATLink may well have some clues – if anyone is able to dig around and figure something out then patches for this functionality are certainly welcome. |
I have next to zero experience with Julia, so I cannot hack on this, but if you need some help with MathLink feel free to ask me (I am one of the authors of MATLink, which uses MathLink to call MATLAB from Mathematica). |
Mathematica now has an External Languages interface: |
@simonbyrne I would not recommend it. There are no documented tools there that would help, and I am very sceptical about a one-shoe-fits-all solution. Each language should have its own, tailored interface. |
What could potentially be an alternative to MathLink is to use the same communication method as these new interfaces, but not try to fit in the They use ZeroMQ for interprocess communication, through There still needs to be a way to encode/decode data. The new WXF format could be used for this. Its structure is fully documented, so it saves some of the guesswork that's typically needed when dealing with MathLink. I mention all this as a potential alternative to MathLink. Do not take it as a recommendation. |
Thanks @szhorvat, that is very good to know. |
At the moment I am thinking about a similar problem of passing a Julia function or other object into mathematica (e.g. an arbitrary Julia function to One option is to open up a new link for each such function, which could then be polled in a background task in Julia (on the Mathematica side this would mean that calling the function would result in putting the arguments on the link, and getting the results back again). The main problem with this approach would be knowing when to clean up the task on the Julia side. @szhorvat Do you know if |
Callback capability is not simple, and you may want to implement calling Julia from Mathematica before tackling the callback problem. But it's up to you.
No, it's not.
Do check out |
Calling Julia from Mathematica: https://reference.wolfram.com/language/ref/externalevaluationsystem/Julia.html |
I believe this internally uses a different mechanism (via BSON). Still cool though |
This looks like an interface you might want to use: |
Hi All,
Really interesting repo. Could this package possibly be used to call Julia code from Mathematica? From what I understand, the MathLink library for C/C++ allows for this functionality.
http://edenwaith.com/development/tutorials/mathlink/ML_Tut.pdf
If not, what would need to be added to enable this functionality? Anywhere I should go looking? Would it be possible to statically compile a Julia script and run it inside Mathematica? In the same spirit as Mathematica.jl, I'm looking for a low-hassle way of calling a Julia function inside of Mathematica as if it were native Mathematica. I see that this is possible with MATLAB: https://github.com/rsmenon/MATLink
The text was updated successfully, but these errors were encountered: