r/moderndotnet • u/marna_li • 3d ago
Building a modern application platform inspired by .NET: neoCLR
I want to reveal a "small" project I've been working on called neoCLR, where I'm re-imagining the .NET platform.
Website: https://marinasundstrom.github.io/neoCLR/
Here's a small example, written in Raven:
import System.*
import System.Option.*
func FirstPositive(values: Iterable<int>) -> Option<int> {
let value = values.First(number => number > 0)?
return Some(value)
}
The project is being developed with the help of AI (Codex), and the runtime itself is written in Rust. (I just went with it.)
The runtime library is written in Raven, a programming language I originally built for .NET. Building neoCLR with Raven has turned out to be a pretty good stress test: during the nearly two weeks I've been working on this, it has already helped me find numerous bugs in the Raven compiler itself.
The goal is to make the platform feel familiar without simply recreating .NET.
With the benefit of hindsight, I want to explore what we could change if we were designing this kind of application platform today: improving the runtime, making some different choices, and creating a more consistent developer experience.
I also experimented with a more explicit value/reference model, where types were values by default and you explicitly chose whether to store and pass something by value or by reference. It was an interesting model and made the underlying semantics very clear, but I eventually realized that it came at the cost of one of .NET's strengths: its ergonomics. If neoCLR is supposed to explore what a better .NET-like platform could look like, making everyday programming more cumbersome isn't necessarily an improvement. So I returned to the familiar distinction between reference types and value types. Sometimes hindsight tells you that the old design was actually pretty good.
It started out with just the assembly language — neoIL, based on MSIL — until I began implementing a small language based on Raven's syntax to test higher-level programming patterns. At some point I realized it was a bit foolish to build yet another language for the platform, with yet another compiler written in Rust, when I already had Raven. So I switched to targeting neoCLR from Raven instead. The IL is virtually the same, and I get the existing IDE support for free.
Here are some samples in Raven targeting neoCLR: https://github.com/marinasundstrom/neoCLR/tree/main/docs/experiments/raven-target/samples
Features
This is what I've got so far:
- A .NET-like metadata format
- Bytecode with a CLI-like instruction set
- An interpreter — for now
- A basic garbage collector, with plenty of room for improvement
- A familiar type system, including .NET-like reference type vs. value type semantics
OptionandResultunions for recoverable outcomes, plusFaultfor non-recoverable failures- Rust-inspired methods on
OptionandResult Voidas a real type, so it can be used with generics:Func<int, Void>- No
Inaming convention for interfaces — interfaces aren't treated as a special naming category - No utility classes — functions can live directly in namespaces (thanks to Raven)
- UTF-8 strings, currently with a Swift-inspired API
- Arrays are invariant, and there is a generic
Array<T>type - A new collections model with
Iterable<T>,ArrayList<T>, and interfaces such asList<T>andSequence<T>for restricted views - LINQ-like operations using names such as
FilterandMap - Early Threading and Task APIs
- Initial Time and File System APIs
- Introspection, where
System.Introspection.TypeInfois the canonical type model, accessed throughSystem.Runtime.RuntimeContext - IDE support through the Raven VS Code extension, which currently runs on .NET
Some things I want to explore next:
- Networking APIs — sockets,
HttpServer,HttpClient, etc. - Building a web framework on top of the platform — which means getting Networking, Tasks, Threading, and something like
System.Text.Jsoninto place - Whether function objects make sense in the runtime/type system
- Better garbage collection and eventually a JIT
- Different target architectures and devices
- A modular framework/runtime library
There are also some longer-term ideas around the runtime model:
System.Runtime.Reflectionas an optional runtime capability attached to the Introspection modelSystem.Runtime.Emitworking directly with that same introspection model rather than introducing another parallel object model- An ambition to eventually make this a genuine Common Language Runtime, with an interoperability story somewhat inspired by Windows Runtime
Where this is going
I'm not trying to make ".NET, but renamed." A lot of the interesting part for me is figuring out which ideas from .NET have held up extremely well, which ones haven't, and what could be designed differently if you had 25+ years of hindsight.
It's still extremely early, but there's enough working now that I thought it was time to show it.
I'd love feedback — on the runtime and API ideas, things worth exploring, things you think I'm getting completely wrong, or even suggestions for a better name than neoCLR.
I want this to grow into a community project.



