3 ms·
It is indeed a weird language. I've been rusting heavily for about a week (doing Matasano crypto challenges) and I'm still puzzled at lifetime errors. Managing
by kaoD 12y ago
It is indeed a weird language. I've been rusting heavily for about a week (doing Matasano crypto challenges) and I'm still puzzled at lifetime errors.
Managing lifetimes is hard to reason about (though this is not a problem with Rust, but with lifetimes... Rust just makes it explicit.)
As soon as you start using generics things can quickly get out of control. Here's one of my function signatures:
pub fn xor_together<'a, 'b, 'r, A, B, R, T, U>(iter_a: T, iter_b: U) -> Map<'r, (&'a A, &'b B), R, Zip<T, U>>
where A: BitXor<B, R>,
T: Iterator<&'a A>,
U: Iterator<&'b B>
If you get those lifetimes wrong, the error propagates and you end up having lifetime errors farther in your call chain, which are quite hard to debug. I'm not even sure those lifetimes are 100% right.
Some other weird things include closures. There are several types of closures, not interchangeable with each other (nor with fn) and honestly I don't understand them (and couldn't find docs to explain them). I hope this changes as Rust stabilizes.
I'm loving it so far, but boy... how hard it is.
- kibwen 12y agoClosures are soooo messed up right now, because we're in the process of replacing them wholesale but the new system is only half-implemented. As a result you're forced to choose between using closures that work but suck (the old system) or closures that don't suck but don't work (the new system). So don't judge us on closures just yet. :)
- MetaCosm 12y agoI hope that when Rust hits 1.0 -- they take backward compatibility exceptionally seriously. The pre-1.0 path has been exceptional wild ride, and it has made me a bit gun shy about the language as a whole. I am no stranger to pre-1.0 languages, I have worked with lots of them, but none have been as frustrating (or interesting) as Rust... the question as to will Rust grow into a production language or an academic toy still remains an open one in my book. Reserving judgement until 1.0 is out.
- steveklabnik 12y ago> I hope that when Rust hits 1.0 -- they take backward compatibility exceptionally seriously. We do and we will. It's one of the reason there's such churn right now: we can't keep doing that post 1.0.
- steveklabnik 12y agoLook what just appeared http://blog.rust-lang.org/2014/10/30/Stability.html http://blog.rust-lang.org/2014/10/30/Stability.html
- MetaCosm 12y agoI can't decide if that terrifies me or inspires confidence. But, it is great to see it on the radar and out in public.