Lambda C
A compact bytecode VM with a C-flavored scripting language — built for embedded orchestration
Compact VM
4-byte fixed-length instructions. About 5 KB of bytecode for a 1,225-instruction program. Zero external dependencies, suitable for direct Flash / EEPROM deployment.
O(1) FFI Dispatch
Function names are resolved to integer IDs once at load time. About 100 ns per FFI call thereafter — predictable latency for real-time control loops.
C Subset Syntax
struct, union, enum, typedef, function pointers, full control flow. Zero learning curve for embedded C developers; algorithms port from host C with minimal change.
Hot Reload & Debug
Reload bytecode without restarting the VM. Built-in watchpoints, GDB pretty printer, postmortem crash dumps, and instruction-level trace mode.
Flagship Demo: Drone Delivery
The repository ships a complete drone delivery simulator driven by a Lambda C script: an 11-state mission machine, proportional altitude/position control, raylib-based 3D rendering, and hot-reload of the in-flight mission with the R key.
It is the clearest reference for Lambda C's design — the script states intent, the host enforces feasibility.
Quick Example
A script that calls into a host-provided get_time():
// hello.c — script
double get_time();
int main() {
double t = get_time();
printf("Time: %.2f\n", t);
return 0;
}// host.c — embedding the VM
#include "common.h"
#include "bytecode.h"
static void ffi_get_time(LcvmState *vm) {
lcvm_push_double(vm, 123.45);
}
int main() {
LcvmState vm;
compact_program_t prog;
lcvm_init(&vm);
lcvm_register_function_ex("get_time", ffi_get_time, 0, "");
lcvm_compact_load("hello.lcbc", &prog, 0);
lcvm_link_program(&prog);
lcvm_run_compact(&vm, &prog, 0);
lcvm_compact_free(&prog);
return 0;
}Designed for Embedded Orchestration
Lambda C is an embedded orchestration VM operating inside a single trust domain. The host C program owns hardware, registers FFI capabilities, and deploys bytecode it produced itself.
Lambda C deliberately does not target:
- Multi-tenant execution. All VMs in a process share one FFI capability set.
- Untrusted bytecode.
.lcbcfiles are assumed to arrive over a trusted channel (signed firmware, signed OTA). No instruction-level verifier is provided. - General-purpose scripting. No closures, no GC, no dynamic typing — intentionally.
- Standalone deployment. Lambda C is always embedded into a C host.
Scripts express intent; FFI implementations decide feasibility against current physical state. This matches the layered separation found in aerospace and automotive control software — the autopilot expresses what it wants, the HAL/driver layer validates against armed/calibrated/thermal limits and either executes, saturates, or rejects.
See Architecture for the full design philosophy.
Why Not Lua or MicroPython?
| Feature | Lambda C | Lua 5.4 | MicroPython |
|---|---|---|---|
| RAM usage | ~16 KB | ~64 KB | ~128 KB |
| Language | C subset | Lua | Python |
| ROM deployment | Supported | Difficult | Difficult |
| Startup time | Fast | Moderate | Slow |
| FFI call cost | ~100 ns | ~200 ns | ~500 ns |
Lambda C runs on 8–16 KB RAM (Cortex-M0+ class). The compiler produces position-independent bytecode that can execute directly from Flash or EEPROM. FFI dispatch is a single indirect call after load-time linking — no string hashing, no runtime symbol lookup.
Read more under VM Internals and Best Practices.
Licensing & Engagement
Lambda C is proprietary software, all rights reserved. Copying, modification, or redistribution of any part of Lambda C requires the prior written permission of Lambda LLC. It is not open source.
Binaries (the VM runtime and the lcvmc compiler) are provided free of charge, strictly as-is, with no warranty and no liability of any kind. You may evaluate and use the binaries at your own risk; we do not guarantee fitness for any purpose, do not provide support unless separately contracted, and accept no responsibility for damages arising from their use.
Source code is disclosed only to partner companies that have signed an NDA — the NDA and the accompanying agreement constitute the "prior written permission" required by the license. Source access is bundled with a paid engagement (joint development, customization, integration); it is not sold as a standalone product.
If you are evaluating Lambda C for a product or industrial application, please get in touch. We typically engage in one of three ways:
- Joint development — we work alongside your engineering team on the VM, compiler, or FFI layer for your specific hardware target.
- Customization — tuned builds for a specific MCU class, custom opcodes, or a domain-specific simulator SDK.
- Source disclosure under NDA — full source access for in-house extension, audit, and long-term maintenance.
Contact: Lambda LLC