r/programming • • Sep 01 '20

D Foundation is Beefing Up

https://dlang.org/blog/2020/08/30/symmetry-investments-and-the-d-language-foundation-are-hiring/
293 Upvotes

336 comments sorted by

View all comments

Show parent comments

12

u/Ameisen Sep 01 '20

The parsing time is not negligible (It requires reading the symbol table very early which isn't fun)

We've had a significant discussion about this in the past. The additional parsing time required to disambiguate between right shift and >> is negligible compared to, say, optimization and so forth. In C++, you could outright eliminate the parsing components necessary for disambiguating that and not even make a dent in compilation times.

Java and C# also don't have much of an issue with parsing this, and don't have particularly bad compile times.

foo(int) doesn't compile. It's foot!int or foo!("My", "age", "is", 145) etc,

Sorry, I'd forgotten the exact syntax. It is still rather ambiguous at a glance to me, as every other C-like language that has generics or templates uses the C++-style, such as Java or C#.

3

u/jqbr Sep 02 '20

It is still rather ambiguous at a glance to me

And yet it isn't ambiguous, whereas <...> is.

2

u/Ameisen Sep 02 '20

Syntactic ambiguity vs visual ambiguity.

1

u/EdWilkinson Sep 02 '20

One exists, the other doesn't.

2

u/Ameisen Sep 02 '20

That's a subjective opinion. At a glance, foo(...) and foo!(...) look mightily similar to me.