Live data from Hacker News

Why I love Rust

speakerdeck.com

71–80 of 159 posts

Re: Why I love Rust

#71
post #34

Earlier quoted context omitted.

This is good advice. I am totally confused by the Rust vs Go debate. They occupy such different spaces.

I think the reasoning behind the debate is that, together , they mostly obsolete C/C++. Go takes the high-end and Rust takes the low-end, and there's no niche left for C to occupy in the middle. I guess the real answer is, if you want to learn "the language that people will be using instead of C in ten years"... learn both of them.

"together, they mostly obsolete C/C++. Go takes the high-end and Rust takes the low-end"

In that case some one just code "GoRust" language ^_^

Re: Why I love Rust

#72

Earlier quoted context omitted.

Speaking as someone who has used both languages, I think you should learn both if you can. Rust will give you experience with low level systems programming (memory management, parallelism, etc.) Go will give you experience with network-facing backend code. Both languages will teach you concurrency. Go is significantly more popular than Rust. But if what you want to learn is a popular language, you shouldn't be lookin…

This is good advice. I am totally confused by the Rust vs Go debate. They occupy such different spaces.

Because we have weird memories we all still remember Go claiming to be a systems programming language, which everyone took to mean "programming language you would use when you need to talk to metal" but which A) Go isn't suited for B)Rob Pike decided meant "programming language you would use to when you need to write a program"

Rust sort of went public around the same time as Go which automatically "made it" a competitor AND actually is a programming language you would use when you need to talk to metal.

So now people have tied them up in a PR battle.

Re: Why I love Rust

#73
post #50

Earlier quoted context omitted.

Disclaimer: I say this having spent much of last year learning Go and the last couple months learning Rust. I'm a big fan of both languages. I see Go as my go to language for more situations right now, but I think that once Rust has matured a bit more, I'll choose it for more and it will probably become more useful to me than Go. I doubt I'll ever get to the point where I'd choose it for everything over Go, but I can…

> 3-4 months into programming Rust and you may just be getting past the phase where it takes you 10 minutes of fighting the borrow checker to get relatively simple code to compile. This exactly is why I can never get past the first couple weeks of playing with Rust. Every few months I revisit it and every couple weeks after that I put it aside again. When I was first learning C++ I spent a huge amount of my time insi…

I'm always interested in trying to figure out how to explain these things better, if you ever want to vent some frustrations at someone :)

  > bury Rust's borrow checker for those parts of an application
The problem with that is, if you did, you're back to

  > I spent a huge amount of my time inside the debugger trying
  > to figure out why a pointer wasn't ... pointing.
What I can say is that after you get over the hump, the borrow checker isn't really a big deal. Or rather, it _is_ a big deal, but when it errors, I know it's caught a bug for me, and I can just fix it without much effort. Small comfort for those before that point thought :/

Re: Why I love Rust

#74

I want to spend at least 3-4 months learning a new language but just can't figure out if I should spent time learning Rust or Go. I am thinking more of it from a career perspective than interest.

While I'm bullish on Rust being a big language in the next few years, there's not much production use yet -- it's still pretty immature from a production tooling point of view. Go, on the other hand, has a lot of adoption. So if you're looking for a language to use on the job today, it's gonna be Go.

  > there's not much production use yet
I can't wait for a few weeks, when Dropbox should hopefully be giving a status report on how their new production deployment is going.

Re: Why I love Rust

#76

I want to spend at least 3-4 months learning a new language but just can't figure out if I should spent time learning Rust or Go. I am thinking more of it from a career perspective than interest.

I actually think you'd go far to spend 3 - 4 months learning C++. Almost every language you can likely encounter in your career will use some feature that will get introduced to you in C++, especially modern C++, and, almost any language will be easier to learn and use after first going through a C++ learning curve. Besides, C++ is still the big player, more than all others. Even Apple's new language Swift is written…

I think that is a great answer. I actually see some parallels between the relationship of Rust/C++ to Scala/Java. Both basically use the backend of the established language and provide an 'improved' language on top of it. Scala uses the JVM, and Rust uses LLVM.

What is interesting is that with the release of Java 8, a lot of Scala early adopters and cutting back their investment in Scala in favor of Java (for exampled LinkedIn). This is despite the fact that Scala is widely used in production, has a killer app in Spark, and allows pretty seamless use of the Java library.

