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.
-
-
-
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 -
Replying to @whitequark @phenlix
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.
1 reply 0 retweets 1 like -
isn't interface{} used a lot in Go code?
2 replies 0 retweets 0 likes -
This Tweet is unavailable.
-
Those could just be (possibly nested) records of closures though. e.g. type reader = { read: byte array -> int } type reader_writer = { reader: reader, writer: writer }
1 reply 0 retweets 0 likes -
That seems like pretty bad ergonomics.
1 reply 0 retweets 0 likes -
Yeah, it may be worth adding better support for that pattern. It might be nice to unify closures and interfaces, in that case; closures are just a special case of interfaces where there’s one method…
2 replies 0 retweets 1 like -
are they? methods carry a self with a public type, and closures carry an environment with an existential type
1 reply 0 retweets 0 likes
Yeah, and closures are structurally typed. Meh. Might not be worth it then.
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.