▲ | nox101 4 hours ago | ||||||||||||||||
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
javascript
cppfront
cpp
| |||||||||||||||||
▲ | EE84M3i an hour ago | parent | next [-] | ||||||||||||||||
> ts/js is were ts is just js with types. You can comment out the types and it just runs. Is this true in the general case? I thought there were typescript features that didn't have direct JavaScript alternatives, for example enums. | |||||||||||||||||
| |||||||||||||||||
▲ | HelloNurse 3 hours ago | parent | prev [-] | ||||||||||||||||
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? | |||||||||||||||||
|