DEV Community

Discussion on: This is why I hate Typescript

Collapse
 
jillesvangurp profile image
Jilles van Gurp

Well played :-). I always say Typescript is a gateway drug for people who actually believe Javascript is a good or effective language. IMHO this is just a form of Stockholm syndrome.

As it preserves most of the madness that is Javascript for compatibility reasons, Typescript necessarily is a very messy, clumsy, and inconsistent language that allows for all sorts of very ugly hacks that have no place in a modern code base. Luckily, other languages are available and coming to a browser near you very soon thanks to WASM. Kotlin, Swift, C#, Ruby, Go, Elixir, Clojure, Python, Rust, C/C++, etc. All of them have WASM on their roadmaps directly or indirectly (by utilizing e.g. LLVM). Many of these are making this explicit. E.g. Rust is all about wasm this year and MS has included WASM related stuff like Blazor as a core part of .Net 5.

Some of these languages also have decent transpilers. E.g. kotlin-js works quite well, can reuse type definitions for Typescript, and e.g. Parcel added support for it some time ago. Likewise clojure script is a thing. However, javascript as a compilation target is a dead end as you would gain access to the same APIs from WASM, which makes transpilation to JS technically redundant long term.