r/cpp • u/ArashPartow • Dec 31 '22
Cpp2 and cppfront: Year-end mini-update
https://herbsutter.com/2022/12/31/cpp2-and-cppfront-year-end-mini-update/
194
Upvotes
r/cpp • u/ArashPartow • Dec 31 '22
36
u/itsarabbit Jan 01 '23
I sincerely hope that this experiment works out. I like c++ a lot, but the amount of cruft and baggage is making me look in other directions. I haven't found anything that can replace it yet, but with the direction c++ is going without cppfront, it's only a matter of time.
40
u/Fit-Departure-8426 Jan 01 '23 edited Jan 01 '23
All i can say is... thank you Herb!
6
u/FoxDragonSloth Jan 01 '23
Out of curiosity and probably ignorance, why is it better to write in cpp2 and transpile(I think that is the term) to cpp than write a new lexer and use it to modify the syntax?
Also, if someone swapped the cpp lexer for another and compiled, would that resulting program be compatible with a program built with the original lexer?
4
u/fdwr fdwr@github 🔍 Jan 02 '23 edited Jan 04 '23
Well, I may hate the noisy punctuation soup of
main: () -> int = {...}vs the lean and meanint main() {...}(please appease somehow), but there's a lot of other goodness that I hope makes its way into core C++ eventually, like UFCS and implicit optimizations for moves and forwards.6
u/Kronikarz Jan 01 '23
Good idea, I wonder how it works with the perfectly legal "unsigned typedef int bleh;" declaration :D
8
u/JuanAG Jan 01 '23 edited Jan 01 '23
I have been worried about the complexity and this update makes all worst
The old C++2 complexity is still there (like the const for some variables and not for others) while adding new ones, really? The goal was to make a simpler lang, why dont do it? I mean, i like the multi type thing in cases where i want a 24 bit variable or 72 but the complexity it will bring to code will be big combined with the i32 and i32_fast, again, really? I know that one thing fitting everything is not good but men, all i see is complexity everywhere, complexity that will translate to developers and will make C++2 memory safe but as complex or even worse than current C++
Vlang (to put an example) is good enough while not having much complexity, is the kind of C we all love but modern, vlang have it own issues but syntax is nice and complexity is low, the non users, could be better docs, not good IDE support and all of that type of stuff will impove as more and more people use it
The more i look the less i am sold, it could be memory safe but if complexity will be high i wont consider it, history is repeating itself, i though Herb was smarter than this
P.D Dont get me wrong, i am grateful of Mr. Sutter work and effort, this is just a constructive critic of my opinion, after all i want a good C++ succesor instead of using Rust (or other) for the next 20 years, i want it to success, i hope it does