
Microvium has try-catch!
Microvium now has exception handling, with just 4 bytes of overhead per active try block. This post covers some of the details of the design, for those who are interested

Microvium now has exception handling, with just 4 bytes of overhead per active try block. This post covers some of the details of the design, for those who are interested
The final output of a traditional compiler like GCC bears a family resemblance to a Microvium snapshot, but the snapshotting paradigm is both easier to use and more powerful because it allows real application code to run at build time and its state to persist until runtime.
The Microvium JavaScript engine for microcontrollers takes less than 16 kB of ROM and 64 bytes of RAM per VM while idle, making it possibly the smallest JavaScript engine to date with more language features than engines 4x its size

Single-threading with super-loops or job queues may make more efficient use of a microcontroller’s memory over time, and Microvium’s closures make single-threading easier with callback-style async code.
TL;DR: RAM on a microcontroller should not just be thought of as space but as space-time: a task that occupies the same memory but for a longer time is more expensive. MCU memory is expensive If you’re reading this, I probably don’t need to tell you: RAM on a microcontroller is typically very constrained. A …
TL;DR Microvium can now address up to 64 kB of ROM, up from 32 kB previously, and now runs more efficiently on small 32-bit devices such as an ARM Cortex MCU. This is a minor update regarding the data model in Microvium (previous post here), for the kind of person who’s interested in this kind …
TL;DR: In many situations, a program in Microvium bytecode can access closure variables with just a single-byte bytecode instruction. The instruction contains a 4-bit index that either indexes into the current lexical scope or recursively overflows to the next-outer lexical scope, cascading up the lexical scope chain until the variable is found. In this post, …
Developers often talk about accidental vs essential software complexity. But is there a difference between accidental complexity and incidental complexity? I think there is. I like this definition of essential complexity: Essential complexity is how hard something is to do, regardless of how experienced you are, what tools you use or what new and flashy …
This week I came across the library Immer as a convenient way of manipulating immutable data in JavaScript. After reading this Reddit thread that raves about how much better Immer is than Immutable.Js, I was worried I’d made the wrong decision to use Immutable.js in Microvium. But some performance tests quickly cleared up my concerns. …
This post is different from my usual topic of Microvium. I’ve been recently frustrated with the way that distributed applications are written and I’ve been brainstorming ways it could be improved. In my last post on the topic, I suggested that maybe a new programming language would be useful for solving the problem, but I …