3 ms·
Sometimes I wish something akin to Dart (but probably not Dart) had taken off instead of the TypeScript approach. I.e. a JS based language that broke a few thin
by zamadatix 2y ago
Sometimes I wish something akin to Dart (but probably not Dart) had taken off instead of the TypeScript approach. I.e. a JS based language that broke a few things to get types but largely ran on the same VM and could still easily be transpiled in the meantime. Avoid the whole "separate syntax on top of the way the underlying syntax behaves" set of logic.
I suppose WASM enables layered languages like AssemblyScript comes close in many ways but it's also a bit too separated from the primary webpage use case.
- adamc 2y agoI learned typescript for a project I spent 9-10 months on. It wasn't that hard to learn but... ugh. On many levels. There are problems where it's typechecking is helpful (enough) for, but the degradation in readability was quite noticeable, and the fact that its abstractions only work at compile time was an endless thorn in the side. Not a fan.
- shepherdjerred 2y agoZod (and similar libraries) solve that last issue: https://zod.dev/ https://zod.dev/ You can, for example, declare your type and check at runtime if some object matches the type.
- giraffe_lady 2y agoIn an alternate universe ReScript was this.
- throwitaway1123 2y agoIt's a shame that Reason fragmented into Reason and ReScript. I remember there being a ton of excitement around the project when Jordan Walke (creator of React) announced that he was working on a JS successor.
- zarzavat 2y agoThe TypeScript approach has given us one of the most interesting programming languages to appear in recent times, a language that is completely committed to structural typing. The Dart approach just gave us yet another unimaginative nominally-typed language. TypeScript is complex, but it’s also incredibly cool if you’re into compilers. Engineers do their best work when there are limitations imposed, in this case the need to add types to JS.