Hacker News new | past | comments | ask | show | jobs | submit login

Can anyone suggest a good rust tutorial? I think I finally should learn this.



The official Rust book is the way to go. That being said, you "should" only learn it if this is actually your domain – for example because you're a C++ developer currently or so. You really don't need it in other software engineering domains.


I agree with the official Rust book, but I disagree that one shouldn't learn it.

Rust, even as a learning exercise, makes you think about a lot of concepts you'd normally not notice. It is a fun language, fun to experiment with, and due to its learning curve, it'd be far less stressful to learn the basics ahead of time if you ever needed it.

I used Rust-python bindings on a small project where we didn't want to use big python math libraries for portability, but a few of our calculations ran really slow on python primitives. Re-wrote a couple functions in Rust for a 40x speedup and its fully switchable to return to the original python implementations.


Yes, it's worth looking into the language and its concepts. But I think many people feel bad for not knowing or not having tried Rust because the Rust community tends to be very vocal and not quite reserved, and I believe that's a mistake. Not knowing Rust doesn't make you a bad software engineer, as opposed to what some Rustaceans want to make you believe.


Not knowing it doesn't make you a bad software engineer, but knowing it certainly will make you better(unless you've been writing CPP for 30 years).


>(unless you've been writing CPP for 30 years).

Yup; in that case, I am sorry, there is nothing science can do for you (。•́︿•̀。)


They're too busy redefining c++ primitives then trying to debug their code to see this. I think we're safe.


> Not knowing Rust doesn't make you a bad software engineer, as opposed to what some Rustaceans want to make you believe.

Nobody is saying this, despite what some people with overactive persecution complexes want to make you believe. As for prescribing what people should do, I will say that curiosity is an essential part of improving in any field, including software development. Learning anything at all broadens your horizons and threatens to make you better. If you don't know Rust, go ahead and learn it (or anything else that interests you); if you already know Rust, go learn something new. It would be quite silly for someone to assume that no advances to the state-of-the-art have happened since they first learned to program.


Sibling comment (last paragraph about python binding) is spot on: modest c++ knowledge puts doing a native component in a otherwise memory safe environment deeply into "don't try this at home!" territory. Modest rust knowledge? Sure, you might find yourself having picked a fight that you are unable to win, giving up before finding a solution the borrow checker accepts. But the danger of ending up with a quick success that later turns out to be an infinite supply of mystery segfaults is rather low. The failure mode for being not quite sufficiently good at it for the problem at hand is far more benign in rust.

Modest c++ knowledge means knowing that you should better not try using that knowledge, which is quite terrible as an on-ramp.


> That being said, you "should" only learn it if this is actually your domain

You're suggesting that you can actually decide this for other people? Hahahah! :)

That being said, you "should" never to deign to decide for someone else what they should do. It's a responsibility violation because you decide "should" for you, I decide "should" for me. No other way. Get it? :) hahaahah

The idea above comes across as condescending, hope you can remember that next time you are loading a "should" into the chamber! Haha :)

Regarding the utility only existing for C++ devs, I get if that's the way it looks for you, tho that's not how it is.

It's important to keep an open mind regarding the value of learning and what can be helpful and appreciate that there are a variety of approaches that work for different folks! :)


It is useful in other domains as well.


NoBoilerplate [1] is a great Rust-oriented YouTube channel that's less tutorial and more of a tour of the strengths and foibles of the language. The videos are a great springboard, because they are entertaining as much as informative and inject a bit of hype and hope for when you're battling the compiler.

[1] https://www.youtube.com/c/NoBoilerplate


If you avoid async, it's fairly easy to learn. (I never managed to learn C or C++.)

While you're learning, take shortcuts; e.g. use .clone() and/or .to_string() liberally to avoid values going out of scope. When you want to speed up code you can do the opposite.

Egui is a great well-rounded immediate mode GUI library that you can use to get up and running fast.

The Rust implementation of SDL2 is pretty good too. There are plenty of examples online you can borrow from.


If you prefer learning by doing, I recommend rustlings. Its a bunch of small exercises that roughly follow the content of the main rust book.

https://github.com/rust-lang/rustlings


On the top get started section. All three links is all you need.

https://www.rust-lang.org/learn


I kinda bounced off The Rust Book but Programming Rust is doing me mightly fine https://learning.oreilly.com/library/view/programming-rust-2...


Official Rust book is great.

If you want to give Rust a go through Jupyter Notebooks, check out https://datacrayon.com/data-analysis-with-rust-notebooks/set...




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

Search: