Remix.run Logo
darknavi 2 hours ago

Have you seen some of his recent talks? Lots of underpinnings of cppfront have been added or are in committy.

He compares it to the JS/TS relationship.

nox101 an hour ago | parent | next [-]

It's not really a valid comparison though. cppfront is a different language that just happens to be compatible with C++. ts/js is were ts is just js with types. You can comment out the types and it just runs. cppfront's language you'll actually have to re-write the code to get it to compile in C++

typescript

    function add(a: number, b: number): number { return a + b };
javascript

    function add(a/*: number*/, b/*: number*/)/*: number*/ { return a + b };
cppfront

    add: (a: float, b: float): float = { a + b; }
cpp

    float add(float a, float b) { return a + b; }
HelloNurse an hour ago | parent [-]

Do you realize that the Typescript example contains strictly more information than the Javascript one (namely, declarations for the type of three things) and is therefore more complex to compile, while the two C++ examples are semantically identical (the last expression in the function is returned implicitly without having to write "return") and the new syntax is easier to parse?

pjmlp an hour ago | parent | prev [-]

Nope, that is mostly sales pitch, the only thing added thus far has been the spaceship operator.

He also sells the language differently from any other language that also compiles to native via C++, like Eiffel and Nim among others, due to conflict of interest to have WG21 chair propose yet another take on C++.