News for hackers. Stuff that matters.
Re:Announcing TypeScript 3.9 by wereHamster on Wednesday May 13, 2020 @11:11AM (#23167621)
> - At least 20% performance improvement over plain JavaScript.

How would that work? TS is not an optimizing compiler, it's only a type checker.

Re:Announcing TypeScript 3.9 by cryptica on Wednesday May 13, 2020 @11:25AM (#23167776)
Well ActionScript 3 got it to 40% thanks to static type performance optimizations. They did rewrite the engine. That's what it takes unfortunately.

The fact that Microsoft does not want to hire serious compiler engineers and prefers to spend all the money on marketing is not my fault.

Re:Announcing TypeScript 3.9 by benschulz on Wednesday May 13, 2020 @12:34PM (#23168652)
You do realize that Anders Hejlsberg is on the TypeScript team? I don't want to imply that he's superhuman or anything, but.. just what is your idea of "serious compiler engineers"?
Re:Announcing TypeScript 3.9 by cryptica on Wednesday May 13, 2020 @01:13PM (#23169151)
Well maybe he doesn't get enough leeway. Maybe he knows that he should be building an engine from scratch but management won't let him. This is very common in companies of that size.
Re:Announcing TypeScript 3.9 by int_19h on Wednesday May 13, 2020 @02:10PM (#23169815)
Hejlsberg already designed a language with its own runtime from scratch - that was C#.
Re:Announcing TypeScript 3.9 by dwaite on Wednesday May 13, 2020 @12:58PM (#23168958)
It is hopefully apparent that the 40% increase (whether it was meant to indicate over leading Javascript engines at the time or over the ActionScript 2 engine) does not in any way indicate there is headroom for a 40% performance increase if static type performance optimizations were applied to a modern Javascript engine.

Many performance improvements come from being able to do code analysis during generation, which is already a trade-off for environments doing in-time interpretation, code generation and optimization.

Large performance increases would most come from removing dynamic language complexity, such as having use of the 'class' feature added in ECMAScript create non-mutable properties by default for function declarations.

Re:Announcing TypeScript 3.9 by Jasper_ on Wednesday May 13, 2020 @11:57AM (#23168207)
ActionScript 3 got a huge improvement because they added a JIT. AVM1 was an interpreter, and a very infamously bad one at that.