3 ms·
The main problem with most typed languages is basically that types are nominal by default. What I want is free-form records and structural types by default, no
by spion 11y ago
The main problem with most typed languages is basically that types are nominal by default.
What I want is free-form records and structural types by default, nominal types only when necessary. I get more than half of that with TypeScript (it does lack nominal types but there are ways to get around that), and honestly its the half I prefer having.
- majewsky 11y agoMost serious statically-typed languages have some sort of "anything" type where you can check the actual value type at runtime using some sort of reflection. For example, the direct Golang equivalent of a Javascript object is a map[string]interface{}.
- spion 11y agoI'm not looking for an `any` type, but for structural types: Go interfaces are already a basic form of that, although a bit too basic. And I hate to say it, but Go doesn't qualify as a serious statically typed language. No language without generics does.