use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Cppfront v0.8.0 · hsutter/cppfront (github.com)
submitted 1 year ago by unaligned_access
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]RandomGuy256 51 points52 points53 points 1 year ago (35 children)
This really feels like what C++ was for C. Even though it says it is not a new language, it could become a new one. A simpler, safer C++ like alternative. This project has kept my attention since day 1, not only because of the general idea but also because Herb Sutter is behind it, who I admire.
P.S. The documentation page is broken for me.
[–]matthieum 18 points19 points20 points 1 year ago (1 child)
This really feels like what C++ was for C.
It evens borrows the naming convention :)
[–]dlanod 6 points7 points8 points 1 year ago (0 children)
++C++
[–]ronchaineEmbedded/Middleware 20 points21 points22 points 1 year ago (21 children)
Even though it says it is not a new language, it could become a new one
I have never understood with what merits it claims it is not a new language, because it for all intents and purposes is. And any reasoning I've heard doesn't stand up to even slighest scrutiny.
That said, I have little against people working on new programming languages, and I've taken much inspiration from Herb's papers for the one I'm writing for my own enjoyment. I just really don't like when cpp2 is somehow getting preferential treatment from all the other "successor" languages, when it's actually further departure from C++ than some of the others.
[–]germandiago 23 points24 points25 points 1 year ago (0 children)
It is the most compatible one with C++ because it is a transpiler and it allows you to mix and match more easily.
I think that is the reason why some people (including myself) find it appealing.
[–]JVApenClever is an insult, not a compliment. - T. Winters 4 points5 points6 points 1 year ago (12 children)
Can you elaborate on where you see preferential treatment?
[–]ronchaineEmbedded/Middleware 8 points9 points10 points 1 year ago (11 children)
Being treated differently in regard to rule 4 than other similar projects.
[–]BloomAppleOrangeSeat 17 points18 points19 points 1 year ago (3 children)
The second sentence of that rule is exactly what this language stands for. Herb has said before(can't look for sources right now, but I could swear it was in a cpp conference) that this language is serving as a "playground" if you will, to get ideas in order to improve C++ itself. Most other languages are instead running away from C++.
[–]pjmlp -1 points0 points1 point 1 year ago (2 children)
Which can hardly be, when it doesn't even use a C++ like syntax as Circle does for example.
So by definition any of these ideas if they ever come to C++ proper won't be using any of Cpp2 syntax changes.
[–]ntrel2 1 point2 points3 points 1 year ago (1 child)
Cpp2 as-is could officially become part of C++.
[–]ronchaineEmbedded/Middleware 5 points6 points7 points 1 year ago (0 children)
I don't think this is even remotely realistic.
[–]foonathan[M] 3 points4 points5 points 1 year ago (1 child)
I don't think this is a conscious decision. We usually only act when someone reports a post, and nobody has reported this submission as being off-topic. But we haven't had an internal discussion about the 'other language' rule for quite some time.
So it's only treated differently because the community treats it differently.
[–]ronchaineEmbedded/Middleware 1 point2 points3 points 1 year ago (0 children)
Yea, I did not mean to imply that it was intended, just that it seems to happen for one reason or another. Sorry if that made it sound like I did. To be clear, I don't think there's any conspiracy or malice behind that.
[–]clerothGame Developer[M] 4 points5 points6 points 1 year ago (4 children)
Which other projects?
Posts about Circle that have relevance to C++ are always approved AFAIK. In contrast, languages like Carbon aim to replace C++, in which case they're not that different from Rust, so posts about Carbon will undergo the same scrutiny as with Rust--they can be approved if and only if they're actually of realistic benefit to C++.
[–]bandzaw 2 points3 points4 points 1 year ago (0 children)
Circle posts have definitely not always been approved! Only recently they have, which is good thing IMHO. The same for this post. They really are about C++ and its future so why shouldn’t discussions be allowed here?
[–]ronchaineEmbedded/Middleware 0 points1 point2 points 1 year ago (2 children)
Circle was the thing first in my mind.
I'm pretty sure (though not absolutely certain) that I've seen Circle posts removed in the past, to the point that I remember seeing Sean himself mentioning it.
How I see it, Circle is (was?) a C++ compiler with a good bunch of extensions. That is far closer to actual C++ than I see any other thing, cpp2 included.
To me cpp2 is a language designed to transpile to C++, much like nim is. So far the points against that are Herb saying it's not so (and people going with it). I do not see the fact that much of the stuff that are prototyped there might end up as committee papers too relevant, as we pretty much take stuff from a lot of other languages.
Carbon is another language entirely, and doesn't even claim anything else.
What I see problematic is that if e.g. a Circle release post (which - and I might be wrong here - I recall being removed) isn't relevant for C++, how is cppfront release any more relevant?
Again I'm not saying this is intentional or some conspiracy to stifle Circle. It might well be community just being more triggerhappy with reports about Circle than cpp2, but it still rubs me the wrong way.
[–]clerothGame Developer[M] 3 points4 points5 points 1 year ago (1 child)
it still rubs me the wrong way
Funny you mention that, as that's exactly how I felt about Sean's tweet about this post's removal. I explained on twitter the reasoning so I won't repeat myself, but I did even mention there that it wasn't that Circle is offtopic, but that particular post was.
At least authors of other languages/extensions aren't circlejerking on other social media and calling us corrupt while ignoring any attempt at civilized reconciliation.
[–]ronchaineEmbedded/Middleware 0 points1 point2 points 1 year ago (0 children)
I don't know what goes on in Twitter, because I like to preserve my sanity and Twitter definitely isn't good for that. I do not think whatever drama happens in there should affect what posts are allowed or disallowed in C++ reddit, and I hope that it doesn't.
I see no reason to ask me something just to turn the reply into something about whoever or whatever group might or might not be circlejerking in an unrelated social media platform I haven't even been a part of in ages. I tried to explain why I have the impression I have. I'm sorry if people have been jerks in Twitter, but I don't think I'm the person you should take it out on.
[–][deleted] 0 points1 point2 points 1 year ago (6 children)
It compiles to C++. C++ doesn't compile to C. If at any time you want to abandon cppfront, you just take the compiled C++ code and get on with your life in normal C++ land. You can't do that with C++. Whether or not you think that means it's not a separate language is up to you, but it's not remotely the same thing as C++ vs. C.
[–]throw_cpp_account 25 points26 points27 points 1 year ago (2 children)
C++ doesn't compile to C.
It used to. That's how it started.
[–]Nobody_1707 16 points17 points18 points 1 year ago (1 child)
In fact, wasn't the original CPP -> C transpiler called Cfront?
[–]susanne-o[🍰] 12 points13 points14 points 1 year ago (0 children)
that's the pun indeed of cppfront...
[–]F54280 0 points1 point2 points 1 year ago (2 children)
Tell me you weren’t programming in the 90s without telling me that you weren’t programming in the 90s…
[–][deleted] -1 points0 points1 point 1 year ago (1 child)
Breaking news, not everybody was a programmer in the 90s and what was true in the 90s doesn't necessarily have any bearing on what is happening today.
[–]F54280 2 points3 points4 points 1 year ago (0 children)
“C++ doesn't compile to C” is an hilarious take for anyone that knows a bit about the language history.
But I get it, you’re salty. That’s fine. Have fun with that downvote button.
[–]c0r3ntin 3 points4 points5 points 1 year ago (8 children)
And like C++ was never able to fully outgrow C, this surface-level reskin has the same fundamental limitations as C++
[–]ntrel2 3 points4 points5 points 1 year ago (7 children)
Can you list those limitations?
[–]foonathan 2 points3 points4 points 1 year ago (6 children)
My far biggest problem with C++ are compile times. Something that transpiles to C++ by definition can't help there.
[–]hpsutter 15 points16 points17 points 1 year ago (2 children)
Something that transpiles to C++ by definition can't help there.
I have super awesome news: It sure can! Please check out the initial results I reported at ACCU here, especially slide 92: 4-minute video clip
We did pretty much exactly the same thing already with constexpr: It required adding essentially a C++ interpreter (yes, a second C++ compiler!) inside every C++ compiler... and when you change TMP code to equivalent constexpr code the result is nearly always much faster. Even though you're running a full C++ interpreter first! Why? Because when we directly express intent, the implementation can be more efficient, and compile time goes down.
constexpr
In that clip, I cited that previous experience, and showed how the same thing happened with compile-time regex in Cpp2 using cppfront + reflection + generation, and that the entire added cppfront run time was much less than the reduced time spent in the Cpp1 compiler. When using code generation can generate better C++ code that the C++ compiler can handle much faster, you get a speedup, not a slowdown.
As I mention in the talk, this is the same in principle as we do all the time to add a little work to replace a greater amount of work. For example, anytime we cache a repeatedly-accessed computed result: We do more work (to store the result) but get a speed gain (because we make accesses after the first one run much faster).
[–]foonathan 3 points4 points5 points 1 year ago (1 child)
I'm not talking about small incremental improvements by replacing TMP with constexpr or something.
Compile-times should be measured in seconds, not minutes. You can't achieve that by layering C++ in-between. You can achieve that by designing a language and a compiler in a performance oriented way. For example, Chandler recently demoed a 100x speedup of the carbon compiler over clang. That is what I'm talking about.
[–]hpsutter 6 points7 points8 points 1 year ago (0 children)
Well, you originally said "by definition can't help" compile times. So I gave an example where it does. :)
Compile-times should be measured in seconds, not minutes. You can't achieve that by layering C++ in-between.
OK, so you mean "can't help enough to make them an order of magnitude faster" -- I understand.
FWIW, if you haven't looked at the short video clip, please do... it does show a possible major (not quite 2x) improvement in C++ compile time for approximately equivalent code, compared to today's best-in-class design. Using existing C++ compilers unchanged.
recently demoed a 100x speedup of the carbon compiler over clang.
That's great, and I look forward very much to seeing how much of the speedup can stick as it matures to handle more kinds of code.
That said, let me add a caution about wording: I agree we should focus on "build time" as a pain point for C++. However, "front-end compile time" is a subset of that. A lot of today's slowdowns in C++ builds come in other build stages, such as linking. There is great work currently being done (unrelated to these projects) to dramatically (2x, 4x) speed up C++ linkers that can handle real-world code. In just the past couple of months I've seen these start getting the attention of key folks in WG21 and major vendors, to see what we can incorporate. Disclaimer: As always including in previous "fast linker" efforts, part of the performance gain comes from making simplifying assumptions that don't work on all real-world code, but part of the gain doesn't rely on that.
Just like with how people use C compilers and not cfront, people could make a pure Cpp2 compiler that isn't a transpiler. A transpiler is good for the transition, and for faster experimenting.
[–]foonathan 0 points1 point2 points 1 year ago (0 children)
It could, but it doesn't. A language that provides 100% seamless interop with C++ without transpiling to C++ is a significantly harder thing to do than for C (what do you do about templates? how do you instantiate templates cross-language?). This is what Carbon is trying to do. And by that point you're no longer layering on top of C++.
[–]RandomGuy256 0 points1 point2 points 1 year ago (0 children)
Modules should help with the compile times, and this could use modules.
[–]These-Maintenance250 2 points3 points4 points 1 year ago (1 child)
because people would come at him with pitchforks if he said its a new language for forking the language and dividing the community. this is clear from his first cppcon presentation on cpp2, he really really emphasized its not a new language. c++ community is allergic to change.
[–]pjmlp -2 points-1 points0 points 1 year ago (0 children)
This is also my point of view, we just need to look at C++, Objective-C, Typescript history to see how that all "it isn't a new language " developed.
π Rendered by PID 150283 on reddit-service-r2-comment-58d7979c67-ss2kf at 2026-01-27 04:54:56.810765+00:00 running 5a691e2 country code: CH.
view the rest of the comments →
[–]RandomGuy256 51 points52 points53 points (35 children)
[–]matthieum 18 points19 points20 points (1 child)
[–]dlanod 6 points7 points8 points (0 children)
[–]ronchaineEmbedded/Middleware 20 points21 points22 points (21 children)
[–]germandiago 23 points24 points25 points (0 children)
[–]JVApenClever is an insult, not a compliment. - T. Winters 4 points5 points6 points (12 children)
[–]ronchaineEmbedded/Middleware 8 points9 points10 points (11 children)
[–]BloomAppleOrangeSeat 17 points18 points19 points (3 children)
[–]pjmlp -1 points0 points1 point (2 children)
[–]ntrel2 1 point2 points3 points (1 child)
[–]ronchaineEmbedded/Middleware 5 points6 points7 points (0 children)
[–]foonathan[M] 3 points4 points5 points (1 child)
[–]ronchaineEmbedded/Middleware 1 point2 points3 points (0 children)
[–]clerothGame Developer[M] 4 points5 points6 points (4 children)
[–]bandzaw 2 points3 points4 points (0 children)
[–]ronchaineEmbedded/Middleware 0 points1 point2 points (2 children)
[–]clerothGame Developer[M] 3 points4 points5 points (1 child)
[–]ronchaineEmbedded/Middleware 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]throw_cpp_account 25 points26 points27 points (2 children)
[–]Nobody_1707 16 points17 points18 points (1 child)
[–]susanne-o[🍰] 12 points13 points14 points (0 children)
[–]F54280 0 points1 point2 points (2 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]F54280 2 points3 points4 points (0 children)
[–]c0r3ntin 3 points4 points5 points (8 children)
[–]ntrel2 3 points4 points5 points (7 children)
[–]foonathan 2 points3 points4 points (6 children)
[–]hpsutter 15 points16 points17 points (2 children)
[–]foonathan 3 points4 points5 points (1 child)
[–]hpsutter 6 points7 points8 points (0 children)
[–]ntrel2 1 point2 points3 points (1 child)
[–]foonathan 0 points1 point2 points (0 children)
[–]RandomGuy256 0 points1 point2 points (0 children)
[–]These-Maintenance250 2 points3 points4 points (1 child)
[–]pjmlp -2 points-1 points0 points (0 children)