News for hackers. Stuff that matters.
Re:A Rust Shaped Hole by wk_end on Wednesday July 16, 2025 @02:52PM (#44585619)
I'd love to see someone develop a compiler for TypeScript that got, say, Ocaml-like performance. There's a bunch of reasons why that'd be tough though - you'd probably want a language very-similar-to-but-not-quite-like-TypeScript.
Re:A Rust Shaped Hole by williamstein on Wednesday July 16, 2025 @02:57PM (#44585676)
This is probably the closest thing to that: https://www.assemblyscript.org/
Re:A Rust Shaped Hole by wk_end on Wednesday July 16, 2025 @03:09PM (#44585767)
The documentation is really incomplete. It's not at all clear how similar to TypeScript this is...does this support structural subtyping? Type manipulation? Iterators/generators? Async?
Re:A Rust Shaped Hole by ellg on Wednesday July 16, 2025 @02:57PM (#44585668)
its called C#
Re:A Rust Shaped Hole by wk_end on Wednesday July 16, 2025 @03:06PM (#44585739)
C# is a lovely language but it's not that similar to TypeScript. The big distinction (for me) is that it's nominally-typed and much more rigid. Unless things have changed a lot since I last touched it (admittedly a while ago):

You can't synthesize ad hoc union types (https://www.typescriptlang.org/docs/handbook/2/everyday-type...)

There's no notion of literal types (https://www.typescriptlang.org/docs/handbook/2/everyday-type...)

There's no type narrowing (which gets you a kind of sum type) (https://www.typescriptlang.org/docs/handbook/2/narrowing.htm...)

Most of the type maniuplation features (keyof, indexed access types, conditional types, template literal types...) are missing (https://www.typescriptlang.org/docs/handbook/2/types-from-ty...)

Re:A Rust Shaped Hole by pragmatic on Wednesday July 16, 2025 @06:36PM (#44587582)
Close but not quite.
Re:A Rust Shaped Hole by abhijat on Thursday July 17, 2025 @10:52AM (#44594065)
There used to be reasonml but I'm not sure how active it is these days.
Re:A Rust Shaped Hole by wk_end on Thursday July 17, 2025 @07:20PM (#44599400)
ReasonML is just OCaml with a different syntax. It sort of very loosely resembles JS syntactically in that it's got curly braces, but that's about as far as the similarities go - about as much as Rust resembles C. The type system and language are very different from TypeScript or JS, and much more rigid.