4 ms·
So, the rust language developers made some syntax choices in early versions of rust, and when those choices are extended to their natural conclusion the result
by infogulch 6y ago
So, the rust language developers made some syntax choices in early versions of rust, and when those choices are extended to their natural conclusion the result is that specifying type arguments is a bit more awkward than one might like in some circumstances. This topic is full of nuance, tradeoffs, history, and backwards compatibility; instead of simply lamenting or encouraging endless debate on the choice, the author opted to build a temple around it instead. A piece of art that unapologetically explains the concequence yet still pays homage to the nuance.
- ynik 6y agoExcept that's not where it ends. The Bastion is only a demonstration that it takes a breaking change to get rid of the turbofish. But every new keyword is also a breaking change, and in practice new keywords cause more breakage than the proposed approach for getting rid of the turbofish. Rust editions can easily handle that. Ordering the events on @varkor's attempts to eliminate the turbofish: * RFC 2527 * Bastion of the Turbofish * RFC 2544 If you'd like to know why Rust really still has a turbofish, the huge RFC 2544 thread has the full story: https://github.com/rust-lang/rfcs/pull/2544 https://github.com/rust-lang/rfcs/pull/2544 Important points in that discussion (I'm only linking to the comments summarizing other comments): * Sep 2018: Lang team rejects the change for 2018 edition due to lack of time: https://github.com/rust-lang/rfcs/pull/2544#issuecomment-423338391 https://github.com/rust-lang/rfcs/pull/2544#issuecomment-423... * Jan 2019: Lang team proposes to merge the RFC (accept the change): https://github.com/rust-lang/rfcs/pull/2544#issuecomment-453653184 https://github.com/rust-lang/rfcs/pull/2544#issuecomment-453... * A bunch of people objected, people can't agree on subjective points: https://github.com/rust-lang/rfcs/pull/2544#issuecomment-453769119 https://github.com/rust-lang/rfcs/pull/2544#issuecomment-453... * The discussion got derailed and closed as too heated: https://github.com/rust-lang/rfcs/pull/2544#issuecomment-453796456 https://github.com/rust-lang/rfcs/pull/2544#issuecomment-453... And that's where the project to eliminate the turbofish died. Nobody in the know wants to deal with that much drama, so AFAIK no one has tried again.
- ChrisSD 6y agoHow is a new keyword a *major* breaking change? They can only be introduced at edition boundaries, which means they are opt in. And code can be automatically upgraded to a newer edition by replacing uses of `keyword` with `r#keyword`. New keywords are a relatively minor inconvenience so long as there aren't too many.
- ynik 6y agoI didn't say a new keyword is major breaking change. New keywords are small breaking changes; I'm saying that the breakage when eliminating the turbofish is even smaller! If you read RFC 2544, some team members were considering removing the turbofish without a new edition, because a crater run did not find any real-world code that would break. The "Bastion of the Turbofish" might literally be the only Rust code in existence that would be broken.