Replies: 3 comments 13 replies
-
It seems like it has zero advantages over spending those efforts in rewriting the runtime pieces in C#/NAOT instead:
|
Beta Was this translation helpful? Give feedback.
-
Even if we choose to rewrite the native part of runtime, we will instead choose to rewrite it in C# because this would allow us to inline internal calls to the runtime without any FFI approach and enable runtime code trimming. I totally don't see any advantage of rewriting the runtime in Rust. |
Beta Was this translation helpful? Give feedback.
-
Hot take: I don't think Rust actually offers any particularly meaningful advantages for a runtime system like CoreCLR/Mono. The portions of the runtime that deal with threading and GC will never be able to take advantage of Rust's semantics because those subsystems are beholden to .NET semantics at the end of the day. For the JIT, memory management is nearly a non-issue; compilers tend to have very predictable and understandable memory management patterns. |
Beta Was this translation helpful? Give feedback.
-
Hello all,
I would like to bring up for discussion an idea that has been bothering me for quite some time. My demanding time management has so far prevented me from developing a proof-of-concept. However, I am convinced that there is plenty of potential in this vision.
Please consider the possibility of an additional runtime based on Rust that exists in parallel with CoreCLR and Mono.
Initially, this would be an experimental endeavor, but it could have considerable benefits.
The performance and memory safety of Rust are recognized advantages that probably have not escaped many.
Runtimes such as Cranelift (currently powering wasmtime) have already proven that Rust-based JIT runtimes can be efficient and powerful.
A new runtime in Rust would not necessarily have to focus on codegen optimizations for specific architectures.
Rather, a bridge could be built between .NET components such as the IL parser, garbage collector, threading, etc. and the underlying runtime. This could involve implementations in Cranelift and via FFI interfaces to LLVM.
This approach could promote greater transparency, structure, and modularity in the code, making the project more robust and maintainable overall.
While some proponents prefer a runtime written in C#, I believe that .NET and Ahead-of-Time (AOT) compilation are currently not optimally equipped for such complex tasks.
By considering Rust as the language for this new runtime, we could achieve a balance between modern, security-oriented language features and the need for high performance and efficiency.
Certainly, developing such a new runtime would require a certain amount of time. But I could imagine that .NET could once again be taken to a new level.
Please leave your thoughts, criticisms, ideas on this proposal.
Beta Was this translation helpful? Give feedback.
All reactions