Now compare this to Rust. Rust also provides an 'improved' language in the same space as C++ utilizing LLVM. However, what is interesting is the nature of the improvements. The biggest feature of Rust is the memory safety. However, the memory safety is not a productivity improvement as more of a safety improvement. Unlike garbage collection where you just do not have to think about memory allocation issues, Rust forces you to think about ownership and mutability. That same exact thinking will allow you to pretty much get the same memory safety in C++ using unique_ptr and shared_ptr and const. The difference is that the compiler makes you think about it in Rust. Much like Scala inspired the adoption of features for Java, you can see C++ adopting pretty much the borrow checker as a tool - see Herb Sutter's talk at CppCon 2015 - https://www.youtube.com/watch?v=hEx5DNLWGgA .

As the experience with Scala shows, the adopted features of the established language do not have to perfectly match the 'improved' language to convince people to migrate back to the established language. The adopted features just have to be in the ballpark. I think the new C++ tooling will be in the ballpark in much the same way that Java 8 is in the same ballpark as Scala and remove much of the impetus for moving to Rust from C++.

In addition, Rust is not as well positioned as Scala. Scala is actually deployed in production and has a killer application. Rust has no major production deployments of which I am aware and no killer application (the equivalent of Spark). In addition, while Rust can interface with C libraries, Rust cannot interface with C++ libraries unlike Scala which can interoperate with the Java standard library.

Rust has some brilliant aspects just like Scala has some brilliant aspects. However, C++ (like Java) is not sitting still but has been incorporating the best ideas. In addition, when people choose a system language, they are inherently conservative because the system they are creating will typically be long lived and mission critical. If you are writing something that you hope will power your company for the next 20 years, do you want to go with a language created and driven by Mozilla with no major use in production, or with the language that powers Google, Microsoft, Apple, and Facebook?

Here is what I recommend. Learn C++11/14/17. Learn Haskell to really open your mind to what is possible. Learn Rust to learn about the borrow checker. Then apply what you have learned to make yourself a better C++ programmer. Some of the best, most insightful C++ programmers I know are people who are actually well-versed in other languages, especially functional programming languages.

Re: Why I love Rust

#77

I want to spend at least 3-4 months learning a new language but just can't figure out if I should spent time learning Rust or Go. I am thinking more of it from a career perspective than interest.

You'll probably learn more if you choose Rust, but from what I've seen, way more companies use Go at the moment (since you mentioned this was from a career perspective).

Re: Why I love Rust

#78
post #34

Earlier quoted context omitted.

This is good advice. I am totally confused by the Rust vs Go debate. They occupy such different spaces.

I think the reasoning behind the debate is that, together , they mostly obsolete C/C++. Go takes the high-end and Rust takes the low-end, and there's no niche left for C to occupy in the middle. I guess the real answer is, if you want to learn "the language that people will be using instead of C in ten years"... learn both of them.

As someone in the games industry, I don't see anybody moving towards either of these languages over C++, or really even any excitement over them. I'd be very surprised if Rust displaces C++ here, and put the chance of Go doing so at pretty much 0.

If anything, the current trend is moving more low level (rather than higher level, which these languages both are), as techniques like data oriented design becoming more mainstream.

Re: Why I love Rust

#79

Earlier quoted context omitted.

This is good advice. I am totally confused by the Rust vs Go debate. They occupy such different spaces.

Because we have weird memories we all still remember Go claiming to be a systems programming language, which everyone took to mean "programming language you would use when you need to talk to metal" but which A) Go isn't suited for B)Rob Pike decided meant "programming language you would use to when you need to write a program" Rust sort of went public around the same time as Go which automatically "made it" a compet…

I think there was the added wrinkle of "programming language made by the company that also makes Chrome" vs "programming language made by the company that also makes Firefox". Google's and Mozilla's browsers were/are competitors, so why wouldn't there programming languages be? Obviously, the two companies have completely different reasons for the development of the new languages, but I think that was overlooked at the time that Rust first came out.

Re: Why I love Rust

#80
post #71
post #34

Earlier quoted context omitted.

I think the reasoning behind the debate is that, together , they mostly obsolete C/C++. Go takes the high-end and Rust takes the low-end, and there's no niche left for C to occupy in the middle. I guess the real answer is, if you want to learn "the language that people will be using instead of C in ten years"... learn both of them.

"together, they mostly obsolete C/C++. Go takes the high-end and Rust takes the low-end" In that case some one just code "GoRust" language ^_^

Nah, just use CGo to link to a lower-level Rust library :)
Post reply on HN