On 12/15/2011 03:33 PM, bearophile wrote:
Regarding some things said by Walter in this Reddit thread:
http://www.reddit.com/r/programming/comments/nbndg/fedora_17_will_include_support_for_the_d/

I should add that the XMM register support is for 64 bit targets, and also the 
register allocator will enregister float and double variables in XMM registers.<

Will DMD use 8 XMM registers in 32 bit code too?


Putting the compiler in D would make it difficult to integrate the D front end 
into the C/C++ back ends of gcc and llvm.<

Writing the reference front-end in D has some advantages:
- Other people have lot of C/C++ code; if they want to use D they will probably 
want to interface C/C++ with D code. So writing the compiler front-end in D is 
a way to eat some of the D dog food, and see/test how much good such 
interfacing is, and eventually it's a push to improve it.

I agree.

- It's a way to eat some D dog food in general, because a compiler front-end is 
a medium-sized project that requires some performance. If some parts of the D2 
language are badly designed or they lead to low performance (like fixed sized 
array assignment) this is a good way to spot such problems and a way to push to 
fix them.

The only performance problem is the GC, and that could just be turned off (as DMD handles it ;)). Fixed array assignment certainly won't cause any trouble.

- I have now understood that if you want a safe&  reliable language you need a 
reliable compiler too. Because a very safe and very well designed language produces 
buggy and unsafe programs if the compiler is buggy. Writing the front-end in D 
allows to avoid several compiler bugs from the beginning.
- Writing the front-end in D is probably going to speed up a bit the 
development of the D compiler, with more expressiveness, less code, more 
readable code, less bug-prone code, etc.

Exactly. But that front-end needs to be written from scratch.


Bye,
bearophile

Reply via email to