Reimplementing the runtime in C# #71442
-
Crazy thought idea, but would it even be possible for the runtime be written in C#? I know the C# compiler was rewritten into C# (Roslyn), but the runtime is still not self-hosted. The first showstopper I can think of would be memory allocation and the garbage collector. Basically, a self-hosted runtime would need a way to allocate memory and clean it up. So the self-hosted runtime would need its own runtime below it. Runtimes all the way down. But now that AOT compilation exists, could that be worked around at all? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There's also the issue of P/Invoke. You can't P/Invoke without a runtime, but we are the runtime. It would possibly require modifying the AOT compilation step to detect things like P/Invoke and turn them into native DLL stub calls. Any allocations would require P/Invoking to |
Beta Was this translation helpful? Give feedback.
#10158