Live data from Hacker News

JupyterLite: a JupyterLab distribution that runs in the browser

github.com

21–30 of 58 posts

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#21
post #17
post #2

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.

it'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…

Sure, but if you want to do a demo or have students do something quick, it's a great start

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#22
post #17

Earlier quoted context omitted.

it'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…

Not 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.

Why do you say that? I assume the timeit magic reduces a lot of overhead

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#23
post #4
post #2

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.

It really is. I guess this'll be quite useful for people on chromebooks and iPads as well.

Chromebooks 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

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#24
post #23
post #4

Earlier quoted context omitted.

It really is. I guess this'll be quite useful for people on chromebooks and iPads as well.

Chromebooks 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

Not 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.

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#25
post #17

Earlier quoted context omitted.

it'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…

Not 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.

On 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.

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#26

This GitHub Actions + GitHub Pages feature looks like the use case I would be looking to exploit for educational purposes. From this: https://github.com/jupyterlite/demo you can easily get to https://jupyterlite.github.io/demo In case anyone wants to be helpful, I would love to see a guide to how to use this to transparently display where files are stored so that I could figure out how to automatically commit my chan…

Yes, the reason I posted this is because I was looking into how to host my mini-book online, which has a lot of computational interactions built in.

I don't want to deal with hosting the backend on my server and all the security and performance issues it entails. This is a great solution.

Though not ideal. I want to publish the book as a jupyter-book, and best would be if the code cells in it were interactive. I think my readers can do without the remaining features of Jupyter lab.

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#27
This is really great because I could „install“ it on my pc at work which wouldn‘t let me install any actual downloadable software (not working there as a developer, just office stuff). It almost behaves like a real app, I only need to upload files to the app file system. Totally sufficient for running a small project and figuring things out in pandas or extracting things from a few CSVs. I tried replit.com before but the connection to the vm never really worked well enough, issuing commands took ages. Only other thing is writing PowerShell which I can run surprisingly but that’s far from the flexibility of Python.

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#28
post #23

Earlier quoted context omitted.

Chromebooks 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

Not 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.

I’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.

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#29
JupyterLite is great! I use it heavily with my middle school math students — wonderful to have NumPy, matplotlib, and friends available without needing to set up accounts. I created a package called jupy5 that provides Turtle graphics and a p5.js-inspired sketchbook for JupyterLite as well.

Re: JupyterLite: a JupyterLab distribution that runs in the browser

#30

Earlier quoted context omitted.

Not 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.

On 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.

I’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.

Post reply on HN