-
Notifications
You must be signed in to change notification settings - Fork 392
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 support #542
Comments
Wow, this totally could be implemented using https://github.com/JuliaInterop/JavaCall.jl like Python! |
That would be awesome! That should work at least for the long term support branches of julia (1.0.x) and probably julia 1.3 once it is released. |
We'd welcome a PR for this! Intending to have some rough developer documentation up soon, but the main part of adding a new language is just implementing this interface: https://github.com/polynote/polynote/blob/master/polynote-kernel/src/main/scala/polynote/kernel/interpreter/Interpreter.scala |
Hi! Are there any further plans for this? Could you give some more info on what is exactly needed to implement Julia as plugin? |
@wizofe we don't have any immediate plans to add Julia support, but of course a PR would be welcome. It would involve creating a JNI binding for running Julia code and introspecting Julia values, and implementing the |
@BeastyBlacksmith @dondish @wizofe I started playing around with making a JNA-based interface to libjulia, for the JVM->Julia part (and I guess the Julia->JVM part could be accomplished by JavaCall.jl as @dondish mentioned, though it doesn't look like a particularly nice interface at the moment). Theoretically, I could make a plugin now that interprets Julia code. But, there's a couple of roadblocks (around how to make something like a "scope" in Julia... and then things like how autocomplete could work, and so forth), and my problem is that I don't really know anything about Julia. To get any further, I'd definitely need help from someone who knows & loves Julia – so if anybody wants to collaborate on this, let me know! |
Julia does support the language server protocol (https://github.com/julia-vscode/LanguageServer.jl) which should get you autocompletion and stuff. Scopes can be most easily created either by I don't know much about Java or building editors, but I'd help where I can |
@BeastyBlacksmith I guess what we'd mostly need to figure out is, how cells should be "encoded" in Julia. Every cell has to be able to use any variable from any cell that comes before it. We have different ways of accomplishing this in Scala and Python. In Scala, everything has to be a class, so we make a class that takes every available value as a constructor parameter, and the code for the cell goes into the constructor (more or less). This also makes any values defined in that cell available as fields of the cell class. Before compiling the cell, we do an extra pass where we eliminate any available values which aren't used, in order to keep stuff sane-ish. After executing the cell, we have a convenient object with a field for each value the cell defined, so we can pull those out so that they can be used in subsequent cells. In Python, we have a very convenient function Libjulia has a similar thing called |
Regarding A) Assuming you treat every cell as a function you could use I am not sure about B), but there are a few discussions about embedding julia in the JVM on the julialang discourse and this thread is a decent summary. |
Nice notebook!
Are there any plans to include julia?
The text was updated successfully, but these errors were encountered: