Live data from Hacker News

Ask HN: Is it worth investing in learning Rust?

news.ycombinator.com

21–30 of 82 posts

Re: Ask HN: Is it worth investing in learning Rust?

#21
To answer your question, it would be good if you indicated what your experience is already and what you want to do!

Just my opinion (given my own experience and goals; if your experience/goals are different the below may be irrelevant):

As a constant waverer, my answer to the "Go or Rust" question was, after much time, "no".

Instead I'm returning to C++ and trying to learn how to use modern C++ idioms and finding this very productive.

It's a bit frustrating, as C++ is a bloated mess of a language with way too many dark corners, but good discipline can allow you to use a version of it that is really nice. As someone who learned C++ in 1992 (when much of the language wasn't even really there yet) and has only fitfully engaged with good C++ practices over the years, the payoff from learning new parts of C++ has been really much better than a new language.

Plus, neither Rust nor Go are particularly mind-expanding if you're a native C++ speaker (as compared to Python, Prolog, Forth, assembly, Haskell, Lisp, ...).

Re: Ask HN: Is it worth investing in learning Rust?

#22
post #10

Earlier quoted context omitted.

Can you explain please why is that ? btw I'm coming from a JS/Node background, but I worked with C and C++ before (mainly school projects, nothing serious).

Maybe I can try to chime in: Go is not an OOP language, you get the dot notation on structs and that's pretty much it. Rust is all about advanced OOP and very fussy static type checking. That said, IMHO, Go to me feels more like a replacement for Node more than a replacement for C.

No offense but your commentary is on the verge of being just misleading. Rust is not OOP and go is definitely not a replacement for node.

Re: Ask HN: Is it worth investing in learning Rust?

#25
post #3

Learn both, Rust is a great general purpose language that can be used to build almost anything. Go is a great general purpose language that can build a nice set of things. If you need to, you can even use Rust to build firmware, boot loaders, kernel drivers, user mode drivers and operating systems. Basically anything that you want to run fast and have less errors Rust would be a pretty good choice to use, especially…

Yes, on the performance side of things, Rust is blazing fast, but the learning curve is hard though, that's why I'm wondering if it's really beneficial for me as a programmer especially in the long run, since it's not used widely in the moment.

It is worth learning about it, the biggest part of the learning curve is learning how to right programs better using the language guidelines. I use it daily and it has been a wonderful tool in the toolbox to improve performance, reliability and security of our systems and low level processing systems. You will more then likely still need to use C and C++, but learning Rust will help you program better in C and C++ along with other languages as Rust can call those C and C++ based programs.

The use of Rust is rising, especially for new systems level projects or rewrites of older programs. This is especially true where unexpected issue reduction is a high priority (high frequency trading systems, industrial systems, security systems, video transcoding, packet switching and routing systems, video monitoring systems, virtualization and emulation, web servers, other embedded etc.)

I would recommend getting started learning Rust by having a few projects. I would recommend starting off by building a multi-threaded web server. https://doc.rust-lang.org/book/second-edition/ch20-01-single... See how many concurrent clients it can handle and make adjustments to increase it's max capacity. After you have done that I recommend building your own daemon to handle log parsing and analysis from your web server to give you a nice table of stats. To spice thinks up I would recommend trying to do this without the dependency on external resources after you have downloaded all the resources you need: https://doc.rust-lang.org/cargo/reference/source-replacement... https://crates.io/crates/crates-mirror then try to build the projects.

You can also do some much needed checks on your programs input by using Valgrind and several other tools. Once you are satisfied with your program insure you use Rusts tools to also build the documentation and check your coverage: https://github.com/huonw/travis-cargo

Re: Ask HN: Is it worth investing in learning Rust?

#26
Many things are worth investing in, if you justify it.

The case between Rust and Go is an interesting one, as many of us have observed that the two languages seem to get paired together (for people wanting to learn).

I wanted to start learning both beyond the basics, about 2 years ago. A few weeks ago I decided to write my Hello World in Rust, and I've been hooked.

What I'd advise is for you to have a use-case that you work on while learning the language. You can spend a lot of time on the basics and std, but unless you start also picking up a few external libraries (e.g. SQL, web framework), you might find progress to be slow.

The other benefit is that you'll get more exposed to the community. It's important to know where to go when you need to ask for help.

In my case, I got comfortable with gRPC in Rust, then moved to Actix, and now (if I get diesel.rs to compile) I'm moving to SQL. Next will be "fearless concurrency", threading and futures, streams, integrating with NodeJS and other languages, etc.

A roadmap which gets one comfortable with the standard language while being productive.

Re: Ask HN: Is it worth investing in learning Rust?

#27
post #10

Earlier quoted context omitted.

Can you explain please why is that ? btw I'm coming from a JS/Node background, but I worked with C and C++ before (mainly school projects, nothing serious).

Maybe I can try to chime in: Go is not an OOP language, you get the dot notation on structs and that's pretty much it. Rust is all about advanced OOP and very fussy static type checking. That said, IMHO, Go to me feels more like a replacement for Node more than a replacement for C.

> That said, IMHO, Go to me feels more like a replacement for Node more than a replacement for C.

Except the first release of node was May 2009 and the first announcement of golang November 2009. Node was also first showcased in November 2009.

So for me golang cannot be seen as a replacement for node just from chronological order. Also their design goals at the time seems very different.

Re: Ask HN: Is it worth investing in learning Rust?

#28

Earlier quoted context omitted.

Maybe I can try to chime in: Go is not an OOP language, you get the dot notation on structs and that's pretty much it. Rust is all about advanced OOP and very fussy static type checking. That said, IMHO, Go to me feels more like a replacement for Node more than a replacement for C.

Rust and OOP are no more related than Go and OOP. What "advanced" OOP features of Rust are you talking about?

Then I must have gotten the wrong idea.

I saw a few examples of Rust code with a good amount of generics sprinkled in and given what (seemed to me) the parent comment was suggesting, I assumed that was the case.

That said, I remember reading in the docs about many usually OOP related concepts like RAII, boxing/unboxing, operator overloading, the aforementioned generics.

You mostly don't care about these things in Go. Can we agree that Rust is a bit more OOP oriented than Go at least?

Re: Ask HN: Is it worth investing in learning Rust?

#29
Go is a much, much easier language to learn; it's one of the easier mainstream languages to learn.

If you really have to ask, like it's a headscratcher between the two, learn Go first and see if you're happy where you land with it. Go is the more popular of the two languages; there's not much "risk" to either of them, but there's marginally less risk for Go.

Rust is the more ambitious of the two.

Re: Ask HN: Is it worth investing in learning Rust?

#30
post #15
post #9

Earlier quoted context omitted.

I think learning both languages to figure out what's my favorite is a bit hard to do, I don't want to actually learn some basics then switch to another language to explore.

Learning and using multiple languages is absolutely vital to being able to choose the right tool for the job. You have time to learn both and switching is a necessary skill if you want to program professionally

> to learn both and switching is a necessary skill if you want to program professionally

There is a hoard of professional Java or C# developers that invalidate the idea that you need to know more then one language to program professionally.

While this might seem odd to a hn reader, where there is weekly blog posts of comparing languages or trying out the new shiny thing at a startup.

One need to remember the audience is single digit percentile of the computer industry. The rest of the industry actually use jdk or .net in the enterprise.

Post reply on HN