HACKER Q&A
📣 prmph

Any interesting forks of TypeScript (or languages inspired by it)?


What would TypeScript look like if it were freed from the shackles of JavaScript? Could it be a first class language compiled to machine code, .NET IL, or wasm, with runtime type checking, and cleaner and less bloated?

Are there any forks of Typescript (or TypeScript-like languages) exploring these ideas?

Rationale for Question: After using TypeScript for some years, I find C#, as good a language as it is, fairly clunky. C# lacks many things that make TypeScript so expressive: straightforward first-class functions and union types, for example. I think my ideal language would be something that marries the best parts of C# and TypeScript.


  👤 jitl Accepted Answer ✓
There is AssemblyScript, a more basic language targeting WASM directly. https://www.assemblyscript.org/

AssemblyScript seems like it can become the Cython for TypeScript - close enough to mainline TS that you could consider porting or lowering some of your existing application for performance. However as a WASM only language, the use cases are quite specific.

I think I would prefer to rewrite slow algos in Rust, where they could be re used natively in a wider variety of contexts like inside a native app or in a native Rust backend service.


👤 eyelidlessness
Here is a listing of some TypeScript derived languages: https://github.com/orta/awesome-typescript-derived-languages

Of those, Static TypeScript has been of particular interest to me, but it seems either out of date, or the info available is.