Show HN: Wanim – Run Manim Python in the browser, 20× smaller than Pyodide githu...
Show HN @show
Show HN: Wanim – Run Manim Python in the browser, 20× smaller than Pyodide github.com · 3 points · 2 comments · HN thread
TL;DR Wanim is an open-source project that runs unmodified ManimCE Python animations in the browser by patching the rapydscript-ng transpiler to translate Manim code to JavaScript, paired with a companion JS library and a numpy-ts layer. The author claims the resulting bundle is about 20 times smaller than Pyodide-based approaches, and the project adds interactive controls such as sliders, switches and draggable points to scenes. The Show HN post has only 2 comments, so the discussion is thin.
- Wanim runs the original manim Python in the browser by patching rapydscript-ng to transpile Manim code to JavaScript, instead of shipping a Python runtime like Pyodide.
- The project says its bundle is about 20 times smaller than Pyodide-based ways of running manim in the browser, and readers need no install.
- Scenes embed via an npm package, a HTML element or an iframe, with quality presets such as -qm (1280x720 at 30 fps).
- Interactive blueprint scenes add controls (Slider, Switch, DraggablePoint, InputDecimalNumber, matrix editors) and reaction callbacks that re-render when readers interact.
- A playground with Share links and a presentation mode, plus a demo blog post on SVD, show the intended use for explorable math explanations.
- The author notes Manim code rarely uses libraries beyond numpy, which is why transpiling and supporting numpy suffices instead of full Python.
Links in the post
- Wanim blog: Understanding SVD interactively and visually: An explorable article on singular value decomposition where animations become interactive on double-click, built with Wanim.
- Wanim playground: Browser editor with example Manim scenes, run and share buttons, and presentation and iframe embedding options.
Discussion The thread is small, with two comments. Nivter describes a related project that runs Python directly in the browser with Pyodide and accepts a slow first run; the author replies that Manim is effectively a DSL, so transpiling it and supporting numpy avoids the need for Pyodide. The mood is friendly and technical, with the exchange centering on the trade-off between a full Python runtime and a narrower transpiled approach.
- Transpiling Manim is a practical alternative to Pyodide (some): The author argues Manim code rarely needs libraries or complex Python features beyond numpy, so a transpiler plus numpy support is enough and much lighter than Pyodide.
- Running full Python in browser via Pyodide works well (a few): Nivter reports building a Python-in-browser tool with Pyodide, accepting a high time to first run that amortizes with use, and open-sourcing it.
Links from the comments
#manim #python #browserRuntime #webAnimation #transpiler #showHN