by IAmLiterallyAB · 2y ago · 0 comments
Herb is developing a whole second syntax, I wouldn't call that minimal changes. And probably the only way to evolve the language at this point, because like you said Sean is introducing a different language entirely, so its not C++ at that point.
I really like some of Herb's ideas,but it seems less and less likely they'll ever be added to C++
He compares it to the JS/TS relationship.
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++.
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; }Is this true in the general case? I thought there were typescript features that didn't have direct JavaScript alternatives, for example enums.
So, yes, you can't just strip types, but it's close.
OP is right, TypeScript is a whole new syntax, and it's shtick is that it can be transpiled into JavaScript.