Valen creator drives ‘Golden Spike’ to connect new languages with Rust
Evan Ovadia, a Mojo core contributor and former Google engineer, has developed an experimental method to pass generic data types and functions between Rust and other programming languages, bypassing the longstanding limitations of the C ABI (application binary interface). Ovadia created this solution whilst developing Valen, his own programming language envisioned as a faster, more developer-friendly alternative to Rust, as he wanted to leverage existing Rust libraries without the constraints imposed by C's lack of generics support. This achievement represents a significant breakthrough in programming language interoperability, as it enables libraries with rich functionality to be shared across language ecosystems without being stripped down to basic primitives.
The solution operates in two parts: firstly, embedding the Rust compiler as a library (using Rust's existing rustc_driver capability) within Valen's memory space, and secondly, patching Rust to delegate to the Valen compiler when it encounters non-Rust types. The patch itself comprises approximately 100 lines of code but relies on assumptions about LLVM usage and remains deliberately unrefined for upstream inclusion into Rust proper. Ovadia acknowledged this as the riskiest part of the endeavour, though the working demonstration opens possibilities for bootstrapping other new programming languages built upon Rust's library ecosystem, potentially reducing dependence on the "creaky" C ABI.
- Rust generics now shareable between languages via compiler-as-library approach
- Valen language creator Ovadia bypasses C ABI limitations with 100-line patch
- Experimental work enables Rust libraries to bootstrap new programming languages