Hacker News new | past | comments | ask | show | jobs | submit login

I agree that the proposal is far from succinct.

But it is not really written a s a technical proposal, more an explanation with plenty of detail and abundant examples. The important information is kind of drowned out by the noise.

But other than that it is not really that complex. Generics aren't easy, but they are not something that needs to be invented. Implementation options and tradeoffs are well understood.

The duplication introduced by having both concepts and interfaces is unfortunate though.

Regarding syntax:

No language has really managed to provide a really good syntax for generics, imo. The default <T> is often ugly. Haskell chose to have them declared in a separate function header which is much nicer, but also annoying when having to modify two lines, etc.

I think this is a reasonable tradeoff. With special syntax highlighting for `(type T)` it will be easy enough to parse visually.

The proposal does contain some particularly unfortunate examples though.




It doesn't have contracts, but Zig's syntax seems pretty good:

https://ziglang.org/documentation/master/#comptime




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: