Live data from Hacker News

An interactive guide to learning Rust

github.com

31–40 of 55 posts

Re: An interactive guide to learning Rust

#31

Earlier quoted context omitted.

rust compiles to web assembly

What kinds of things could you do with web assembly that you can’t do in native JavaScript? I know very little about web development.

The Unreal engine can be used innthe browsers quite effectively thanks to WebAssembly. It would be impossible to write a modern gam in JS

Re: An interactive guide to learning Rust

#32
post #28

The Go Tour ( https://tour.golang.org ) is an excellent guide to getting started to Go, and I really wish something like that existed for rust. I have no excuse for not being the one to make it (outside of not at all knowing Rust well enough) but I selfishly wish someone would.

https://learning-rust.github.io/index.html https://rustbyexample.com

Right now the second link you posted isn't loading, so I'm not sure if that is something that matches the Go Tour interface (maybe it is, and it's not loading because it's failing to init some virtualized environment for test code to run in?).

My problem wasn't that good documentation wasn't available, it certainly is. The first and second editions of the rust book rust book (https://doc.rust-lang.org/book) are what I read through and they're great.

What I meant was very literal -- I don't know of a site with Go tour's exact (or close to exact) interface, where you can run through ~30/40 slides (that's how long go tour is AFAIK) and write some code right in the browser to get a feel for the language.

Rust is considerably more complex than Go, so I'm not sure it could be so succint, but I can say that at least for me, going through Go Tour really did make me feel more confident in starting a project with Golang.

Re: An interactive guide to learning Rust

#33
post #21

Earlier quoted context omitted.

Give me something that can run ReactDOM.renderToString() faster, and I'm all ears. Until that day (and I'm kinda hoping it comes) I'm a bit stuck.

I'm not very familiar with the React ecosystem but I thought the entire point was letting the client-side handle rendering and passing structured data via API calls? renderToString() sounds like it's doing what every scripting language and templating framework has been doing for the past 20 years?

Look up server-side rendering in React. The major benefits are better/faster first page load experience and better SEO, especially for crawlers that don't have good JavaScript support. This way you can run the same code on the client or server depending on the circumstances.

Re: An interactive guide to learning Rust

#34

Earlier quoted context omitted.

Rust and Go, while really similar, kind of are different in use -- the key differntiator is memory management, and memory safety. For a LOT of applications, this isn't necessary or a big deal (see: just about every program written in a language that isn't c/c++). I see Golang replacing Java longterm and Rust replacing C/C++ (yeah, even C) due to the memory safety and preciseness + speed it offers. It may never be tru…

> I see [..] Rust replacing C/C++ (yeah, even C) To me, the possibility of Rust replacing C is the most interesting aspect of the language. (I'm not sure I see it replacing C++, but maybe competing with it; choose between evolution or revolution!) The general hype around Rust is fascinating to me though. I assume it's mostly driven by former C/C++ programmers, but the process has been noisy enough to attract attentio…

I think the hype around rust is actually pretty well warranted though -- people got really excited about Go and Rust because they were new "systems" languages, and the world hasn't really seen one of those in a while. "systems language" is a pretty vague term, but one of the things I think is important is that memory be manually managed -- I think most people would agree with that.

I think Rust is interesting to the people already using non-GC languages is precisely because it offers the speed of C/C++ with LESS of the footgun aspect. Writing C/C++ is accessible and familiar, but it is far from simple, there are tons of pitfalls. Rust has less of those, and takes a modern approach to much of it's toolchain bits and ergonomics.

> I'm a Rust newbie and haven't benchmarked anything, but the sense I get from the docs is that it theoretically can be as fast depending on how much you limit yourself. Kinda like how C++ can be as fast as C, if written with care.

Almost axiomatically, if Rust could be built 100% with ONLY zero cost abstractions, then it could certainly be as fast as C. Concretely, I don't think that's possible, because usually abstractions will cost you something even if it's just a single extra function call redirection. However, you can definitely get to a point where the difference is negligible, and the downsides (maintainability taking a nosedive) make the tradeoff worth it.

I think if you were to compare rust and C overhead in terms of function calls, slices and the like , you'd just be comparing compilers and micro optimizations implemented in both. I think it's kind of hard to test for the things that really make rust shine -- it's all the time you DON'T spend on race condition bugs, and the time you DON'T spend debugging pointer issues.

Re: An interactive guide to learning Rust

#35
post #13

I know that this is irrelevant, but is it worth the trouble to learn an esoteric language such as Rust? For me it seems a waste of time to learn a language along with its ecosystem where there are few job prospects. Right now Go seems to be on an upward trajectory, and despite its ugliness and how primitive it is, it is the job which can pays off when hunting for jobs.

I've been casually following rust for ~5 years now, but finally decided to really put in the effort to learn in in the past several months. It's definitely a slog to really "get" the Rust mindset (as well as learn the various sharp corners of the borrow checker and lifetime systems), but I think it has made me a better programmer.

To write Rust you have to be very conscious of how you're sharing data between functions, structs, and threads. This is a common source of bugs even in GC languages, so working with a compiler that will point out your mistakes teaches you how to avoid such issues in other, less prescriptive languages.

I also think rust is a lot of fun! I haven't had a chance to use it professionally yet, and it doesn't seem to have made much impact in industry yet, but I think it will get there. Right now it's pretty hard to write networked services (the main market for Go it seems), but that will get a lot better this year as libraries mature and async/await is stabilized.

Re: An interactive guide to learning Rust

#36

Earlier quoted context omitted.

Rust and Go, while really similar, kind of are different in use -- the key differntiator is memory management, and memory safety. For a LOT of applications, this isn't necessary or a big deal (see: just about every program written in a language that isn't c/c++). I see Golang replacing Java longterm and Rust replacing C/C++ (yeah, even C) due to the memory safety and preciseness + speed it offers. It may never be tru…

> Knowing X language isn't what makes a good developer, it's knowing some sufficiently multi-paradigm langauge ... True enough as far as it goes. But in practical terms, as platforms have multiplied in number and increased in surface area, being a useful and/or marketable developer means in-depth knowledge of specific platforms. It's much harder to spin up quickly on a platform than a mere language. However well you…

I agree with that point, except for two minor things:

- mobile development in particular is the worst possible case of this. mobile platform companies are in the best case optimized only for their own case, and in the worst case maliciously trying to create developer walled gardens. However, I would point out that knowing one of these often helps in knowing the other (Android vs iOS) -- there are often 1:1 concepts that map over, because in the end what you want to do is very much the same, and the way the platforms have modeled how to do certain things is often similar.

- AWS is not really a programming language, even if you could CloudFormation templates, which surely will be turing complete if they aren't considered to be already. "Familiarity with aws" roughly equals "familiarity with deploying an application to managed remote servers", which is orthogonal (IMO) to pure application development, but is increasingly a required skill.

I do agree that being a convincing generalist is difficult, and I think this is why generic `Backend Developer` or `Software Engineer` positions often pay more than `Mobile developer` or `Frontend Developer` positions (at least in my experience they have). This is also why people try to hire for "smarts" in interviews rather than just testing language/syntax knowledge -- generalists make for better cogs ("are more fungible" would be the nicer way to say it I guess).

Re: An interactive guide to learning Rust

#37
post #15
post #13

I know that this is irrelevant, but is it worth the trouble to learn an esoteric language such as Rust? For me it seems a waste of time to learn a language along with its ecosystem where there are few job prospects. Right now Go seems to be on an upward trajectory, and despite its ugliness and how primitive it is, it is the job which can pays off when hunting for jobs.

https://trends.google.com/trends/explore?q=java,golang

java query include jav full hd

Re: An interactive guide to learning Rust

#38
post #28

Earlier quoted context omitted.

https://learning-rust.github.io/index.html https://rustbyexample.com

Right now the second link you posted isn't loading, so I'm not sure if that is something that matches the Go Tour interface (maybe it is, and it's not loading because it's failing to init some virtualized environment for test code to run in?). My problem wasn't that good documentation wasn't available, it certainly is. The first and second editions of the rust book rust book ( https://doc.rust-lang.org/book ) are wha…

Not sure why it isn't loading, but to get an idea it's pretty much literally gobyexample.com for Rust.

Re: An interactive guide to learning Rust

#39
post #28

The Go Tour ( https://tour.golang.org ) is an excellent guide to getting started to Go, and I really wish something like that existed for rust. I have no excuse for not being the one to make it (outside of not at all knowing Rust well enough) but I selfishly wish someone would.

https://learning-rust.github.io/index.html https://rustbyexample.com

I believe that second link is now at https://doc.rust-lang.org/rust-by-example/

Re: An interactive guide to learning Rust

#40

Earlier quoted context omitted.

> Knowing X language isn't what makes a good developer, it's knowing some sufficiently multi-paradigm langauge ... True enough as far as it goes. But in practical terms, as platforms have multiplied in number and increased in surface area, being a useful and/or marketable developer means in-depth knowledge of specific platforms. It's much harder to spin up quickly on a platform than a mere language. However well you…

I agree with that point, except for two minor things: - mobile development in particular is the worst possible case of this. mobile platform companies are in the best case optimized only for their own case, and in the worst case maliciously trying to create developer walled gardens. However, I would point out that knowing one of these often helps in knowing the other (Android vs iOS) -- there are often 1:1 concepts t…

You're entirely right insofar as (eg) an Android developer will learn iOS far faster than someone without mobile (or any other ui kit) experience. But the specifics are different enough such that it's hard to do both to a high level. Or perhaps I'm just speaking for my own limitations -- I do iOS & Android (native & a bit of react native), but I'm definitely less of an expert with either (or the various server things I also do) than I would be if I specialised.

I was offering AWS as an example of another platform rather than a language. If you're called on to (for example) implement a bunch of microservice type stuff, there's quite a bit to learn about RDS/dynamo/lambdas/IAM etc, and then all the quite complex deployment stuff to make it truly production ready.

I think in all these cases, the language is a relatively trivial component. I generally can get quite productive in a new language (that isn't greatly paradigmatically different, ie. allowing for exceptions like Haskell, Rust etc) in a couple of days to a week. A new platform? More like weeks to months.

Post reply on HN