If you think generics have to be complicated, study OCaml’s generics. In particular, check out how hash tables and binary trees work without having to deal with typeclasses. I can hardly think of a language that gets “worse is better” better.
-
-
Replying to @pcwalton
I don't like the polymorphic hash function all that much but it is a solution that would fit Go *perfectly*
1 reply 0 retweets 4 likes -
Replying to @whitequark
Exactly. In many ways, OCaml is a better Go than Go.
2 replies 8 retweets 41 likes -
Replying to @pcwalton
someone should just write a cross-compiler from Go to Cmm :P
1 reply 0 retweets 9 likes -
Replying to @whitequark
I’ve said for years that if you put me in charge of designing Go, I’d take OCaml, make the syntax C-like, drop the object system, do a few other minor cleanups, and maybe add userspace threading. Done.
8 replies 16 retweets 79 likes -
-
it doesn't really justify the complexity it adds to the compiler however: I think to really emulate Go we'd need to drop the *class* system and keep the *object* system
1 reply 0 retweets 1 like
I’m not sure interfaces are really that important, honestly. When we needed them in rustboot we just used a record with a bunch of closures.
-
-
isn't interface{} used a lot in Go code?
2 replies 0 retweets 0 likes -
Replying to @whitequark @phenlix
To work around lack of generics, sure ;)
0 replies 0 retweets 1 like
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.