How plausible is an emscripten jupyterlab?

77 views
Skip to first unread message

Simon Biggs

unread,
Nov 20, 2016, 7:50:25 PM11/20/16
to Project Jupyter
Supposedly http://repl.it was able to use emscripten to compile CPython to javascript. How plausible might it be to have the base jupyterlab also compiled and have a minimal working version of jupyterlab hosted as a static web page? Am I just talking nonsense, or does the fact the webassembly is a fast approaching standard make this a project worth investigating?

Steven Silvester

unread,
Nov 22, 2016, 9:46:57 AM11/22/16
to Project Jupyter
Hi Simon, 

An individual plugin could conceivably be written in CPython and compiled to JavaScript using emscripten.  Almar Klein is working on a CPython -> JupyterLab plugin generator right now using the pyscript compiler in Flexx (not yet published).   https://github.com/zoofIO/flexx.


Regards,

Steve

Thomas Kluyver

unread,
Nov 22, 2016, 9:59:22 AM11/22/16
to Project Jupyter
I guess that Simon was thinking of including an emscripten-ed cpython to run the user's code in the notebook. I think it's quite plausible, if quite a bit of work, to do that, and it would be a really fascinating tool for certain situations, like teaching basic programming. Turning it into a totally static webpage would probably require some more work, to save notebooks in local storage instead of on the server.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/d3a82f6f-9348-4262-9d22-ee99a935614d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ian Rose

unread,
Nov 22, 2016, 10:33:23 AM11/22/16
to jup...@googlegroups.com
It should be possible to get a static version of JupyerLab with CPython compiled with emscripten (with this setup you should also be able to get a Javascript kernel up and running, I think). 
However, I think that if you wanted any of the scientific stack (numpy, scipy, etc) you will have a much more difficult time of it. These all rely extensively on compiled C and Fortran code, and have pretty complicated build processes. All of these compiled modules would also need to be passed through emscripten.

Ian

Simon Biggs

unread,
Nov 22, 2016, 5:56:42 PM11/22/16
to Project Jupyter
Flex looks like it could be amazing. I shall look into that for a project I am working on. Thanks for the pointer.

With regards to storing the notebook data within the browser I recently used dexiejs (http://dexie.org) for interacting with IndexedDB. Using Dexie I was able to write an "import/export" to and from json (http://electrons.simonbiggs.net/database). (https://github.com/SimonBiggs/electroninserts-webapp/blob/master/src/app/services/data-services/data-persistence.service.ts line 278 onwards). That subset of code can be released under a more permissive license if desired.

With regards to numpy and scipy I completely understand they are a fair way off. At least until webassembly supports compiling from Fortran. Nevertheless a pure python static jupyterlab would be perfect for certain use cases. In my field (health) it can be a bureaucratic nightmare to get anything installed. Furthermore due to privacy reasons, using an off site Python server is out if the question. To show something I've written in python to someone else, and allow them to use it on their computer has often currently been insurmountable.

As an aside it might also highlight the need for a Fortran to webassembly compiler quickening the availability of the scientific computing tools within javascript.

Simon Biggs

unread,
Nov 22, 2016, 5:58:22 PM11/22/16
to Project Jupyter

Simon Biggs

unread,
Nov 22, 2016, 5:58:23 PM11/22/16
to Project Jupyter

Simon Biggs

unread,
Nov 22, 2016, 6:04:22 PM11/22/16
to Project Jupyter

Sorry about the multi post. I think it was an issue with swapping windows to and from Google groups on Android.


--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/5w4A2IOJfxE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Simon Biggs

unread,
Nov 22, 2016, 8:02:09 PM11/22/16
to Project Jupyter

I guess the answer is it is plausible, but it would be a very large amount of work.

I don't think I could do such a large amount. If someone does want to work on it I would love to help.

Simon Biggs

unread,
Nov 22, 2016, 8:13:39 PM11/22/16
to Project Jupyter
As a stepping stone that would still be useful now would it be worth having a way to have tmpnb read notebook files from the browser's IndexedDB? Or will even that stepping stone be exceptionally difficult?

Simon Biggs

unread,
Nov 22, 2016, 10:26:20 PM11/22/16
to Project Jupyter
Another point is that ChromeOS has a lot to gain from something like this. Might it be possible to get some funding from Google to pay the wages of someone to implement this?
Reply all
Reply to author
Forward
0 new messages