326 points · by abdullahkhalids · 3y ago · 55 comments
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.
https://scleox.github.io/constrained-particle-system-simulat...
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 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 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.
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.
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 changes or something like that. Each repository could be a lesson and worksheet for a coding/class, or even a collection of lessons. I imagine it would be fairly straightforward to create an interaction mode as well, for non-coders to ogle at other's charts and tables and interactive bokeh plots creations.
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.
[1] https://jupyterbook.org/en/stable/interactive/launchbuttons....
I'm not 100% sure I understand your request for a guide, but if you create your own repo based on the jupyterlite/demo template, you can then put your notebooks in `content` dir[1] and they will automatically become available. The CI build step that does this is here[2]. So in some sense you don't need a guide, it just works ;)
[1] https://github.com/jupyterlite/demo/tree/main/content
[2] https://github.com/jupyterlite/demo/blob/main/.github/workfl...
Tiny Games in JupyterLite - https://news.ycombinator.com/item?id=31315470 - May 2022 (1 comment)
JupyterLite: Jupyter WebAssembly Python - https://news.ycombinator.com/item?id=27823962 - July 2021 (2 comments)
JupyterLite – WASM-powered Jupyter running in the browser - https://news.ycombinator.com/item?id=27323548 - May 2021 (64 comments)
Then people said it can be tough for people who want to do data analysis to have to figure out installing python locally and getting everything set up to run notebooks just to open a web browser, so JupyterHub was created so that Data Analyst types didn’t have to worry about any of that, they could just open a web browser and work (also running on a server lets you have a beefy server to connect to).
JupyterLab is the next version of Jupyter Notebooks, separating some of the concerns on the back end and giving a bit of a different interface on the front end.
It's actually really nice. Works great over ondemand and is way more responsive than X-based apps.
Jupyterhub is a way to coordinate compute space / config across many users of notebooks or jupyterlab.
What I don't like it is that they invented yet another markdown syntax for code cells - it is the opening bracket # %[python] with no closing bracket.
There already is a popular markdown code cell syntax of [2]
```python
```
One more consideration is that it's not "Markdown with code blocks interspersed", one might as well use plaintext or AsciiDoc.
Of course there are tradeoffs.. I wish I had more time to work on it.
[0]: https://github.com/gzuidhof/starboard-notebook/blob/master/d...
Addressing some other comments: the main limitation you'll find is probably the filesystem. WASM File System APIs are not extremely well evolved and (i think?) they're still in-memory FSs.
This has been a problem when using Konqueror.
I think of it as a fantastic teaching tool where getting a newbie’s environment configured would otherwise be painful. With this tool, you can share a link and have people coding in moments.