D, Java? To D or not to D?

Georg Wrede georg at nospam.org
Fri Jan 5 15:14:10 PST 2007


Walter Bright wrote:
> TPJ wrote:
> 
>> 1) In order to run a program written in D I have to compile it on the 
>> target OS.
> 
> I haven't talked about this much, but it is technically feasible to 
> create a D runtime that enables "compile once, run everywhere". It is 
> not necessary to have a VM to do it.

1. To run on any OS on one specific processor, either those OSes have to 
have different entry points to the "exe", or there has to be a way of 
probing the OS within "common" code, the result of which would cause a 
jump to an OS specific routine.

2. To run on different processor architectures, (most probably with some 
of the same OSes), the worst case scenario would be that the same OS 
with the same jump target gets invocated on a different processor. This 
would mean that one (er, Walter) would have to invent a series of binary 
instructions that would not cause an (unwanted) exception on any of the 
processors, would not have any harmful side effects, and would 
eventually result in a jump to some processor specific version of the code.

Both of these seem like formidable tasks. OTOH, there's nothing that 
directly says they'd be theoretically impossible. So, in practice, the 
fewer processors we want to support, the less likely this is to be 
impossible. But, the more processors, specifically: for each additional 
processor (of a different architecture philosophy) we want to support, 
the harder it gets. And IMHO exponentially. (In English: pretty hard, 
and it gets _vastly_ harder for each single new processor!)

----

Not right now having the additional patience to think this entirely 
through, I got to thinking about the following:

At first sight ("hearing" ?), it sounds too good to be true. Then one 
starts to suspect that either Walter has figured out a runtime gimmick 
that does it (thus rendering this (btw, patentable idea) independent of 
D), or it is some kind of result of the specific way D and its source 
code (more to the point, syntax domain) relate to the semantics of the 
source code, taken as a whole.

----

If there's any remotest chance that this may be patentable, I DEFINITELY 
don't want to hear a word about it for the next 18 months!

If not, I'd kill to hear more! :-)



More information about the Digitalmars-d mailing list