symja_android_library
symja_android_library copied to clipboard
Create a Jupyther kernel
What's the best option to create a Jupyther kernel?
- creating BeakerX extension
- Update 2019-02: created a BeakerX kernal for Symja in MMA mode
- another option could be using Java JShell-usage together in an IJava Kernel
- jupyter-kernel-jsr223 could possibly reuse the existing Symja jsr223 MathScriptEngine
Two possible REPLs are available.
- two REPLs are available in the library a Console.java for standard math input and a MMAConsole.java for Mathematica like syntax input.
Probably utilizing the iwolfram project is best. It works by taking a path to an executable that provides an MMA-like REPL prompt. It uses pexpect in the backend to communicate. You'll need to make sure that Symja can properly run the init.m script, which has a bit of low-level hackery to serialize all REPL outputs to base 64. Good luck! If you need a template, I hope to have a CL to iwolfram adding support for Expreduce today or so, as I started work on this yesterday.
Does this need a native executable? Like created in the GraalVM aot compilation?
It doesn't care if the REPL runs from Python, Go, Java, GraalVM Java, or Assembly. It just needs to prompt the user for an input command and return a textual response.
What I mean is, that I'm currently working under windows and iwolfram seems to be linux.
With the GraalVM someone with linux experience can probably generate a linux executable: https://royvanrijn.com/blog/2018/09/part-1-java-to-native-using-graalvm/
I believe that a (possibly) easier alternative would be using IPython kernel wrappers which implement most of the kernel code, with py4j for calling the Java code.