News for hackers. Stuff that matters.
Re:Why We Chose Typescript by jstimpfle on Saturday July 01, 2017 @06:24AM (#14676411)
> You can define mix-typed maps without a sweat: const defaults = { debug: false, title: 'Banana', width: 100 }

That's called a struct (or class) elsewhere.

Re:Why We Chose Typescript by fny on Saturday July 01, 2017 @09:28AM (#14677020)
An instance of mixed-type maps*

Elsewhere one would have to define a struct/class and them create an instance.

This becomes immensely helpful for the incredibly lazy with one off object definitions and wrapper types. If you introduce a class definition alongside an instance, you're now forced to manage two peices of code. The class definition and instance definition. In this case they're coupled which aides maintenance in my experience.

Re:Why We Chose Typescript by resf on Saturday July 01, 2017 @08:46AM (#14676877)
Specifically structural record types, and many statically typed languages don't have them. (not Java, not C++, not Haskell, not Rust, yes Swift, yes OCaml)
Re:Why We Chose Typescript by jstimpfle on Saturday July 01, 2017 @09:24AM (#14677007)
What I wanted to point out is that typically a C struct is what you need. The common case is static keys and static value types but dynamic values.

What are interesting use cases for more dynamic (i.e. non-fixed set of keys / types)?

I mean, if you need something super-abstract and flexible, you are unlikely to need a built-in convenient syntax to hardcode such values.

Re:Why We Chose Typescript by mrkgnao on Saturday July 01, 2017 @01:43PM (#14678047)
, yes Purescript :)

For those new to this, good search terms are "row polymorphism", "extensible records", and "polymorphic variants".