Track for cppfront/cpp2

Saw this in a cppcon talk, presented Herb Sutter himself where he described it as using “the typescript model” (building on top of language while maintain full compatibility) for C++.

From their Github:

Cpp2 aims to be another “skin” for C++ itself, just a simpler and safer way to write ordinary C++ types/functions/objects, and a faster way to experiment with proposals for future new Standard C++ features in a simpler compiler and syntax flavor.

Syntax example:

myclass : type = {
    data: int = 42;
    more: std::string = std::to_string(42);

    // method
    print: (this) = {
        std::println("data: (data)$, more: (more)$");
    }

    // non-const method
    inc: (inout this) = data++;
}

main: () = {
    x: myclass = ();
    x.print();
    x.inc();
    x.print();
}

Would this qualify for a track on Exercism?

It sounds interesting. I’d be curious to hear the thoughts of @vaeng and @siebenschlaefer.

I’m very interested in that kind of track. I had the urge to see a carbon track as well, but never had the time to follow if the “c++ skins” have any real skin in the game. Carbon is still not useable and it has been like 4+ years now.

From my experience with building the sqlite track, I see the test-runner as the main hurdle to starting a new track.

Is there a test-framework that can be used? If not, you have to write your own implementation, and that can be tricky. It is not a hindrance, other tracks like GDScript are doing it right now.

1 Like

if the “c++ skins” have any real skin in the game. Carbon is still not useable and it has been like 4+ years now.

I am not sure about cppfront, there is like an 8 part series of talks on it and it looks usable but I haven’t used it before. I made this post mostly out of curiosity.

Is there a test-framework that can be used? If not, you have to write your own implementation, and that can be tricky. It is not a hindrance, other tracks like GDScript are doing it right now.

Is there a reason why the C++ test framework cannot be used?

cppfront simply compiles foo.cpp2 to foo.cpp: Hello, world! - Cpp2 and cppfront — An experimental 'C++ syntax 2' and its first compiler

It might work. Tracks are built by volunteers. Typically someone who is familiar with the language and tooling steps forward to build a track - or someone willing to put in the time to figure it all out. The Exercism staff doesn’t build tracks.