5 ms·
JupyterLite is such an incredible piece of software. It came out of the Pyodide project, which first got Python compiled to WebAssembly working in the browser.
by simonw 4y ago
JupyterLite is such an incredible piece of software. It came out of the Pyodide project, which first got Python compiled to WebAssembly working in the browser.
It really is astonishing that they've managed to get the full data science Python stack - a lot of it based around custom C extensions (numpy, Pandas etc) running entirely in the browser.
- simonvc 4y agoIt really is. I guess this'll be quite useful for people on chromebooks and iPads as well.
- maven29 4y agoChromebooks can run linux containers out of the box, you don't need to hurt yourself like this. The experience is similar to WSL. https://support.google.com/chromebook/answer/9145439?hl=en https://support.google.com/chromebook/answer/9145439?hl=en
- analog31 4y agoNot school-issued ones, as my son and I discovered. He told me that the school had assigned a Chromebook to each student. I said: "Great, let's install Python on it." Nope. Locked down like a crab's arse. Sad. The Chromebook went under his bed, and came back out at the end of the school year when it had to be returned.
- sockaddr 4y agoI’ve never mentally rendered a crab’s ass but now your comment got me thinking, is it some sort of chitin-based mechanical trap door? Or maybe an iris like the star gate but with fewer petals? This is a particularly glaring gap in my intuition’s ability to improvise an answer.
- periheli0n 4y agoI didn’t believe it when I first read it but I can indeed run arbitrary code on my iPhone with Jupyterlite. This is great! So finally I can analyse data using the iPad on a plane, hopefully… if I find a way to reliably start Jupyterlite from the iPad‘s local storage, load my data from there, and have a persistent python environment.
- santiagobasulto 4y agoand Fortran! SciPy is like 20% fortran (as far as I remember).
- brrrrrm 4y agoit's neat, but it's kinda slow (25x slower than native when I tested it) In a JupyterLyte notebook: import numpy as np a = np.random.randn(128,128) b = np.random.randn(128,128) %timeit a @ b 1.5 ms ± 3.3 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each) On my command line: $ python3 -m timeit --setup 'import numpy as np; a = np.random.randn(128,128); b = np.random.randn(128,128)' 'a @ b' 5000 loops, best of 5: 59.4 usec per loop
- 0cf8612b2e1e 4y agoNot that I expect this to have fantastic performance, but I think your benchmark is cheating. Locally hosted Jupyter is going to have significant overhead compared to a straight Python interpreter.
- brrrrrm 4y agoWhy do you say that? I assume the timeit magic reduces a lot of overhead
- voxelghost 4y agoOn my machine parents test is; python command line 247µs local jupyter lab 274µs jupyter lite 4ms (about 16 times slower than the other two) Honestly considering how jupyter lite is working, I still feel this is pretty good.
- 0cf8612b2e1e 4y agoI’m shocked the local instance is so tight with the interpreter. I assumed jupyter injected itself all over the place to allow halting loops and what have you. I do not care about the performance of jupyer lite - that it runs at all is a miracle. That it is acceptable performance for doing demos/teaching from a browser is simply magic.
- lozenge 4y agoIn Jupyter you choose Run Cell or Debug Cell. Debug Cell just uses sys.settrace like pdb does. Run Cell is straight python. Also, the example they gave pretty much calls into C straight away.
- sireat 4y agoSuch a compact resource usage in WebAssembly. I am seeing about 50-60MB resource usage which is fantastic considering that includes pandas, numpy, sklearn and some other non standard modules. By comparison when I tried to package a hello world pandas project with PyInstaller the single file exe for Windows came out to 500MB.
- SCLeo 4y agoShameless self promotion: I made a constrained particle simulator and an numerical integrator visualizer with pyodide. (They are both for class assignments.) https://scleox.github.io/constrained-particle-system-simulator/index.html https://scleox.github.io/constrained-particle-system-simulat... https://scleox.github.io/integrator-visualizer/index.html https://scleox.github.io/integrator-visualizer/index.html
- smohare 4y ago