Building Willow: A Garbage-Collected Native Language with Cranelift and a Stackless Async Runtime
Willow programming language Github link: https://github.com/lechatthecat/willow Willow is an experimental statically typed programming language that compiles to native code through Cranelift. It has class-based OOP, algebraic enums, pattern matching, Option and Result, garbage collection, and a stackless async runtime with tasks, channels, cancellation, and select. I have been building it mostly…
Willow is an experimental programming language that compiles to native code through Cranelift. It features class-based object-oriented programming, algebraic enums, pattern matching, Option and Result types, garbage collection, and a stackless asynchronous runtime. The language is the work of one person who built it to better understand the interaction of compilers, garbage collectors, and schedulers.
While Willow is not production-ready, it has reached a stage where it can run complex programs, compile multiple modules, and be benchmarked against established runtimes. Willow offers a unique combination of native AOT compilation, automatic memory management, familiar object-oriented programming, algebraic data types, and lightweight structured concurrency.
The language supports a variety of data structures, including enums, classes, and pattern matching. Willow also includes asynchronous programming constructs such as tasks, channels, cancellation, and select. Notably, Willow has its own task scheduler, channels, cancellation model, and generational garbage collector, all of which are designed to work together seamlessly.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.