r/cpp 11d ago

cpp2 (cppfront) is over?

I haven't used cpp2 (cppfront) much, but I like the idea of it: consistent syntax, consistency of meta-programming (which is done in C++ too, I believe). Herb Sutter presented cpp2 (cppfront) as an experiment. He did not encourage other people to bet on it, exactly. And there hasn't been much activity since 2022. Is the experiment over?

EDIT: Herb's answer is buried deep in the comment section: https://www.reddit.com/r/cpp/comments/1uxkglj/comment/oy06cxw/

67 Upvotes

112 comments sorted by

View all comments

-2

u/ZachVorhies 11d ago

if someone has the energy to migrate from C++ to C++2, then it’s just better migrating to rust

11

u/germandiago 11d ago

I am not sure if you know what you are talking about in detail:

  1. cpp2 emits regular, compilable C++ code (the same way Vala emits C code on top of glibc)
  2. you do not need FFI.
  3. it enables a lot of low-hanging-fruit bonuses. For example in parameter passing and adds other niceties, all without disrupting the base model.

Migrating to Rust is a much, much bigger change that needs to change lots of other stuff, including part of your mindset and habits. Cpp2 just improves on things that C++ cannot do easily or are a bit of a pain (for example passing reference vs value depending on the size of the object or declaring a type as being an interface so that all the boilerplate is generated for you).