berry-lang/berry
FreeA ultra-lightweight embedded scripting language optimized for microcontrollers.
About berry-lang/berry
Berry is an ultra-lightweight dynamically typed embedded scripting language designed for lower-performance microcontrollers. The interpreter core is less than 40KiB in code size and can run on less than 4KiB of heap memory (on ARM Cortex M4 with Thumb ISA and ARMCC compiler). It features a one-pass bytecode compiler and a register-based virtual machine, all written in ANSI C99. Berry supports imperative, object-oriented, and functional programming paradigms, includes garbage collection, and provides an easy-to-use foreign function interface (FFI). It is optimized for RAM savings by storing constant objects in read-only code data segments. The language offers base types such as nil, boolean, integer, real, string, class, instance, module, list, map, and range, along with control structures, functions, closures, lambda expressions, and single inheritance classes.
Key Features
Pros & Cons
- Extremely small memory footprint suitable for microcontrollers
- Fast execution with optimized compiler and register-based VM
- Flexible multi-paradigm language (imperative, OOP, functional)
- Easy to embed in existing C applications via clean FFI
- RAM efficient due to compile-time constant object storage
- Simple syntax and good documentation available
- Niche focus on embedded systems; not suitable for general-purpose application development
- Limited ecosystem and third-party libraries compared to mainstream languages
- Small community and fewer resources for learning and troubleshooting
- Performance and feature trade-offs due to minimalistic design