alt.hn

1/14/2025 at 5:46:41 PM

Show HN: WASM-powered codespaces for Python notebooks on GitHub

https://docs.marimo.io/guides/publishing/playground/#open-notebooks-hosted-on-github

by mscolnick

1/14/2025 at 9:37:51 PM

> CORS and GitHub

The Godot docs mention coi-serviceworker; https://github.com/orgs/community/discussions/13309 :

gzuidhof/coi-serviceworker: https://github.com/gzuidhof/coi-serviceworker :

> Cross-origin isolation (COOP and COEP) through a service worker for situations in which you can't control the headers (e.g. GH pages)

CF Pages' free unlimited bandwidth and gitops-style deploy might solve for apps that require more than the 100GB software cap of free bandwidth GH has for open source projects.

by westurner

1/14/2025 at 9:59:02 PM

Thanks for sharing these resources

by mscolnick

1/14/2025 at 8:31:51 PM

I absolutely love that this can be hosted on Github Pages. Am I correct in understanding that these notebooks will run independently, and will not need to proxy through marimo.app (in case the app goes down), or is that what the CORS thing is about in note 4, and it will still need to go through this domain?

by HanClinto

1/14/2025 at 8:40:21 PM

Yea, this can be hosted on GitHub pages without any vendor infra (no marimo.app)

These are two separate features:

1) marimo.app + github.com/path/to/nb.ipynb does run on marimo.app infra. this is what the Show HN was about

2) separately, you can use the marimo CLI to export assets to deploy to GitHub page: `marimo export html-wasm notebook.py -o output_dir --mode run` which can then can be uploaded to GH pages. This does not find all the data in your repo, so you would need to stick any data you was to access in a /public folder for your site. More docs here: https://docs.marimo.io/guides/exporting/?h=marimo+export+htm...

by mscolnick

1/14/2025 at 11:17:34 PM

Nice ! Is it possible to connect to an in browser DB like WASM DuckDB https://duckdb.org/docs/api/wasm/overview.html or https://github.com/babycommando/entity-db ?

That would be most useful imho !

by wolfgangK

1/14/2025 at 11:29:45 PM

duckdb works — just import duckdb. We also have built-in SQL cells, powered by duckdb, which should also work.

by akshayka

1/15/2025 at 9:29:57 AM

can I config sql cells to use different data source (remote DB/APIs) instead of local duckdb?

by unrealhoang

1/14/2025 at 7:26:36 PM

Super cool to see a real use-case of WASM outside of just game dev and nerding out.

by hzuo

1/14/2025 at 9:20:23 PM

We also have Flash, Java Applets, ActiveX and Silverlight back, running on top of WebAssembly.

by pjmlp

1/15/2025 at 9:57:42 PM

i hope this is true

by mring33621

1/16/2025 at 6:54:31 AM

It is, and it is quite easy to find where those implementations are available, not going to do the search engine work.

by pjmlp

1/14/2025 at 8:09:49 PM

Blazor is another example

by PKop

1/15/2025 at 4:58:40 PM

This is an awesome, and as a bonus I learned about a mature reactive notebook for python. Great stuff.

The data sharing is awesome. I previously used Google Colab to share runnable code with non-dev coworkers, but their file support requires some kludges to get it working decently.

I know I should just RTFM, but are you all working on tools to embed/cross-compile/emulate non-python binaries in here? I know this is not a good approach, but as a researcher I would love to shut down my server infrastructure and just use 3-4 crusty old binaries I rely on directly in the browser.

by maliker

1/14/2025 at 10:26:28 PM

I love seeing projects like this. When Pyiodide came out I was excited but it was a bit difficult to use, this looks and feels fantastic.

I really like Observable as well, but I've found it difficult to find robust and broad numerical libraries in javascript like what Python has.

I would love for this type of tool to redefine how we do science. It would be amazing if many scientific papers included both their data and the code in an interactive environment with zero installs and configuration. Plus when discussing a paper you could "fork" it and explore different analysis options live which for many fields would be totally feasible to do in the browser.

