Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"A lot of the features are designed to make it easier for the compiler writer."

That kind of scares me. Who cares how hard the compiler writer's job is? A compiler is written once, whereas the programs that the compiler compiles (hopefully) comprise a much larger body of code.

That said, the article sure made D sound like an improvement over C++, with many of the same benefits. Of course, getting rid of the preprocessor seems kind of strange... I've used quite a few macros in my C code. Even the crappy macros you get with C (as compared to, say, Lisp) are certainly better than none at all.



It's really hard to tell what he's getting at with that comment. It appears that there is a stated goal of making it a 'systems' programming language, suitable for replacing C and C++.

Based on features such as the ability to write source code in 6 different character formats, it doesn't seem like the sort of features he's talking about imply sacrificing anything in the language.

It probably means things like this (http://www.digitalmars.com/d/lex.html)

Complex literals are not tokens, but are assembled from real and imaginary expressions in the semantic analysis:

       4.5 + 6.2i		// complex number
Stuff that is invisible to a programmer. (This was a completely random example, I don't know whether it's really such an optimization or not.)

One reason to make a compiler easy to write is that it makes the language more portable, which is an important feature of a low-level systems language. Low level languages are more difficult to make portable. One of the reasons the original C was so successful is that it was (relatively) easy to implement a compiler for your architecture.


I think it means mostly that D is easier to parse than c++, which is not just an advantage for compiler writers, but also for any other tool which has to work with the sourcecode.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: