symja_android_library icon indicating copy to clipboard operation
symja_android_library copied to clipboard

Create a Jupyther kernel

Open axkr opened this issue 7 years ago • 5 comments
trafficstars

What's the best option to create a Jupyther kernel?

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.

axkr avatar Oct 14 '18 11:10 axkr

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.

corywalker avatar Oct 14 '18 16:10 corywalker

Does this need a native executable? Like created in the GraalVM aot compilation?

axkr avatar Oct 15 '18 17:10 axkr

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.

corywalker avatar Oct 30 '18 05:10 corywalker

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/

axkr avatar Oct 31 '18 18:10 axkr

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.

TiagoCavalcante avatar Apr 23 '24 20:04 TiagoCavalcante