Live data from Hacker News

Overview: What are Cpp2 and cppfront? How do I get and build cppfront?

hsutter.github.io

1–10 of 174 posts

Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?

#3
Sutter's 2022 cppcon talk¹ is a great introduction to the topic, both the problems it attempts to solve and solutions it was/is settling on. One of those few talks that left me genuinely enthused about the topic.

[It is probably worth watching for the Compiler Explorer interjection toward the end alone -- Matt Godbolt Appreciation Society]

¹ https://www.youtube.com/watch?v=ELeZAKCN4tY

Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?

#5
Is there any discussion or in-depth explanation of the syntax choices? I understand that a goal was context free unambiguous parsing. But there are some things that surprise me.

For example, string interpolation:

    "Hello, (msg)$!\n"
Why “(msg)$” and not “$(msg)”? Surely the latter is easier to parse?

Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?

#6

Is there any discussion or in-depth explanation of the syntax choices? I understand that a goal was context free unambiguous parsing. But there are some things that surprise me. For example, string interpolation: "Hello, (msg)$!\n" Why “(msg)$” and not “$(msg)”? Surely the latter is easier to parse?

https://github.com/hsutter/cppfront/wiki/Design-note:-Captur...

Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?

#8
Most of my personal issues aren't with C++ syntax as such (although it also has many problems). My main gripes are:

1. Very slow compilation.

2. Poor encapsulation, adding private functions requires recompiling all dependents, see (1).

3. Comically huge symbols make debugging much harder than it needs to be -- today gdb OOM'd my 16GB laptop when trying to form a backtrace of a typical QT application coredump.

Unfortunately it doesn't seem like cppfront can fix these issues. It may still be a worthwhile effort in other respects, of course.

Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?

#9
I wonder how this compares with Carbon -> C++ [0].

Carbon is (was?) a fantastic proposal, but not sure if it has lost steam since it was introduced or how well it is being adopted (be it inside Google or outside)?

Being able to incrementally/interchangeably use/call existing C++ code (and vice versa) seems like a great design choice (in Carbon) without having to introspect the actual generated code.

Not sure how easy it is to get the cppfront-generated C++ to bridge with existing C++ code (and vice versa)?

[0] https://github.com/carbon-language/carbon-lang

Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?

#10

Most of my personal issues aren't with C++ syntax as such (although it also has many problems). My main gripes are: 1. Very slow compilation. 2. Poor encapsulation, adding private functions requires recompiling all dependents, see (1). 3. Comically huge symbols make debugging much harder than it needs to be -- today gdb OOM'd my 16GB laptop when trying to form a backtrace of a typical QT application coredump. Unfortu…

under what circumstances does (2) hold? for vanilla methods it's no problem
Post reply on HN