r/programming • • Jul 08 '26

Announcing TypeScript 7.0

https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/
468 Upvotes

128 comments sorted by

View all comments

Show parent comment

1

u/TheKrumpet Jul 09 '26

I mean JS is generally jitted these days as much as it's a 'scripting' language. AOT tends to win out in first startup times but jitted languages can be faster over time with PGO.

It's not one size fits all, some tools are better in some domains.

4

u/pjmlp Jul 09 '26

Yes, but there is only so much a JIT can make with a dynamic language, and that already includes plenty of heroic efforts in V8.

Typescript rewrite happened exactly because the team could not improve performance any further.

PGO also exists for AOT tooling, in fact it started there.

1

u/TheKrumpet Jul 09 '26

Yeah that's fair, but that's a dynamic vs static argument and not an AOT vs Jitted or interpreted argument.

3

u/pjmlp Jul 09 '26

It surely is, because dynamic languages are very lousy to implement AOT compilation for them, leaving JIT as the only option available to generate machine code, and even then it is limited by the semantics of the language.

Hence why no JavaScript JIT will never beat proper AOT toolchain, or even something like a C++ JIT, like on WebAssembly or .NET.

Go compilers aren't any speed daemon when comparing against C++ or Rust, yet they were fast enough to beat Typescript 6 implementation.

1

u/CherryLongjump1989 Jul 09 '26

If you had tracked the TS migration to any extent, you would have already known that most of the performance gains came from multithreading, not because of any of your theory about AOT or "traditional family values" or whatever you were going on about.

1

u/pjmlp Jul 10 '26

Sure, if only there was a way to do multi threading in nodejs.....

1

u/CherryLongjump1989 Jul 10 '26

postMessage called and asked you to explain the joke you were making.

You can't share JS objects across threads. Millions upon millions of GC'd heap objects for AST's, symbols, types, etc.

1

u/pjmlp Jul 10 '26

Ever heard of C++ Addons?

1

u/CherryLongjump1989 Jul 10 '26

You can't use a C++ addon to share javascript objects between threads. That's not how any of it works, so yeah there's that.

0

u/pjmlp Jul 11 '26

Who says that is the only way?

Learn how to actually use nodejs C++ APIs.

1

u/CherryLongjump1989 Jul 11 '26

Everyone says it's the only way. NAPI doesn't solve your problems.

Do you honestly think that the creator of TypeScript and C# is just sitting there thinking to himself, "shoot! If I had only learned how to use NAPI! I should have hired u/pjmip"?

1

u/pjmlp Jul 11 '26

It would have been a great offer, given I have used all version of Turbo Pascal since version 3.3.

Nevertheless, C++ is also AOT compiled, and C++ addons exist, exactly proving the point there is only so much V8 JIT can do by itself without additional help from C++ addons.