Myjs An accidental pure-Python JavaScript interpreter
Get picks like this daily. Today's launch numbers, the top launches, AI and tech news, and a daily opportunity pick, straight to your inbox.
Want to reach these readers? Sponsor an issue.
Hi HN! byteface here. myjs was a recent accident I'd like to share.Several years ago I began writing DOM API's in Python as a curiosity: https://github.com/byteface/domonic/Every now and then I do another pass rolling in more features from the MDN pages. I have lots of unit tests but found that porting real code and libraries was a useful test of the DOM compatibility. But I didn't want to pollute the core any further as had already ported d3 and jquery.So I created a new repo called domonic-libs: https://github.com/byteface/domonic-libs/Anyways a couple of days ago while porting some js libraries faithfully to run against dom.py and javascript.py I came across Acorn (a Javascript parser) and coverted it into pure python.Once Acorn.py was producing an AST, I mapped that against domonic's Javascript and DOM nodes and to my surprise... actual JS code started executing inside the Python process!Give it a try:pipx install myjsWould love to hear your thoughts, edge cases to test, or feedback!
HN · launched Sep 5, 2026 · 7 upvotes (top 56%) · 1 view
Niche: programming languages and interpreters · 161 launches, 2 in the last 7 days ▼ -75% · Explore this niche →
Category and tags
- Horizontal
- Dev tools
- Developer
- Not AI
- Hobby / open-source project
Visit website ↗ Source listing ↗
More like this: all 161 launches in programming languages and interpreters →
Could you build this?
No Building a custom JavaScript interpreter and complete DOM environment from scratch in pure Python requires compiler engineering, AST parsing, JS execution semantics, and event loop specifications.
What it would actually take: Requires an AST parser (or bytecode compiler) implementing ECMAScript specs, an execution runtime/evaluator, an asynchronous event loop mimicking the browser/Node microtask queue, and full implementation of hundreds of Web/DOM API specs. The hard parts are implementing JS's prototype inheritance, scoping rules, async/await semantics, and spec-compliant DOM tree mutation in pure Python without using V8 or WebKit. This demands specialized compiler and language runtime expertise.
Discussion
No comments on this launch.
Competitors
Other products that read as similar to this one : 245 launches clear the similarity bar, closest 8 shown.
Attention rank: #131 of 246 (itself plus its competitors, highest first, normalized so YC and Product Hunt are compared fairly).
Launched 308 days after the earliest competitor.
- Belgie · hn · 2026-07-06 · 5 upvotes · similarity 0.50
- Full Python 3.15 Implemented in 25k LoC C11 · hn · 2026-10-28 · 9 upvotes · similarity 0.47
- µJS, a 5KB alternative to Htmx and Turbo with zero dependencies · hn · 2026-03-07 · 161 upvotes · similarity 0.46
- OtterLang · hn · 2025-11-08 · 15 upvotes · similarity 0.46
- Zig parser in ~70 lines of JavaScript · hn · 2026-01-17 · 10 upvotes · similarity 0.45
- GrainJS · hn · 2025-12-26 · 5 upvotes · similarity 0.45
- Full Python GUI apps in the browser · hn · 2026-05-07 · 29 upvotes · similarity 0.45
- json-toolkit · github · 2026-09-29 · 37 upvotes · similarity 0.44
The niche, labels, vibe code rating and competitor comparison on this page are analysis by Nicheloom. If you use them, please credit nicheloom.com. How you may use our data.