Twitter | Pretraživanje | |
Patrick Walton
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 Označi sa "sviđa mi se" More
Patrick Walton 30. sij
Odgovor korisniku/ci @pcwalton
I'm increasingly convinced that the interpreter solution is the only reasonable alternative for Rust.
Reply Retweet Označi sa "sviđa mi se"
Patrick Walton 30. sij
Odgovor korisniku/ci @pcwalton
*I'm* actually OK with this as an opt-in compilation mode, at least for cold functions. But are the people complaining about compilation time OK with it?
Reply Retweet Označi sa "sviđa mi se"
Tony “Abolish ICE” Arcieri 🦀 30. sij
Odgovor korisniku/ci @pcwalton @rustembedded
I just want the flag to say "I'll write all my code the monomorphizable way but I'll take smaller code at the cost of worse performance so please treat all my generics and impl Traits like they're dyn". ...because
Reply Retweet Označi sa "sviđa mi se"
Patrick Walton 30. sij
Odgovor korisniku/ci @bascule @rustembedded
You can’t just treat generics and impl Traits as dyn. That leads to intensional type analysis which is just not worth it.
Reply Retweet Označi sa "sviđa mi se"
Tim Sweeney 31. sij
Odgovor korisniku/ci @pcwalton
I don’t think you’d need a full bytecode interpreter to support runtime polymorphism, but just a bunch of RTTI mojo for boxing and unboxing values, and looking up traits by type via dictionary. Haskell type classes are implemented this way.
Reply Retweet Označi sa "sviđa mi se"
Patrick Walton 31. sij
Odgovor korisniku/ci @TimSweeneyEpic
Haskell has a uniform type representation. If you go down that road with a language like Rust you end up with Swift-like intensional type analysis, which gets hairy really fast.
Reply Retweet Označi sa "sviđa mi se"
Joe Groff 30. sij
Odgovor korisniku/ci @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 Označi sa "sviđa mi se"
Slava Pestov 31. sij
Odgovor korisniku/ci @jckarter @pcwalton
Maybe the real problem is that generics are actually bad
Reply Retweet Označi sa "sviđa mi se"
Carl DB 30. sij
Odgovor korisniku/ci @pcwalton
I dunno, "monomorphization" is pretty hard to say. While "I want all generic functions to be compiled to bytecode and to embed a Rust interpreter in every binary" is longer, I found it easier to say.
Reply Retweet Označi sa "sviđa mi se"
electronic liza 30. sij
Odgovor korisniku/ci @pcwalton
wait, do people say this? monomorphization is absolutely one of my top 10 favorite things about Rust
Reply Retweet Označi sa "sviđa mi se"