D vs. C#

Michael P dontspam at me.com
Mon Oct 22 03:03:09 PDT 2007


You say it's more portable but you need a VM and often a compiler instead of just having a compiler.

Distribute a single binary could be achived by encrypting the source code and sending it to your client, Then you could have a compiler that knows the key to it (or that the compiler gets the key from a server) so it takes the code and decrypts it and at the same time compiles it. 

The problem with today's VM is that they are slow (and its not just a myth, try it for yourself!). The argument that ppl will not notice the difference is not true. Just starting a VM often takes far to long. That they often bring a huge standard API is very good, but that is because its necessary for ppl to start program in it (ppl are lazy). 

VMs doesn't solve anything IMH, its just easier to use them than not doing so (greater security and control over what is happening at runtime and so on). 

I did program some pascal on a pda itself (palm pilot) and it worked perfect. I didn't have to learn new tricks or anything like that ( unlike Symbians C++ api).

As a sidenote I'm taking a C++ course at my university and the lectures goes something like this: bla, bla, bla, undefined behaviour, bla, bla,bla undefined, bla, bla, bla, undefined. So code can work in one compiler but not in another. In fact our final exam will be about avoiding pitfalls, not how to "code" in C++. This is a good example of a language that causes pain to port to different platforms. 

David Brown Wrote:

> On Sun, Oct 21, 2007 at 10:08:26PM -0700, Walter Bright wrote:
> > Robert Fraser wrote:
> >> Walter Bright Wrote:
> >>> I've never been able to discover what the fundamental advantage of
> >>> a VM is.
> >> I'm sure there are a lot of advantages, but here's one I can think of
> >> off the top of my head: say you're designing an application for
> >> mobile devices/smartphones. There are a lot of different phones out
> >> there, probably all with different APIs (or no native API accessible
> >> outside the company that made the phone), but if your software is
> >> running in a VM it'll run the same everywhere. Now say you're a cell
> >> phone manufacturer introducing a new smartphone -- adding the VM
> >> makes all the software written to use that platform instantly
> >> compatible with your device.
> >
> > That isn't an advantage of the VM. It's an advantage of a language that has 
> > no implementation-defined or undefined behavior. Given that, the same 
> > portability results are achieved.
> 
> It's still a VM advantage.  It helps the model where there are many
> developers who only distribute binaries.  If they are distributing for a
> VM, they only have to distribute a single binary.  Otherwise, they still
> would have to recompile for every possible target.
> 
> Dave




More information about the Digitalmars-d mailing list