News for hackers. Stuff that matters.
Re:Choose Boring Technology (2015) by spion on Monday February 22, 2021 @09:58AM (#26225233)
TypeScript is a fundamentally different type system to most of the other mainstream languages (similarities exist only in typed racket and clojure's core.typed). The fundamental differences stem from the fact that it tries and succeeds to model almost all existing expressive dynamic JS constructs. The resulting different features include:

* structural instead of nominal types (i.e. if it walks like a duck and talks like a duck, it is a duck)

* mapped types let you transform object types into other object types: https://www.typescriptlang.org/docs/handbook/2/mapped-types....

* conditional types let you apply conditional type transformations, and combine with mapped types to provide the equivalent of for comprehensions https://www.typescriptlang.org/docs/handbook/2/conditional-t...

* template literal types let you generate dynamic string types on the fly, which you can use in various places including property names: https://www.typescriptlang.org/docs/handbook/2/template-lite...

and so on.

It does have a learning curve, and the tooling is annoying to set up.

Re:Choose Boring Technology (2015) by pjmlp on Tuesday February 23, 2021 @05:03AM (#26235558)
Which means that what looked like a nice WebIDL like in version 1.0 has grown to Haskell level language features by 4.2.

I expect Template TypeScript and Liquid TypeScript are not far off.

My enthusiasm for it has died, and I enjoy just doing a plain old <script src="myfile.mjs"/> on my own projects.