D vs. C#

Radu radu.racariu at void.space
Tue Oct 23 00:14:26 PDT 2007


Joel Lucsy wrote:
> Christopher Wright wrote:
>> <nitpick>
>> Rather, it is a virtual machine if it executes abstract instructions, 
>> or interprets them for immediate execution. Compilers aren't VMs.
>> </nitpick>
>
> <grumbling>
> Bah, in that case DMD is a AOT VM as it compiles abstract instructions 
> (the D language). Maybe its just me, but I really don't see the 
> distinction between where it gets compiled. Either you do it before 
> distribution, or like the .Net runtime, it does it on the client side. 
> Without an interpreter, the compiled code is run directly. The .Net 
> runtime from MS talks directly to the Win32 dlls. The CAS will block 
> certain calls, thereby looking like its a VM, but really its not. 
> There is no "virtualization" going on. And if you think it does, I 
> task you to show me where.
> </grumbling>
>
A compiler its still a compiler, as its translating human readable code 
into a machine readable one, you really can't blur that line. What a JIT 
VM does is that it translates one form of machine readable code into 
another concrete one in "realtime" at the point of execution. And JIT is 
an implementation detail of a Process Virtual Machine, the 
virtualization is placed in that JIT and runtime as it verifys CIL and 
it parses/compiles/optimizes into x86 opcode and applies different 
policies on how that code runs. Any process VM talks directly with the 
host OS and permits access to/from the controlled execution environment 
to the host one (with the required security checks); hell, even the 
machine VMs (vmware, paralles) do that now with network shares, 
drang&grop and unity.

If you really want to pretend that .Net is some kind of a compiler 
backed, than you must admit that C compilers are also JITs in the case 
of how Ubuntu does it's application distribution. You have packages with 
abstract code (C, C++ mostly) an AOT VM (GCC) and there you go, and its 
one hell of an AOT VM :)






More information about the Digitalmars-d mailing list