Live data from Hacker News

How I went about learning Rust

eli.thegreenplace.net

81–90 of 303 posts

Re: How I went about learning Rust

#81
post #3

I have been thinking to myself whether I should pick up Go or Rust as a new language this year. Coming from a NodeJS background, Rust looks a tad more complicated but it looks cooler. There are also more job listings looking for Golang than Rust which makes me wonder if Golang might be a more rewarding investment? What would be a good use case of Rust than Golang cannot do given its extra complexity and potentially l…

If you're looking for a new language in order to get a job, then I wouldn't be looking for either of these languages and look into something much more common like C++ given your background.

I see Rust as more for people in systems programming who want improvements over C, rather than a desktop developer looking to learn something new. There's a lot of hurdles that you only really appreciate if you've come from an unsafe/low-level background

Re: How I went about learning Rust

#82
post #46
post #14

Earlier quoted context omitted.

Rust is the more elegant and powerful language. Creating a new language and repeating the "billion dollar mistake" by including null (sailing under the brand name "nil" in Go) is just crazy. Error handling is another strange thing in Go. And generics have been only introduced recently, but there is hardly any support for libraries in it (now). While Go is definitely fast enough for most scenarios, it is not the best…

While Go is definitely fast enough for most scenarios, it is not the best language for low level code like drivers or kernel development. Go was never ever intended for this purpose.

Yes, I know (although they promoted it as a "systems language", but it was not really defined what that should mean in the beginning), but it is a restriction, you don't have in Rust. Basically, Rust can do everything Go can do, but not the other way around. That _might_ help to make a decision for a language.

Re: How I went about learning Rust

#84
post #77
post #71

Earlier quoted context omitted.

I mean it depends . Many of aspects of Rust that are perceived as sharp edges are in fact the programmer bringing in their preferences and paradigms from other languages and trying to program that way in Rust. I was one of those and tried to do OOP in Rust. It was a pain. At some point I gave up and was like: "Okay Rust, I do it your way, I just want this to work". And it worked flawlessly and easy. I literally had t…

This sounds to me like the journey into functional programming. I've experienced the same thing myself.

I've encountered this pretty-much every time that I've learned a new language or framework. I start out trying to use it the way I've used things before, and then I slowly learn how the people who wrote it expect me to work, and then things get a lot easier.

Re: How I went about learning Rust

#85

Earlier quoted context omitted.

> there's no job in [Rust] As of today, indeed.com lists 1,500 remote jobs mentioning Rust vs. 4,018 jobs mentioning Golang. That's not so bad. (However, there's no way to tell how many of those listings are Rust-specific as opposed to polyglot job descriptions.) > Also, the [Rust] community is toxic. Speaking slightly humorously, if you think Rust community is toxic, try expressing your dissatisfaction with Swift or…

Most "jobs mentioning Rust" are in the crypto space for some reason. I can't fault devs for thinking that such "opportunities" are just not very serious compared to the alternatives.

Every one of the big tech companies have large Rust projects. Even Apple has open job listings for Rust devs.

Re: How I went about learning Rust

#86
post #60

Earlier quoted context omitted.

What are you looking for in the 2 languages? Here are some of my thoughts: Golang * Development speed: Golang wins by far. It's closer to Python in that regard, but with strong typing. * Very nice multi-threading via Go routines and channels. Impressive semantics in simple syntax, requiring no synchronization mechanism on the user side. * Large garbage collector penalty. Rust * Complete language with build system, cr…

> slow to compile In my experience it's the slowest language to compile ever , and the binaries generated are gargantuan. I was super excited to learn Rust, but that excitement is now 100% gone.

Binary size very much depends on your settings. Rust does not optimise for a small 'hello world' by default, but it's very possible to get small binaries from it if that's a priority for you (for example, the default debug build neither optimizes for size nor strips debug information, as well as statically linking the standard library). Compile times are more sticky problem and most ways to improve it basically involve avoiding certain language features and libraries.

Re: How I went about learning Rust

#87
post #71

Earlier quoted context omitted.

I mean it depends . Many of aspects of Rust that are perceived as sharp edges are in fact the programmer bringing in their preferences and paradigms from other languages and trying to program that way in Rust. I was one of those and tried to do OOP in Rust. It was a pain. At some point I gave up and was like: "Okay Rust, I do it your way, I just want this to work". And it worked flawlessly and easy. I literally had t…

Rust actually supports most OOP features, with the main exception of implementation inheritance. And implementation inheritance is a nasty footgun in large-scale software systems (search around for: "fragile base class problem"), in a way that just doesn't apply to simple composition and pure interfaces (traits). So it's hard to fault Rust for including the latter and not the former.

For me it was the web-of-pointers strategy I had to unlearn. A child object keeping a pointer to its parent is misery in Rust. It forces you to either make the child completely independent or really prove the parent will be around until the child disappears.

90% of the time this is dumb overhead, but 10% of the time it found a bug in some edge case, so I learned to appreciate it as a tough teacher, and my designs got better for it.

Re: How I went about learning Rust

#88
post #3

I have been thinking to myself whether I should pick up Go or Rust as a new language this year. Coming from a NodeJS background, Rust looks a tad more complicated but it looks cooler. There are also more job listings looking for Golang than Rust which makes me wonder if Golang might be a more rewarding investment? What would be a good use case of Rust than Golang cannot do given its extra complexity and potentially l…

If you want to optimize your learning experience, then learn Go first. Rust has a very steep learning curve, whereas you can pick up Go very very quickly.

I learned Go by reading The Go Programming Language. It's a bit old, but a very good book nonetheless.

Re: How I went about learning Rust

#89
post #3

I have been thinking to myself whether I should pick up Go or Rust as a new language this year. Coming from a NodeJS background, Rust looks a tad more complicated but it looks cooler. There are also more job listings looking for Golang than Rust which makes me wonder if Golang might be a more rewarding investment? What would be a good use case of Rust than Golang cannot do given its extra complexity and potentially l…

I have no experience with Rust myself and a good 2-3 years with Go, so my opinion here is biased but: I think Go is more suitable for general all-purpose programming, whereas Rust is more specialized; I'd pick the latter if you need to do high-quality, close-to-the-metal software, and Go for more generic software, taking the same spot that NodeJS did for you.

That said, Go isn't a very "convenient" language; there's not as much magic or magic libraries that come with the language that take over big chunks of your application, and the community at large actually recommends against using libraries in favor of just using the standard library.

And after a while, I... kind of agree? My HTTP API is gorilla/mux, which is only a thin layer over the standard library's HTTP server APIs (it adds routing / path matching). I started using Ent to abstract away my database, then switched to Gorm when I got annoyed at having to write so much code just to do inserts / updates and manually having to add / remove rows, but that one falls apart as soon as you have a data structure that maps to more than one level of tables deep.

I mean part of my troubles with databases is probably a disconnect between wanting to store items like whole documents but mapping them onto a relational database.

Re: How I went about learning Rust

#90
post #25

“How” is the stupidest word to auto-censor. Removing it completely changes the meaning of titles. It makes articles seem vapid or banal when they wouldn’t otherwise, and vice versa.

In this case, it changes the title so much that it's not correct English anymore.

It is correct English without "How" but the meaning is different and the usage is not typical.
Post reply on HN