4 ms·
I think you have a somewhat inaccurate mental model of how things are done. For one, it doesn't really make sense to talk about the CLR when you talk about boo
by Locke1689 13y ago
I think you have a somewhat inaccurate mental model of how things are done.
For one, it doesn't really make sense to talk about the CLR when you talk about bootstrapping C#. My project (the Roslyn C# compiler) is a 100% C# implementation of the C# compiler. One thing to keep in mind is that we don't target the CLR.
The C# compiler is not a compiler from C# to the CLR, it's a compiler from C# to the CIL (Common Intermediate Language). It's completely reasonable to imagine a machine which runs CIL in hardware instead of in a VM. In this case the answer to the question of whether or not the C# compiler is bootstrapped is, "Yes. Completely."
Moreover, it wouldn't make sense to ask whether or not the CLR is self-hosted -- it's called the "Common Language Runtime" for a reason. It's a language-independent virtual machine. In this sense, implementing it in C++ makes just as much sense as implementing it in machine code.
Now, my argument here was meant to be without loss of generality. To ask whether or not a language is bootstrapped shouldn't really depend on a runtime, since any language which requires a runtime cannot, by definition, have the runtime written in said language. In this sense, we should only ask whether or not the compiler is bootstrapped, not the entire environment.
- dkhenry 13y agoWe can imagine something that runs the CLR in hardware, and we can imagine something that runs the JVM in hardware ( actually those things exist , but they don't and both the CLR and JVM are incapable of creating programs that _can_ run on hardware without C shims. Rust is in almost the same boat since they are using the LLVM, but the LLVM differs from the JVM and CLR since it can generate stuff to run on hardware without a shim.
- j_s 13y ago> actually those things exist , but they don't Not sure what you were trying to say here; one "Java in hardware": http://en.wikipedia.org/wiki/PicoJava http://en.wikipedia.org/wiki/PicoJava
- dkhenry 13y agoReally big formatting fail. There should be a close parenthesis after the exist. I know the JVM in hardware implementations "exist", but they aren't real implementations since they lack many of the OS like features (Threads , I/O , ... ) That the JVM gives you. Even though we can run byte code in hardware we can't just copy a class file to a processor and execute it. It still needs a run time and a OS to make it full spec.
- deleted 13y ago[deleted]
- lucian1900 13y agoIt can be possible to write the runtime for a language that requires one in the language itself, as long as the runtime is only necessary for part of the language. Then, the runtime would merely have restrict itself to the parts that don't require a runtime.
- Locke1689 13y agoOf course, but my emphasis on "requires" was meant to deal with those cases, as it can be argued that that would constitute two languages -- one managed and one native.