Migrating dmd to D?

js.mdnq js_adddot+mdng at gmail.com
Fri Mar 1 08:44:52 PST 2013


On Friday, 1 March 2013 at 10:36:04 UTC, Jonathan M Davis wrote:
> On Friday, March 01, 2013 09:50:13 Thomas Koch wrote:
>> > Walter and I have had a long conversation about the next 
>> > radical thing
>> > to do to improve D's standing. Like others in this 
>> > community, we believe
>> > it's a good time to consider bootstrapping the compiler. 
>> > Having the D
>> > compiler written in D has quite a few advantages, among 
>> > which taking
>> > advantages of D's features and having a large codebase that 
>> > would be its
>> > own test harness.
>> 
>> Two points from the viewpoint of the Debian distribution:
>> 
>> Debian is ported to many different platforms and in average 
>> one new platform
>> port started every year. A huge pain point for porters are 
>> circular (or
>> self) dependencies. A lot of effort goes into breaking such 
>> circles.
>> 
>> So in the moment the D language is great in that it does not 
>> introduce a new
>> circular dependency. It would be a pity to lose this.
>> 
>> The second important thing for Debian (and Fedora and others) 
>> is licensing.
>> It's a pity that DMD isn't free software and I believe DMD not 
>> being in
>> distros is one reason for the low popularity of D. It's hard 
>> to learn D with
>> gdc while all tutorials are based on DMD.
>> 
>> So instead of a rewrite of D, it would rather be important 
>> (from my humble
>> point of view) to replace non-free parts of DMD.
>
> I don't really care about the license, but I can definitely say 
> that part of me
> finds the idea of having a compiler compiling itself to be a 
> bad idea, much is
> compiler folks love to do that. Recently, I had some older 
> haskell code that I
> needed to compile, but it followed the previous haskell 
> standard, and I
> couldn't get the current compiler to compile it even in 
> compatability mode.
> So, I tried to compile an older version of the compiler from 
> before the new
> standard, and it had exactly the same problems that my code 
> did, because it
> was written in haskell using the older standard. So, I had to 
> give up on being
> able to compile my code, because I couldn't get my hands on an 
> old enough
> version of the compiler. If they'd just written it in C/C++, 
> then I wouldn't
> have had that problem.
>
> I know that it's generally touted as a great idea for a 
> language to compile
> itself, and I'm sure that it would be great to be able to use 
> D's features in
> the compiler, but the circular dependency that that causes is a 
> definite
> negative IMHO.
>
> - Jonathan M Davis

There is no problem with circular dependencies as long as the 
language spec has a fixed subset that the compiler is written in. 
The reason is that any future version then can compile the 
compiler source because the future versions all support the 
subset.

This is why it is so important to get the fixed language subset 
down because it will the core language features and can't be 
changed without causing regressive dependencies.

Any evolution of the D compiler will compile it's own compiler 
source as long as it properly implements the D language subset. 
This subset also has to be a subset of the current dmd language 
implementation to bootstrap from.



More information about the Digitalmars-d mailing list