4 ms·
Typescript is a superset of Javascript, you can literally submit the faster JS programmes as the TS ones.
by markmark 8y ago
Typescript is a superset of Javascript, you can literally submit the faster JS programmes as the TS ones.
- TallGuyShort 8y agoThis may be a dumb question as I know nothing about Typescript, but is it idiomatic to do that, though? You can, for the most part, use C in C++. But if C was beating the pants off of C++ in benchmarks it wouldn't tell me anything useful if someone submitted a C program as the C++ benchmark. If I wanted to use idiomatic C, I'd use C. I expect a C++ vs. C comparison to compare the encouraged features of C++ with what's available in C.
- alangpierce 8y agoIdiomatic TypeScript and idiomatic JavaScript are nearly the same; it's not like the C vs. C++ situation. A design goal of TypeScript is to make it possible to define types for idiomatic JavaScript programs, and I think they meet that goal pretty well. It's one reason the type system is much more advanced and flexible than, say, Java. You might see little differences here and there due to limitations in typechecking and the enum feature, but fundamentally TypeScript is just about adding structure and safety to your code rather than changing the way you code.
- rienbdj 8y agoThe benchmark is flawed. It should compare the fastest possible C++ implementation and a more idiomatic C++ implementation. The entire purpose of the language is to allow both to coexist in the same code-base. I would be very surprised if the fastest C++ and C are actually different.
- igouy 8y agoIf the benchmark claimed to be perfect then "flawed" would be an important criticism. You can see 4 or 5 C++ fannkuch-redux programs "compared" https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/fannkuchredux.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...