Live data from Hacker News

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

influxdata.com

11–20 of 282 posts

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

#11
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?

https://exercism.io

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

#12

Earlier quoted context omitted.

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 t…

> which isn't something I find acceptable for production applications

For what it's worth, at least some of the largest rust adopters just pin to a nightly version, and don't have a ton of issues upgrading.

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

#13
I have been learning Rust on and off this year. I have been writing mostly GO for the past few years, but am moving to coding almost primarily in Rust for any new project, and porting over some older ones. Microservices, Data Layer, etc... Honestly, while not perfect, its one of the most beautiful languages I have ever come across. Plus, I have not enjoyed coding in a language this much in a while.

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

#14
I think folks might find Sentry’s use of Rust interesting. Sentry is quite invested in Python on their backend, but needed additional performance mostly related to symbolication of crash reports. So they have a Rust symbolication library with Python bindings giving them the best of both worlds for their app.

https://github.com/getsentry/symbolic

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

#15

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.

I kinda felt similarly until I found one of my existing web services wasn't quite fast enough (currently serving around 1000req/s at peak). I could either go for a third rewrite in yet another framework hoping to increase performance by maybe 30%, or I could try something entirely new.

First attempt with rust more than doubled performance of the existing system on the same hardware. Now I feel a need to learn more.

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

#16

Earlier quoted context omitted.

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 t…

> which isn't something I find acceptable for production applications For what it's worth, at least some of the largest rust adopters just pin to a nightly version, and don't have a ton of issues upgrading.

That was definitely true before Rust 1.15, but it becomes even less beneficial with each new stable release.

I work for one such prominent early adopter of Rust, and we were very happy to move to stable sometime back. Stable versions are widely used, so issues are much more likely to be noticed, and fixes are backported to the current stable release.

If you pick a random nightly version, you have much less support to begin with simply because fewer people use it, and you're on nightly because you're dependent on features that haven't been as thoroughly tested as those features that exist on stable, and which could disappear entirely in the next nightly. Each time you upgrade to a different nightly increases the risk of introducing some hard-to-find bug into production.

Some companies do use nightly Rust in production. You're completely correct. It's just not something that I would personally be willing to do unless I had absolutely no reasonable alternative.

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

#17
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 think you can find koans for a lot of languages (mostly pre written tests, where you write code to make those tests pass. Some examples:

1. Kotlin Koans (https://play.kotlinlang.org/koans/overview) 2. Ruby koans (http://rubykoans.com/)

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

#18
I've enjoyed learning Rust, but I'm at the stage where I'm hitting constant stumbling blocks because of the slightly niche nature of what I'm doing.

It's the ugly side of Rust; when you're stuck with a series of problems that you can't solve (or take too long to solve), when there aren't enough people in the community to help you, and you end up being unproductive for a while.

Where I've seen small projects to their completion, Rust has been greatly rewarding to me. It's the projects that are bigger and more ambitious where I'm struggling.

> After reading the first 10 chapters of Programming Rust, I was able to push through the rest of the implementation. I still have open questions, and I’m not sure if the structure I used makes the most sense.

There's some chapters of TRPL and other resources that I've re-read a few times by now. Learning the language ends up being quite a lot of an academic exercise, but the benefit's that once a concept clicks, it paves way for many other concepts.

My only advice to less experienced programmers (whom you're not) learning Rust: Stay away from writing or rewriting time-critical applications in Rust if you can't tolerate being stuck on a problem or series thereof for weeks.

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

#20
post #15

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.

I kinda felt similarly until I found one of my existing web services wasn't quite fast enough (currently serving around 1000req/s at peak). I could either go for a third rewrite in yet another framework hoping to increase performance by maybe 30%, or I could try something entirely new. First attempt with rust more than doubled performance of the existing system on the same hardware. Now I feel a need to learn more.

What are you serving? Some of the Rust frameworks for backend should be able to do more than 1000req/s, but it depends what you're doing.
Post reply on HN