MicroPython running “bare metal” in the browser via unicorn.js
In this technical retrospective (2017), @m_eiman shares practical architectural lessons learned from running, scaling, or migrating production software under lean constraints.
Core Principles for Independent Builders:
Defaulting to simpler architectures (such as monolithic frameworks, SQLite, or managed VPS) prevents early engineering bankruptcy.
Evaluating true compute and egress costs reveals that high cloud bills can often be slashed by 80%+ through judicious re-platforming.
Code you write at 2 AM as a solo engineer must be easy to debug six months later without complex microservice dependencies.
Community Debate Themes:
HN engineers debated the tradeoffs between cloud convenience and raw server economics, database indexing strategies, and resisting premature architectural complexity.
CATEGORY Frugal Engineering →
HISTORICAL ERA Cloud & Mobile Era (2014–2019)
COMMUNITY SCORE ★ 103 points
TOTAL DISCUSSIONS 32 comments
This is a neat demo, but its real value for me was learning about MicroPython. Whenever I've asked friends about a small, fast, embeddable scripting language the answer has been Lua. I favor Python much more than Lua so this project is attractive.
Some bits on how eLua compares with MicroPython from their comparison page[1]:
[1]: https://github.com/micropython/micropython/wiki/MicroPythonVsELua
"Bare metal" meaning that instructions run "natively" on a simulated Cortex-M3 microprocessor via an emscripten-compiled stripped-down version of QEMU.
It's a cool way to quickly test out performance and iterate on micropython scripts built for microcontrollers; not a python engine in the browser, sandboxed and running instructions directly.
For a completely different approach, Grok Learning exposes MicroPython to the browser via a WebSocket: https://groklearning.com/microbit/
We find this approach works fine, assuming you have a stable internet connection.
Related:
http://pypyjs.org/ , https://github.com/pypyjs/pypyjs
Sadly, current implementation is buggy and has not been updated for 2 years.
I don't think "bare metal" means what you think it means.