News for hackers. Stuff that matters.
Re:Cppfront, Herb Sutter's proposal for a new C++ syntax by 01100011 on Saturday September 17, 2022 @02:51PM (#32880222)
Drive-by, low-quality comment:

Herb is great. Glad he's thinking about this. C++ syntax is garbage and needs help, but why deviate so much from existing syntax? Why drop curly braces? The decision to allow mixing new/old C++ syntax in the same file seems like a gross mistake that prevents a more incremental fix of the language. Why the heck doesn't it support defining classes yet? Is it because of the aforementioned requirement to intermix new/old syntax?

I hope efforts like this continue, as we all know something is broken in C++ syntax. I think it can be fixed with tweaks and some breaking of backwards compatibility in the same source module.

Re:Cppfront, Herb Sutter's proposal for a new C++ syntax by DerekL on Sunday September 18, 2022 @05:16PM (#32891590)
> Why drop curly braces?

What do you mean? It uses curly braces for compound statements. But it doesn't require curly braces to define a one-line function.

Re:Cppfront, Herb Sutter's proposal for a new C++ syntax by 01100011 on Sunday September 18, 2022 @07:09PM (#32892348)
Yeah, that just strikes me as weird.
Re:Cppfront, Herb Sutter's proposal for a new C++ syntax by int_19h on Sunday September 18, 2022 @07:16PM (#32892383)
It makes it more consistent with statements, and more convenient for one-liner functions (e.g. those that just delegate to another function).

It's also something that was adopted by other languages in the curly braces family - e.g. C# originally required curly braces for function bodies, but now allows you to write:

   int Sum(int x, int y) => x + y;
Re:Cppfront, Herb Sutter's proposal for a new C++ syntax by tricky777 on Saturday September 17, 2022 @04:45PM (#32881412)
why no classes? I assume that it's meant just as an initial sketch/demo. Doing 100% is at least twice as hard as doing 80%.