Hacker News new | ask | show | jobs
by nytgop77 1850 days ago
Just - impressive.

And since this is about dlang a bit... My favorite part of D compared to cpp, was metaprogramming syntax. (i.e. NOT '<' and '>') I was so sad when I got to know that the only thing that rust took from cpp, was '<' and '>'.

2 comments

It's really beyond me why would Rust designers adopted the '<' and '>' symbols. If I'm not mistaken Walter had specifically mentioned that he's avoided these symbols based on his experience on implementing C++ compiler in the early days of C++. Due to the ambiguity of the symbols with other operations' symbol, their inclusion will require extra symbol look up table and this will significantly increased parsing and hence overall compilation time. Based on the complaints on Rust compilation time that you see in HN, probably he's right after all.

One of the design principles of D is to create compiler friendly programming language and this is evident with the higher speed compilation of the D programs in comparison to similar program in C++ and Rust. Comparatively speaking, Go also has a very fast compilation time but Go currently does not support generic yet, and there's that.

In addition, another design principle of D is to be as intuitive as possible and programmer friendly compiled programming language. If you think this should be easy please check this video regarding of this Professor to try to completely compile R to no avail in 10 years during a keynote speech in a recent major R conference [1]. For examples, this is the reason that you have UFCS in D and there's also no macro in D. You can see that some of later programming languages agreeing with D approaches and copying this UFCS feature. On the overall language idioms, D want to be easily program similar to Python but compiled, i.e. fast in compilation and running time. FYI, there is even a book specifically written for Python programmers if they want try and perhaps migrate to D [2].

[1] How I Learned to Love Failing at Compiling R

https://www.youtube.com/watch?v=VdD0nHbcyk4

[2]D, the Best Programming Language, for Former Python Developers : Learn D Programming for Python Developers

https://www.amazon.com/Programming-Language-Former-Python-De...

Thank you!

I agree, the syntax is much clearer than C++. The very first prototype was in C++, but I found myself frequently frustrated with the language. I find D's features make me more productive.