I won’t @ them but limiting expressivity in order to limit cognitive load and keep codebases approachable is a totally legitimate move in language design. I’d even say essential. It’s all about balance, and expressivity _does_ have tradeoffs.https://twitter.com/SeanTAllen/status/1036236006872305665 …
I’ll describe it in a tweet. Syntax: func Map<T,U>(array T[], f func(T) T) U[] { ... } == works on all types, panics if you compare closures < > <= >=, ditto There’s a builtin function func Hash<T>(obj T) u64 which can hash things. That’s it.
-
-
Oops, make that func Map<T,U>(array T[], f func(val T) U) U[]
-
What is array in this example and why isn't it implied by the [] on T? Likewise what does the val keyword denote?
- 8 more replies
New conversation -
-
-
TBF, `=` working on all types is a mistake of OCaml - SML has explicit syntax for equality comparable generic types, and OCaml libraries like Jane Street's remove that.
-
Oh my this seems like quite the deep rabbit hole I've tumbled down.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
