NetBSD developer Benny Siegert explains why Rust won't be coming to the NetBSD kernel anytime soon, despite the project's unique support for Lua scripting in the kernel.
NetBSD's Kernel Supports Lua Scripting But Don't Look For Rust In There Anytime Soon
Written by Michael Larabel in BSD on 5 February 2026 at 05:49 AM EST.
For those not fond of the increasing use of the Rust programming language within the Linux kernel or FreeBSD's considerations for Rust in its kernel, you can perhaps find refuge within NetBSD. One of the NetBSD developers has explained why you likely won't be finding Rust code within the NetBSD kernel anytime soon.
NetBSD developer Benny Siegert who also works for Google wrote a blog post this week explaining why there likely won't be Rust code within its kernel anytime soon. That's even with NetBSD's kernel supporting Lua scripts as a unique trait.
Diminishing the prospects of Rust code within the NetBSD kernel is that there are many CPU architectures supported where Rust isn't even available. That would be the lead and immediate blocker to Rust programming language use by NetBSD that supports a diverse array of architectures in a meaningful manner. Maintaining Rust support has also been challenging with their package management.
Also sharply pushing out any idea of using Rust in the NetBSD kernel is that NetBSD's release cycles not aligning with Rust. NetBSD supports the last two major releases and that means NetBSD 9.0 from 2020 and Rust 1.41 of that the isn't too practical: "If Rust 1.41 had been part of NetBSD 9, it would be useless for anything except compiling NetBSD itself – Rust 1.41 is so old that basically no modern code would compile with it. Not great."
All the details on why you likely won't find Rust in the NetBSD kernel soon can be found on Benny Siegert's blog.

NetBSD's Unique Approach to Kernel Scripting
While many operating systems are moving toward Rust for kernel development, NetBSD has taken a different path by embracing Lua scripting within its kernel. This approach provides a middle ground between the safety benefits of Rust and the flexibility of scripting languages.
Lua scripting in the NetBSD kernel allows developers to write kernel modules and extensions in a high-level language while maintaining the performance characteristics of C for core kernel operations. This hybrid approach gives NetBSD users the ability to customize and extend kernel functionality without the complexity of writing C code or the overhead of user-space solutions.
The Architecture Challenge
The fundamental issue preventing Rust adoption in NetBSD stems from the project's commitment to supporting a wide range of hardware architectures. While Rust has made significant progress in recent years, it still lacks comprehensive support for many of the platforms that NetBSD targets.
NetBSD's architecture support includes:
- Traditional x86 and x86-64 systems
- ARM variants including ARM64
- MIPS processors
- PowerPC
- RISC-V (emerging support)
- Various legacy architectures like VAX, Alpha, and SPARC
For many of these platforms, Rust either has no support at all or is in such early stages that it cannot be considered production-ready. This creates an immediate and insurmountable barrier for any project that aims to maintain consistent support across all these architectures.
Package Management Complications
Beyond the architecture limitations, NetBSD faces significant challenges in maintaining Rust support through its package management system. The NetBSD Packages Collection (pkgsrc) must handle dependencies, version compatibility, and security updates for all supported software, including programming languages.
Rust's rapid release cycle and the way its package ecosystem (Cargo) operates create additional complexity for integration into a traditional package management system. Each Rust release potentially introduces breaking changes, requiring careful coordination and testing across the entire package tree.
Release Cycle Misalignment
The most practical barrier to Rust adoption in NetBSD relates to the fundamental mismatch between NetBSD's release cycle and Rust's rapid development pace. NetBSD follows a traditional release model where major versions are supported for extended periods, while Rust releases new stable versions every six weeks.
Siegert's example of Rust 1.41 illustrates the core problem: if NetBSD 9.0 had shipped with this version in 2020, it would already be severely outdated by 2026 standards. Modern Rust codebases typically require much newer versions of the compiler, making it impractical to maintain kernel code that must remain compatible with an ancient Rust version throughout the support lifecycle of a NetBSD release.
This creates a catch-22 situation: using a newer Rust version would break compatibility with older NetBSD releases, while using an older version would prevent the use of modern Rust features and libraries.
The Lua Alternative
NetBSD's decision to support Lua scripting in the kernel represents a pragmatic alternative to Rust adoption. Lua offers several advantages:
- Mature implementation available across all NetBSD-supported architectures
- Small footprint suitable for kernel integration
- Simple C API for embedding
- Proven track record in embedded systems and game development
- Minimal runtime overhead
This approach allows NetBSD to provide some of the benefits that Rust advocates seek - safer code, easier extension development, and reduced complexity - without the architectural and logistical challenges that Rust would introduce.
Community Implications
The decision to avoid Rust in the NetBSD kernel reflects broader philosophical differences between the BSD and Linux communities. While Linux has embraced Rust as a way to improve kernel security and developer experience, NetBSD's approach emphasizes stability, broad hardware support, and proven technologies.
For developers who prefer the BSD philosophy but are concerned about the increasing complexity of modern operating systems, NetBSD's stance on Rust may be reassuring. It demonstrates a commitment to maintaining a kernel that remains accessible and maintainable across a diverse range of hardware platforms.
However, this decision also means that NetBSD may miss out on some of the security benefits that Rust's memory safety guarantees could provide. The project will need to continue relying on careful C programming, extensive code review, and other traditional security practices to maintain kernel integrity.
Looking Forward
While Rust appears unlikely to appear in the NetBSD kernel in the near future, the project continues to evolve. The Lua scripting support may expand, and NetBSD could explore other approaches to improving kernel safety and extensibility.
For now, NetBSD users can take comfort in knowing that their operating system will continue to support their hardware of choice while avoiding the complexities that Rust adoption would introduce. The project's pragmatic approach to technology adoption - embracing Lua while declining Rust - exemplifies the careful consideration that has kept NetBSD relevant across decades of computing evolution.

The full technical details and reasoning behind NetBSD's position on Rust can be found in Benny Siegert's original blog post, which provides a comprehensive analysis of the technical and practical challenges that make Rust adoption impractical for the NetBSD kernel at this time.

Comments
Please log in or register to join the discussion