
An interactive guide to learning Rust - Toidiu
https://github.com/toidiu/learn-rust
======
gutem
A good resource is: Rust by Exmple - [https://doc.rust-lang.org/rust-by-
example/](https://doc.rust-lang.org/rust-by-example/)

------
hardwaresofton
The Go Tour ([https://tour.golang.org](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.

~~~
spease
[https://learning-rust.github.io/index.html](https://learning-
rust.github.io/index.html)

[https://rustbyexample.com](https://rustbyexample.com)

~~~
hardwaresofton
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](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.

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

~~~
steveklabnik
It's not loading because I set up a redirect to its new home,
[https://doc.rust-lang.org/rust-by-example/](https://doc.rust-lang.org/rust-
by-example/), and it seems to work for some people, but not for others. I'll
have it fixed sometime soon.

------
2_listerine_pls
What's the relevance of learning Rust for someone into web development?

~~~
OtterCoder
As a web developer, you can write servers that take orders of magnitude less
space, memory, and CPU than a similar JS server, without having to deal with
the madness that is first-time C development.

~~~
nobleach
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.

~~~
v_lisivka
[https://github.com/DenisKolodin/yew](https://github.com/DenisKolodin/yew)

~~~
nobleach
This does look interesting. I don't see a difference between this and any
other server-side templating language though. I actually need an isomorphic
representation on the client and server. (this is what makes renderToString()
valuable) I guess I could be extremely careful in writing the server output,
and writing the client output to match, but at that point, I'd be writing it
twice... and I could use any language... unfortunately, it'd probably end up
being Handlebars.

~~~
v_lisivka
It's for client side, not for server side. It's compiled into Wasm and
delivered to client. You can use same code for server-side pre-rendering (for
faster loading or for search engine indexing), but it is not main goal of Yew.

------
aviaro
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.

~~~
hardwaresofton
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
truly C speed, but from where I stand the tradeoff is worth it (and when it
becomes NOT worth it, rust/c interop is SUPER easy).

While I like Rust a lot, I think it's definitely not the language to learn if
you want a job _right now_. If you want a job right now, go learn Java.
Unfortunately, depending on the company you go into, you can basically throw
away the next X years of your life working with uninsteresting/stagnant
codebases, unmotivated peers, and clueless management -- OR you'll find
companies that are using Java in a progressive way.

If you want to invest in a language that will likely become a big player in
the next 10 years, and is soundly written, maintained and progressed in the
open, then commit to rust.

Also a sidenote, most good managers/engineers realize that syntax doesn't
actually really matter. Good engineers get up to speed in languages they've
never used in days/weeks -- if you know the paradigms, and how to design good
programs, it's a matter of just changing what you type.

Knowing X language isn't what makes a good developer, it's knowing some
sufficiently multi-paradigm langauge X well enough that you've moved past the
basics and started re-discovering paradigms, design patterns, and answers to
problems in a few problem domains.

~~~
jkarneges
> 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 attention from the general developer community? If anyone wanted a
non-GC language, C++ has been here since forever and is still being worked on.
But Rust has somehow made non-GC seem cool?

> It may never be truly C speed, but from where I stand the tradeoff is worth
> it

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.

It would be great to see a write-up comparing Rust and C overhead, e.g.
cpu/memory overhead of function calls, slices, etc.

~~~
hardwaresofton
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.

~~~
whyever
> "systems language" is a pretty vague term, but one of the things I think is
> important is that memory be manually managed

Go does not let you manage memory manually.

~~~
hardwaresofton
You're absolutely right -- I didn't think I had to re-state that here since
it's like the second sentence of the original comment. That's also why I went
into qualifying "systems" language, some might consider golang a systems
language, even though it very much does not allow manual memory management,
which is why it's vague (and I put it in quotes).

