Twitter | Search | |
Patrick Walton Jan 30
Easy to say "monomorphization is awful and Rust should never have done it", harder to say "I want all generic functions to be compiled to bytecode and to embed a Rust interpreter in every binary".
Reply Retweet Like
Joe Groff Jan 30
Replying to @pcwalton
turning a big dial taht says "bytecode" and "monomorphization" and constantly looking back at the audience for approval like a contestant on the price is right
Reply Retweet Like
Slava Pestov Jan 30
Replying to @jckarter @pcwalton
Maybe the real problem is that generics are actually bad
Reply Retweet Like
Slava Pestov Jan 30
Replying to @jckarter @pcwalton
People retweeting this like they think I’m kidding
Reply Retweet Like
🆆il 🆂hipley Jan 31
I really love Swift generics (first language I’ve used that has them) but I’m finding Swift protocols are a PITA.
Reply Retweet Like
Joe Groff Jan 31
What are your pain points?
Reply Retweet Like
🆆il 🆂hipley
It’s all about the “you used an associated type OR touched Self so this protocol hates you now and I hate you.” Also the inability to auto-synthesize variables means if I have like 20 variables I end up creating a struct, but protocols can’t have embedded types.
Reply Retweet Like More
Slava Pestov Jan 31
Can you elaborate on the auto-synthesizing variables bit?
Reply Retweet Like
🆆il 🆂hipley Jan 31
When I have a bunch of properties in the protocol that are basically only used inside the protocol itself (like, essentially “internal” to the protocol) it’s annoying to require all my witnesses to define them, and redefine them when they change. It’d be great to @autosynthesize.
Reply Retweet Like