Snapshotting is like compiling but better

Snapshotting is like compiling but better

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.

Microvium is very small

Microvium is very small

The Microvium JavaScript engine for microcontrollers takes about 8.5 kB of ROM and 34 bytes of RAM per VM while idle, making it possibly the smallest JavaScript engine to date with more language features than engines 5x its size.

Short-lived memory is cheaper

Short-lived memory is cheaper

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 …

Read More Read More

Microvium: updated memory model

Microvium: updated memory model

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 …

Read More Read More

Microvium Closure Variable Indexing

Microvium Closure Variable Indexing

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, …

Read More Read More

Incidental vs Accidental Complexity

Incidental vs Accidental Complexity

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 …

Read More Read More

Immutable.js vs Immer

Immutable.js vs Immer

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. …

Read More Read More

Distributed apps in JavaScript

Distributed apps in JavaScript

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 …

Read More Read More

Quality vs Quantity

Quality vs Quantity

It’s an age-old debate, but as I get older, my perspective is changing. I feel increasingly frustrated by tools that don’t work smoothly; tools that weren’t thought out very well. And I ask myself, wouldn’t my life be better without these? TL;DR The economic incentive for product development is not always aligned with what makes …

Read More Read More