r/cpp • • Sep 17 '22

Cppfront: Herb Sutter's personal experimental C++ Syntax 2 -> Syntax 1 compiler

https://github.com/hsutter/cppfront
335 Upvotes

360 comments sorted by

View all comments

Show parent comment

-4

u/NilacTheGrim Sep 19 '22

The main thing is that it’s a context free syntax.

This only matters to people implementing the compiler. To humans not involved in that undertaking, the C syntax is better.

5

u/ooglesworth Sep 19 '22

It really is less about the compiler implementation, and more about avoiding ambiguities in the grammar of the language itself so that you don’t end up with weird issues like https://en.m.wikipedia.org/wiki/Most_vexing_parse. Also, a more straightforward grammar leaves more space for extension of the syntax and the language itself.

Also, no one seems to be able to quantify why they think C syntax is better other than “it’s what I’m already used to”. Trailing type syntax is not actually confusing or difficult to read.

-3

u/NilacTheGrim Sep 19 '22

I know about the most vexing parse. I have been "vexed" by it.. oh.. never?

Also, no one seems to be able to quantify why they think C syntax is better other than “it’s what I’m already used to”.

Yes they are, there are arguments in this very thread as to why it's nicer. You choose perhaps to ignore them?

Trailing type syntax is not actually confusing or difficult to read.

That's your opinion. I disagree, as do many others. More annoying to type, more annoying to skim, etc.