Live data from Hacker News

Rust in 2018: easier to use

jvns.ca

1–10 of 305 posts

Re: Rust in 2018: easier to use

#2
Agreed. I've played with Rust on and off since ~v0.8. I tried to get through the Matasano crypto challenges a few years ago and gave up after hitting a few language hiccups. I recently gave it another go, and it's much easier to use now.

I must have written around a thousand lines before needing a lifetime annotation, vs. something like 30 lines two years ago.

Re: Rust in 2018: easier to use

#4
post #3

Anyone has suggestions on learning rust for a python programmer who is also not strong on systems concepts?

Read the rust book and actually build something with it. There's a lot of stuff in Rust that you just never have to consider in Python so there's no easy way other than diving in. Actually, Programming Rust might be better, but it's not free.

https://doc.rust-lang.org/book/second-edition/

http://shop.oreilly.com/product/0636920040385.do

Re: Rust in 2018: easier to use

#5
The error messages are indeed _mostly_ marvelous (and there's an ongoing effort to make them even more marvelous). Often working with `rustc` feels like pair programming for introverts. But here's a question: `rustc` often gives _actionable_ advice - how far can can you get just following that advice? You can make `rustc` happy by following suggestions, but may end up puzzled as to the reasons for the changes it suggests.

Re: Rust in 2018: easier to use

#6

The error messages are indeed _mostly_ marvelous (and there's an ongoing effort to make them even more marvelous). Often working with `rustc` feels like pair programming for introverts. But here's a question: `rustc` often gives _actionable_ advice - how far can can you get just following that advice? You can make `rustc` happy by following suggestions, but may end up puzzled as to the reasons for the changes it sugg…

Elm is like the next level of this.

Re: Rust in 2018: easier to use

#7
post #3

Anyone has suggestions on learning rust for a python programmer who is also not strong on systems concepts?

Read the books, write code. When you'll encounter lifetimes, it's good to remember that lifetime annotations are descriptive and not prescriptive. You can't change lifetime of a variable by adding lifetime annotations.

For example, local variables of a function get destroyed on function exit no matter what and you can't prevent it by adding lifetime annotation to a local variable reference you are trying to return.

That was a stumbling block for me.

Re: Rust in 2018: easier to use

#8
post #3

Anyone has suggestions on learning rust for a python programmer who is also not strong on systems concepts?

For a python programmer some parts of Rust might feel too low-level and out of reach. However that is not a big issue. I would suggest you get comfortable tooling first, intellij rust plugin was awesome when I last checked it out. It comes with autocomplete, on-the-fly syntax checking etc. out of the box. The Rust compiler has very sane and understandable error messages (at least for basic tasks) so that will guide you a lot. I would also advise you to get on #rust-beginners on irc.mozilla.org, if you have any questions you will get instant help, which is a huge benefit :).

Lastly, I would first advise you to work through https://learnxinyminutes.com/docs/rust/ to get a feel of the language (like dipping your toes into the water). If you like what you see, then continue from the Rust book: https://doc.rust-lang.org/book/second-edition/ .

And most importantly remember to have fun!

Re: Rust in 2018: easier to use

#9
I expect a "it's easier to use" evangelism push around the upcoming epoch release. There are a bunch of mostly completed but still feature flagged changes that should remove a lot of the borrow checker toe stubbing. Getting rustfmt (formatter) and clippy (linter) on stable Rust would ideally be part of the push.

Aside from the almost completed features in the pipeline, I only see procedural macros (macros 2.0) and whatever happens to make async code easier to write[1] really impacting day-to-day code for most people.

[1] I'd really like to see F# Computation Expressions instead of async/await. I know the language experts have said Haskell-like do notation doesn't work in Rust but I'm not sure if the F# tweaks would make it work or not.

Re: Rust in 2018: easier to use

#10
Well it is super easy to develop hello world in Rust. Yay! Last time I checked there was no decent HTTP client and the documentation is just non existent for that subpar library. There were lost of promises about the newer version of async io library yet it is still WIP as of today. The performance was 30 times less than the same code in Java and after consulting many Rust developers nobody could tell me why.

It is new, it is shiny but lets wait its 10th birthday before it can be taken seriously and pls provide a decent async io / http library before we even get started what else can be done in Rust.

Post reply on HN