You’ve probably spent hours wrestling with Lua in embedded systems. You’ve seen the footprint creep up, the dependencies multiply, and the nagging feeling that maybe — just maybe — there’s a better way. There is. And it’s called Pico.
Let me tell you why this matters: The best scripting language for constrained hardware isn’t the one with the most GitHub stars — it’s the one that fits in your memory and gets out of your way.
I saw this firsthand. A firmware engineer I know spent three days trimming Lua to run on a microcontroller with 32KB of RAM. He cut tables, stripped libraries, rewrote the allocator. And still, the barebones VM ate 15KB. Then he found Pico. Total footprint: under 10KB. He had his scripting runtime running in two hours.
This isn’t a toy project anymore. The latest release (v0.2.0) adds a clean C embedding API, builds as libpico, and lets you register native functions, call PiCo methods from C, and control the VM lifecycle with just a few function calls. It’s minimalist by design, not by accident.
Most developers assume Lua is the default lightweight embeddable VM. But here’s the provocative truth: Pico’s radical minimalism makes Lua look bloated for the systems that matter most — the ones where every byte has a price tag.
Yes, Lua has an ecosystem. Yes, it’s battle-tested. But if you’re building a sensor node, a game engine for vintage hardware, or a bootloader that needs dynamic configuration, ecosystem is a luxury you can’t afford. You need something that embeds in 8KB and still gives you variables, loops, functions, and native calls. That’s Pico.
The twist? Pico isn’t trying to replace Lua everywhere. It’s winning where Lua has already lost: the truly constrained edge. It’s a different philosophy: start with nothing, add only what you need. No garbage collector. No coroutines. No modules. Just a tiny bytecode interpreter that runs on bare metal.
I’m not saying drop Lua tomorrow. I’m saying the next time you’re staring at a linker error because Lua’s internal allocator can’t fit, remember: there’s a 1,000-line C file that can give you scripting without the baggage.
Think about it: every embedded project I’ve seen that tried to avoid Lua ended up writing a custom script engine. Messy, fragile, and full of bugs. Pico gives you a real language — PiCo — with a syntax that’s easy to learn and a host API that’s clean as C. The real question isn’t “why Pico?” It’s “why are you still forcing Lua into that 16KB chip?”
This is the thrill of control. The feeling of handing your C program a scripting engine that doesn’t demand a mortgage on your RAM. Stop accepting bloat as the price of flexibility. There’s another path.
FAQ
Q: Does Pico actually run on a microcontroller with 8KB RAM?
A: Yes. The entire VM footprint (code + runtime) sits under 10KB on most architectures. You can run simple scripts with variables, loops, and native calls in as little as 4KB of RAM, depending on your script size.
Q: What’s the practical benefit of using Pico over writing a custom state machine in C?
A: A custom state machine locks your logic into firmware — every change requires reflashing. Pico gives you runtime scriptability without the complexity of a full OS or a heavy VM. You can update behavior via simple text files or over-the-air patches.
Q: Isn't LuaJIT or eLua a better choice for constrained devices?
A: LuaJIT targets desktop-like performance, not tiny MCUs. eLua is a fork that’s largely dormant. Pico is actively maintained (v0.2.0 released recently) and designed from the ground up for the sub-10KB RAM regime. If you need Lua’s ecosystem, you’re not in that regime.