logoalt Hacker News

viraptortoday at 10:37 AM1 replyview on HN

You have conflicting requirements there - expressive type systems are not direct and simple. And elegant is subjective.

But seriously though: have you tried to see how far you can get with the design right now? You can start iterating on it already, even if the implementation will lag.


Replies

prmphtoday at 11:15 AM

I do not have conflicting requirements. Expressive type system ARE direct and simple.

Expressive power is the ratio how strongly/clearly you can encode invariants to how complex and ceremonious the syntax of it needs to be.

See how JS, a language usually seen as a middling/mediocre language, can distill the basic good parts of OOP into very direct and clear idioms? I can just create an object literal and embed simple methods on them that receive the "this" pointer and use it. The constructor would be just a regular function. None of the cruft of standard OOP.

See how you define an enumerable union in TypeScript? Very simple. And yet I can think of many major languages that do not have this, certainly not with a lot of ceremony and complexity.

And I can go on.