this post was submitted on 15 May 2024
15 points (100.0% liked)

Learning Rust and Lemmy

231 readers
3 users here now

Welcome

A collaborative space for people to work together on learning Rust, learning about the Lemmy code base, discussing whatever confusions or difficulties we're having in these endeavours, and solving problems, including, hopefully, some contributions back to the Lemmy code base.

Rules TL;DR: Be nice, constructive, and focus on learning and working together on understanding Rust and Lemmy.


Running Projects


Policies and Purposes

  1. This is a place to learn and work together.
  2. Questions and curiosity is welcome and encouraged.
  3. This isn't a technical support community. Those with technical knowledge and experienced aren't obliged to help, though such is very welcome. This is closer to a library of study groups than stackoverflow. Though, forming a repository of useful information would be a good side effect.
  4. This isn't an issue tracker for Lemmy (or Rust) or a place for suggestions. Instead, it's where the nature of an issue, what possible solutions might exist and how they could be or were implemented can be discussed, or, where the means by which a particular suggestion could be implemented is discussed.

See also:

Rules

  1. Lemmy.ml rule 2 applies strongly: "Be respectful, even when disagreeing. Everyone should feel welcome" (see Dessalines's post). This is a constructive space.
  2. Don't demean, intimidate or do anything that isn't constructive and encouraging to anyone trying to learn or understand. People should feel free to ask questions, be curious, and fill their gaps knowledge and understanding.
  3. Posts and comments should be (more or less) within scope (on which see Policies and Purposes above).
  4. See the Lemmy Code of Conduct
  5. Where applicable, rules should be interpreted in light of the Policies and Purposes.

Relevant links and Related Communities


Thumbnail and banner generated by ChatGPT.

founded 8 months ago
MODERATORS
 

We've got two parallel streams going here. One is up to chapter 10 on Traits and the other on chapter 5 on Structs & Enums.

  • How are we feeling about Rust the language?
  • Any persistent confusions or difficulties?
  • Favourite features or success stories?
  • How are we finding "The Book" in general?
    • Personally, I think it's good but not great and am definitely reaching out for other learning experiences or materials, lately finding myself going through the Std Lib Docs a bit
    • Andy Balaam's Rust Tutorial Series over on peertube are also good and I recently remembered to watch them as I go

Otherwise ... any thoughts or requests on what else can happen here for those going through "The Book"?

  • I'm thinking of having posts on sets of chapters once the two twitch streams have gotten up to them.
  • So right now, both have gotten through the borrow checker chapter (ch 4).
  • The idea would be to have a reading club happen here too ... to allow written discussion/questions here for those not able to make the streams (or who like/prefer written discussion), but also to provide a retrospective for those who've gone through the streams.
  • Personally, in these discussions I'd post my understanding of the topic, look back on the quizzes to see what tripped me up, or any other practical issues I ran into, and post anything else I may have found that helped me on the topic. Basically to see what I actually learned from that chapter.
  • Thoughts??
  • Another thing I can think of is challenges and exercises. I tried one a while back, but I think it was too much/long, so smaller exercises would probably work better for getting us thinking/coding in rust. AoC has come up and there are plenty of others. Would regular posts from such a thing be welcome or helpful??
top 10 comments
sorted by: hot top controversial new old
[–] ericjmorey@programming.dev 2 points 4 months ago (1 children)

I've moved on to OdinLang as I don't have a use case for where Rust shines

[–] maegul@lemmy.ml 2 points 4 months ago (1 children)

Huh … interesting! What’s Odin Lang doing that attracted you to it? (I know nothing about it).

[–] ericjmorey@programming.dev 2 points 4 months ago (1 children)

I was looking for something that's not focused on memory safety at the expense of ergonomics. I was looking at Zig but I watched an interview with Odin's inventor. I liked how he was approaching the language development trying use what has been learned from C and C++ but not trying to be compatible with C in the way Zig is.

The ecosystem is very immature compared to Rust and even less mature than Zig. But I want to keep with it for a bit.

[–] maegul@lemmy.ml 2 points 4 months ago (1 children)

Ah right ... makes sense. I don't know how successful languages like Zig and Nim are but it's interesting to see the energy around making a sort of modern C / C++ 2.0.

My feeling around it all, however naive or unworkable, is always that real silver bullet is seamlessly composable features. Where in one ecosystem or "language" you can opt in to a borrow checker, or GC or ref counter or manual mem management, or dynamic or static typing etc ... when and if you please. More and more new languages feels like it might be a dead end at a high level. In this respect, the "idea" of Mojo vaguely made sense to me (I never looked closely at it).

[–] ericjmorey@programming.dev 2 points 4 months ago (1 children)

If Mojo actually becomes libre software, I'll start looking closer. It seems neat from a distance now, but I won't invest energy on proprietary languages.

[–] maegul@lemmy.ml 2 points 4 months ago

Oh for sure ... that's why I haven't looked at closely at all.

[–] Jayjader@jlai.lu 2 points 4 months ago (1 children)
  • I like the idea of having for ex a post per chapter for discussion. It could definitely help liven up the lemmy community, and more importantly would give a chance for everyone who has gotten through the chapter in question to confront their understanding.
  • Challenges and exercises seem like a perfect complement to what's going on so far ... as long as we can find the right scope for them. I worry about how to find challenges that test our Rust skills vs overall problem-solving through programming. Maybe we could ~~steal~~ copy the ones from AoC, LeetCode, CodinGame, etc
[–] maegul@lemmy.ml 1 points 4 months ago (1 children)
  • Do you think it would make sense to have a scheduled time or day during the week (or maybe every 2 weeks) for the post, kinda like a scheduled mega thread?
  • yea it’s challenging to get the right scope. Stealing from common sources, with maybe a bit of curation is probably best, so long as there’s some practicing happening and collaboration. Getting a running schedule for this again can help too I’d think.
  • something else to consider is that it will probably make sense, for those interested, to start digging into code bases (preferably lemmy IMO) in not too long a time. A number of collaborative things could be done here along those lines too. That is down the line though, so I’m just planting the seed (and thinking about it).

How are you going with rust?

[–] Jayjader@jlai.lu 1 points 4 months ago (1 children)
  • scheduling a specific time or day seems less important to me compared to not making people wait longer than they need to, to discuss. I was thinking along the lines of "as soon as both streams have completed a chapter" + eventually "it has been at least x hours/days/weeks since the last discussion post" if we don't want to spread the focus too thin all at once.
  • the schedule should at least force us to proactively adjust the scope of the challenges we set by acting as iterations of the project/activity/thing. We just need to pick a slightly easy challenge to start with, imo, so as to not make the first "iteration" too hard/long.
  • Digging into lemmy is definitely starting to become accessible. I don't know if we want to try doing something collective yet or if we should leave it up to anyone who feels motivated enough to do a first foray and share their experience with us.

Doing pretty great with rust so far on hobby projects. The read through of chapter 4 definitely feels like it helped cement some parts of lifetimes & ownership in my understanding.

[–] maegul@lemmy.ml 1 points 4 months ago

Agreed

The read through of chapter 4 definitely feels like it helped cement some parts of lifetimes & ownership in my understanding.

Yea I had a similar feeling. I haven't been using rust recently (for reasons), but when I got through chapter 4 I was quite happy and somewhat comfortable to just start hacking and looking up or reading about things as I needed them, as the borrow checker definitely seems like the most opaque and painful part of the language (so far!)