purescript / roadmap

Long-term projects not covered by other issues lists
20 stars 1 forks source link

Jupyter (iPython back end) integration #24

Open paf31 opened 8 years ago

Eoksni commented 6 years ago

I'm super interested in the jupyter backend for purescript, in fact, I'm interested enough to take a try on implementing it myself (if its not already a WIP by somebody else).

They say in the docs that it is somewhat easy to make a "wrapper kernel" if "REPL can be controlled in a tty using pexpect" - http://jupyter-client.readthedocs.io/en/stable/wrapperkernels.html. I suspect it should hold for the purescript REPL, and if it does, I'll go with that route because properly implementing a kernel from scratch seems like too much work, honestly.

I'd be happy to receive any advice/directions on this topic, as I've never been developing anything for jupyter itself, and I know nothing about purescript as well (I wanted a jupyter kernel to start learning purescript).

Eoksni commented 6 years ago

I'm not sure if this is a right place to write this, but For those interested, I checked pexpect, and it does indeed work with purescript REPL - I can launch the REPL, send some expressions to it and read the output. So this "wrapper kernel" approach seems legit.

The only issue here is that pexpect seems to have not-so-great support for Windows OS therefore the resulting kernel might be for POSIX only.

UPDATED:

Hooray! I actually did it! example I just need to package it properly, aand its gonna take some time because I've never done that before and currently I have all paths hardcoded, and also deal with the cross-platform issue of pexpect. No syntax highlighting though, not quite sure yet how to add it.

Eoksni commented 6 years ago

Alright, here it goes https://github.com/Eoksni/ipurescript It probably could have been done better, but it works well enough for me. All the feedback is greatly appreciated!

peey commented 5 years ago

A better supported official version would be awesome. @Eoksni's one says that it hasn't been checked besides windows and there are some known bugs listed as well.

Eoksni commented 5 years ago

Yeah, my implementation is definitely not production-ready. Unfortunately I don't have time to work on it anymore. I'd be happy to help/test if someone decides to continue on that project or start their own.