Live data from Hacker News

Rust can be difficult to learn and frustrating, but it's also very exciting

influxdata.com

1–10 of 282 posts

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#3

Rust is one of those languages that I just can't see myself ever working with (I mostly do web dev), but it's a language I am really glad I learned and has made me a better overall developer.

you may want to have a look at Rocket https://rocket.rs/, you won't be disappointed

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#4
Can anyone recommend exercises for learning a new language. For example, something like "implement a class with these methods", or implement a function that does this. Something that is realistic, should only take an hour or two to implement for a competent programmer, requires you to learn more complicated features of a language, yet I can finish before getting bored or frustrated?

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#5

Rust is one of those languages that I just can't see myself ever working with (I mostly do web dev), but it's a language I am really glad I learned and has made me a better overall developer.

Yeah, if I was still doing primarily web applications, particularly version 1 apps where you don't know what the final product will actually be, I would probably still be using Rails for that. It's just insanely fast for creating those apps and once you've found the features that are hits that need to scale, you can pull those pieces out into services written in languages like Rust or Go. But since I mostly do lower level stuff now, Rust is looking very compelling.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#6
post #4

Can anyone recommend exercises for learning a new language. For example, something like "implement a class with these methods", or implement a function that does this. Something that is realistic, should only take an hour or two to implement for a competent programmer, requires you to learn more complicated features of a language, yet I can finish before getting bored or frustrated?

Things like Cryptopals (https://cryptopals.com/) are good.

But surely it's going to depend somewhat on the language and what things are easy/hard to do in that language?

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#7
post #4

Can anyone recommend exercises for learning a new language. For example, something like "implement a class with these methods", or implement a function that does this. Something that is realistic, should only take an hour or two to implement for a competent programmer, requires you to learn more complicated features of a language, yet I can finish before getting bored or frustrated?

For Rust I've seen people reference Rust Koans (https://github.com/crazymykl/rust-koans), but I haven't looked at that myself. I wanted a project that was sizeable enough to force me to use a good number of language features (but not all). I think the interpreter was a pretty good balance there, but it definitely took a time investment.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#9
post #4

Can anyone recommend exercises for learning a new language. For example, something like "implement a class with these methods", or implement a function that does this. Something that is realistic, should only take an hour or two to implement for a competent programmer, requires you to learn more complicated features of a language, yet I can finish before getting bored or frustrated?

I'd also like to hear what others do to learn languages. I like to write a little RPN calculator. The program's interface might vary depending on the language: to learn browser JS, you might do a DOM-based UI; for Rust it might be a CLI; for Go or Erlang maybe a line-oriented network service.

Depending on the interface, this tends to exercise language and runtime features like: string handling and parsing, event handling, conditionals / pattern matching, etc. "Calculator" is also a big enough problem space that you can come back to it to try out more interesting language features (e.g. using Rust enums to model your calculator's operations).

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#10

Rust is one of those languages that I just can't see myself ever working with (I mostly do web dev), but it's a language I am really glad I learned and has made me a better overall developer.

you may want to have a look at Rocket https://rocket.rs/ , you won't be disappointed

Rocket requires the nightly Rust compiler, which isn't something I find acceptable for production applications, and it's synchronous, so it's really slow. I have been rather disappointed by what I perceive as the author's unwillingness to work towards stable Rust. They have a GitHub issue where they track all of their dependencies on nightly, and kind of just say they aren't going to do anything about it -- it's up to the Rust core team to just make all the things stable that Rocket is using, or else it will stay on nightly forever.

Rocket's biggest feature is their flashy website, in my opinion. Their website is really nice looking and the self-assured marketing is convincing to readers.

Actix-Web seems like a more mature framework (I don't expect my application to randomly break), it's asynchronous (so it's really fast) and it works on stable Rust. Warp and Tower Web look like promising async frameworks, but they're not very mature yet. Rouille is a pretty stable option for a simple, synchronous web framework.

Post reply on HN