Just implement generics already. Sheesh. https://github.com/google/gvisor/blob/master/tools/go_generics/generics.go …
-
-
Replying to @pcwalton
"Just implement concurrency already" Or maybe "just implement a fast compiler already".
2 replies 1 retweet 2 likes -
Replying to @sjy
ML-style generics are extremely simple, as I’ve said repeatedly. They’re simpler than Go interfaces. It’s not about implementation difficulty. The problem is that, culturally, the Go team and community don’t want generics. That should change.
3 replies 1 retweet 13 likes -
Replying to @pcwalton
Does "extremely simple" imply monomorphization as an impl strategy? Maybe I'm just tired of horribly slow C++ compilers, but I kinda believe monomorphized generics are not a good default. I'd personally prefer something like Swift's approach (which is complicated).
2 replies 0 retweets 0 likes -
Replying to @sjy
Monomorphized generics are the right solution if you don’t have a JIT. They aren’t that slow. I’m convinced at this point that every attempt to work around monomorphization causes more problems than it solves. The complexity explodes, and often the overhead ends up worse.
1 reply 0 retweets 1 like -
Replying to @pcwalton
To be clear, I was talking about compile-speed, not runtime-speed. I'd be perfectly alright with compromising on runtime speed. I think Rust (and before Rust, C++) overly focuses on "zero-cost" abstractions, by accepting rather depressing consequences at compile-time.
1 reply 0 retweets 0 likes -
Also, Swift's implementation is such that a particular generic instantiation can be monomorphized *at the compiler's discretion*, and interoperate with non-specialized code. This seems much much saner (especially if used in combination with PGO).
2 replies 0 retweets 0 likes
Well, I basically implemented Swift’s approach (intensional type analysis) in Rust in 2010 or so. The complexity is huge, and it often resulted in worse code bloat than just monomorphizing. We ripped it out and I haven’t looked back.
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.