Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I recently started looking at Rust. I somehow had this idea in my head that it was a weird language, but up close, it is quite a friendly beast. Interesting, though.


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.


Closures 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. :)


I 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.


> 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.



I can't decide if that terrifies me or inspires confidence. But, it is great to see it on the radar and out in public.


It has gotten a lot friendlier-looking in recent versions, thanks to the reduction in odd type-punctuation for lifetime description. It's more uniform now.


Those attributes that look like comments have to go. Geez.


It's likely that they will turn into @foo rather than #[foo]. The proposal is still being worked on.


I don't understand the problem. Rust doesn't have # for comments, and I find `#[random]` easier to the eyes then `@random`. Or are we speaking about `@[random]`? Then again, I've never been one for micro-syntax-discussions.


The motivation doesn't have to do with it looking like comments: https://github.com/rust-lang/rfcs/pull/386


Ah, okay, thanks!


Good enough for me.


Too much shell programming?


A lot of popular non-shell languages use #, e.g. Ruby, Python, PHP.


Scripting languages, usually coupled with shell programming.


That's not really a sensible association. A lot of work is done with those languages where shells are either not used at all, or are just a development tool (e.g. could be replaced by editor features). It seems rather strange to try to forcibly connect Python/Ruby/... and sh, rather than just grouping as languages that happen to share the # for comments. (Maybe they adopted it from shells originally, but the languages definitely stand on their own now.)


I never used them for anything else other than scripts on steroids, as I care for application performance.

Well, PHP is forced upon me by my ISP and I never bothered to change.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: