News for hackers. Stuff that matters.
Re:TypeScript as fast as Rust: TypeScript++ by mattgreenrocks on Thursday April 07, 2022 @02:00PM (#30948107)
The TypeScript++ example looks like the type of code that JITs typically like. Python has Numba, where users affix a @jit annotation to functions to request that. It works pretty well in my experience.

However, at this point, I'm mostly of the opinion that langs need some notion of mechanical sympathy if they want to be used for high-performance. JS engines probably have tens of millions of dollars of dev effort poured into them by now, yet they get soundly beaten by WASM, which is much younger. The conceptual foundation matters a lot.

That said, there's probably a nice space for an ergonomic, reasonably fast PL that sits between Rust and JS.

Re:TypeScript as fast as Rust: TypeScript++ by notriddle on Thursday April 07, 2022 @06:03PM (#30950870)
> That said, there's probably a nice space for an ergonomic, reasonably fast PL that sits between Rust and JS.

Other than not running natively in web browsers, isn't that language called Ocaml?

Re:TypeScript as fast as Rust: TypeScript++ by scns on Friday April 08, 2022 @07:44AM (#30955751)
Is it still possible to use the ReasonML syntax for native binaries?
Re:TypeScript as fast as Rust: TypeScript++ by discreteevent on Thursday April 07, 2022 @05:46PM (#30950725)
That was the main motivation behind the inventors of dart. They got frustrated with all the hacks they had to put into V8 just because JavaScript was so mechanically unsympathetic. You can hardly blame then because they originally came from a background of developing smalltalk and self VMs.
Re:TypeScript as fast as Rust: TypeScript++ by emteycz on Thursday April 07, 2022 @06:06PM (#30950892)
Isn't JS much more Smalltalk-ish than Dart? I don't have much experience with Dart, but it always seemed like a very OOP language to me (and not in the "message passing" meaning).
Re:TypeScript as fast as Rust: TypeScript++ by mattgreenrocks on Friday April 08, 2022 @03:26PM (#30961441)
This is super interesting to me as a VM geek.

I'd written off Dart as "Google's Swift" for the most part, but this makes a lot more sense. Thanks for the comment.

Re:TypeScript as fast as Rust: TypeScript++ by isaacimagine on Thursday April 07, 2022 @02:51PM (#30948778)
> JS engines probably have tens of millions of dollars of dev effort poured into them by now

And JS engine JIT codegen modules are put to good use compiling wasm.

Re:TypeScript as fast as Rust: TypeScript++ by janpaul123 on Thursday April 07, 2022 @03:02PM (#30948928)
Good points. I agree that choosing the abstractions wisely is key here.