by data-ottawa

1/14/2025 at 10:50:53 PM

I feel like pytomls and shared source are becoming standard, but yes-

notebooks vs research code are sometimes very separate, very difficult to directly reproduce. A big difficultly with "working out of the box, shared in browser" is that weights, training, inference, simulations- are all still very compute intensive.

BUT the nice thing about a stateless notebook, is that you can precompute values- and cache them. I've been really excited about expanding marimo's caching system, and would love to get to a point whether sharing a notebook means being able to run the research yourself without some big setup dance.

by dmadisetti

1/14/2025 at 9:32:02 PM

> [ FUSE to GitHub FS ]

> Notebooks created from GitHub links have the entire contents of the repository mounted into the notebook's filesystem. This lets you work with files using regular Python file I/O!

Could BusyBox sh compiled to WASM (maybe on emscripten-forge) work with files on this same filesystem?

"Opening a GitHub remote with vscode.dev requires GitHub login? #237371" ... but it works with Marimo and JupyterLite: https://github.com/microsoft/vscode/issues/237371

Does Marimo support local file system access?

jupyterlab-filesystem-access only works with Chrome?: https://github.com/jupyterlab-contrib/jupyterlab-filesystem-...

vscode-marimo: https://github.com/marimo-team/vscode-marimo

"Normalize and make Content frontends and backends extensible #315" https://github.com/jupyterlite/jupyterlite/issues/315

"ENH: Pluggable Cloud Storage provider API; git, jupyter/rtc" https://github.com/jupyterlite/jupyterlite/issues/464

Jupyterlite has read only access to GitHub repos without login, but vscode.dev does not.

Anyways, nbreproduce wraps repo2docker and there's also a repo2jupyterlite.

nbreproduce builds a container to run an .ipynb with: https://github.com/econ-ark/nbreproduce

container2wasm wraps vscode-container-wasm: https://github.com/ktock/vscode-container-wasm

container2wasm: https://github.com/ktock/container2wasm

by westurner

1/14/2025 at 8:14:32 PM

This is really cool -- going to show it off to my team. I love the fact that you opened it up so that it will work with Jupyter notebooks as well.

by dhbradshaw

1/14/2025 at 10:29:58 PM

The future is awesome. Thanks for building this!

by lordswork

1/14/2025 at 8:18:31 PM

wow a python interpreter is "only" 100MB not sure if that's what's happening here

by ge96

1/14/2025 at 8:45:22 PM

It is much smaller than that, Pyodide is only 2.8mb and the Python stdlib is 2.3mb when zipped

by mscolnick

1/14/2025 at 10:17:33 PM

There is $300k in bounties if you create under 1MB WebAssembly CPython distribution

https://www.reddit.com/r/Python/comments/1huxrs6/python_runn...

by miohtama

1/15/2025 at 7:01:24 AM

will the Python ecosystem feel the need to "tree shake" its way to small bundle sizes? Its easy to eliminate tk and turtle graphics, but if a project uses foo.bar.x its hard to determine if rest of foo can be eliminated. JS kinda solved that problem.

by aitchnyu

1/15/2025 at 3:26:06 AM

50k for the 1mb challenge. The rest is to build out the tooling. It looks like they want to run existing ML python libs from within the NEAR blockchain environment.

Wondering why they don't separate concerns here.

by palmfacehn

1/14/2025 at 10:20:28 PM

now that's a weissman score

by ge96

1/14/2025 at 8:46:32 PM

Oh that's great

by ge96

1/14/2025 at 8:43:48 PM

Is that too small or too large in your estimation?

by bagels

1/14/2025 at 8:46:04 PM

Wrt web pages supposedly being a couple megabytes it's a big number but at the same time it seems expected with these kind of applications (usually when I see WASM it's a 3D video game)

by ge96