Live data from Hacker News

A half-hour to learn Rust

fasterthanli.me

321–330 of 342 posts

Re: A half-hour to learn Rust

#321
post #212

This is precisely what I was looking for when I searched for “Rust for C++ programmers” in the past. I love the Rust book, but I’ve always thought the common focus on accessibility for newbie programmers made it feel tedious for those who are more seasoned. I’d love to see more writing like this, maybe even for other things like libraries!

I've found it's generally really tough to find guides for getting into new languages that are written for experienced programmers who don't know that language yet. Everything seems to be written for complete newbies, or be a dense reference that assumes you know almost everything already. It's a bit annoying, but not much to do except slog through the guides and try to write a few programs.

Psst, check out this one[1], It's exactly what you're looking for. Pretty much for any language.

[1] https://learnxinyminutes.com

Re: A half-hour to learn Rust

#322
Rust is a language that just doesn't go into my head. And whenever I have a question the community either downvotes or ignores me. The readability is bad. The error messages don't make sense. This type of post only covers the syntax basics. There's nowhere to turn to for applied concepts.

It's like Ultima Online back in the day. Everyone loved it but every time I tried i fell asleep and just couldn't get into it.

I'm semi happy with Go. It's a hands on language that is fast enough. But it's missing elegance and something I can't put my finger on is missing.

But Rust, it feels like a step back. What do I think in? Boxes? Wrap unwrap move what? It's so hipster I just hate it. And compilation takes a lot of resources and time. Hell, Java makes more sense to me than Rust.

And why all those macros? And impl for order is backwards. Why couldn't the word class be used, no they just want to be different for the sake of being different. It's a language for hipster rebels without a cause.

Re: A half-hour to learn Rust

#323

Earlier quoted context omitted.

"Rust makes hard things easy and easy things hard." Disagree here. Like article Rust 2018 is very nice and ergonomic. Iterators, Lifetime Elision etc are nice to work. Regarding noise many people consider those noise but I find noises like return types etc very useful. Because I can be sure the return type. Regarding actual code actix doesn't look that bad from examples also. I use warp and its pleasant to work. The…

I'm a recent Rust fan (via AoC), but for "easy things hard", I would offer input/string processing as an example— regexes, string operations, grammar, etc. I know that Rust is forcing me to be correct and handle (or explicitly acknowledge that I'm not handling) my error cases, but from the point of view of just wanting to get the happy path working, it's a lot more noise to deal with compared with what it would look…

See this is what I'm talking about. This is ridiculous.

Re: A half-hour to learn Rust

#324
post #319
post #312

Earlier quoted context omitted.

An hour isn’t enough to use it on real world use, am I not right?

Correct, but the comment you responded to ended with "And the love lasts for a long time." This suggests experience far more than a single hour, does it not?

Sounds like a contradiction to me that he said it he only had it for 1 hr. Anyway, I'm not here to argue semantics. Not gonna reply anymore.

Re: A half-hour to learn Rust

#325
post #312

Earlier quoted context omitted.

An hour isn’t enough to use it on real world use, am I not right?

One way to read your comment, which I think the way others are reading it, is “you only like rust because you haven’t used it much, try it more and you won’t like it anymore.” The implication being that only people who haven’t used Rust can like it. That may not be what you meant but it seems like that’s what people are understanding.

An honor to have Steve Klabnik himself responded to me. Thank you for your amazing work for the Rust community and the books as well. I'm a Rust hobbyist, I'm just trying to be objective, especially since majority of my day job doesn't involve Rust, and for sure my team mates refuse for me to introduce small bits of Rust code here and there, because of unknown territory.

Re: A half-hour to learn Rust

#326
post #309
post #161

As a Python programmer with limited experience with compiled languages, Rust code was more intimidating to read or look at than C++, Java or Go. After only an hour, I am overwhelmed by the sheer beauty and mature design of this language - it almost reads like Python or as well as any compiled language can. I cannot believe that I am smitten by Rust within an hour. Its features seem, obvious. My experience with Go was…

I know it’s pedantic but I despise the semicolons in Rust. They make the language ugly and constantly burden the programmer unnecessarily. It’s a bizarre choice for such a modern language.

I find my own JS code easier to read since I dropped them, and my tired eyeballs no longer need to lex the ";" pattern. Yet some JS masters (Mike Bostock) include them religiously.

Semi-colons do make make possible multiple statements on a single line -- but surely there's a stronger rationale than that.

Re: A half-hour to learn Rust

#327
post #309

Earlier quoted context omitted.

I know it’s pedantic but I despise the semicolons in Rust. They make the language ugly and constantly burden the programmer unnecessarily. It’s a bizarre choice for such a modern language.

I find my own JS code easier to read since I dropped them, and my tired eyeballs no longer need to lex the ";" pattern. Yet some JS masters (Mike Bostock) include them religiously. Semi-colons do make make possible multiple statements on a single line -- but surely there's a stronger rationale than that.

Python allows semicolons for separating multiple statements on a single line, even though it doesn't require them otherwise. (Those statements can't have blocks, because of the indentation-based syntax, but that's a separate issue.)

Re: A half-hour to learn Rust

#328

For anyone curious what a Go version of the same article would look like (as I was), I tried to answer that question by writing https://dmitri.shuralyov.com/blog/27 .

This is beautiful. Thanks for sharing. Pls post a separate thread (if not done already).

Re: A half-hour to learn Rust

#329
post #212

This is precisely what I was looking for when I searched for “Rust for C++ programmers” in the past. I love the Rust book, but I’ve always thought the common focus on accessibility for newbie programmers made it feel tedious for those who are more seasoned. I’d love to see more writing like this, maybe even for other things like libraries!

I've found it's generally really tough to find guides for getting into new languages that are written for experienced programmers who don't know that language yet. Everything seems to be written for complete newbies, or be a dense reference that assumes you know almost everything already. It's a bit annoying, but not much to do except slog through the guides and try to write a few programs.

Very well said. Totally agree with this point. I experience the same.

Re: A half-hour to learn Rust

#330

Earlier quoted context omitted.

Bignum arithmetic actually is pretty simple in Rust if you use the right library. Rug[0] makes using bignums look almost just like using native numbers through operator overloading. [0] https://crates.io/crates/rug

The operator overloading is nice but you still get smacked in the face right away by the borrow checker. Simple stuff like this won't compile ("use of moved value"): let a = Integer::from(10); let b = a + a;

  let b = &a + &a;
will work, but I agree it's unfortunate that this is necessary.
Post reply on HN