this post was submitted on 10 Feb 2024
126 points (99.2% liked)

Learning Rust and Lemmy

375 readers
1 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 7 months ago
MODERATORS
 

The fediverse is working. I am now following (using Mastodon) a "Learning Rust" community on Lemmy [1], who I found through them commenting on my peertube video [2] using Lemmy.

[1] @learningrustandlemmy [2] https://diode.zone/w/wJJJ7DRh3fCvHq6KuZY3t9

#fediverse #rust #lemmy #peertube

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 5 points 7 months ago* (last edited 7 months ago) (1 children)

Not currently, I don't think. Compare the results of:

curl --location --header 'accept: application/activity+json' https://mastodon.social/@[email protected] | jq .

with the results of:

curl --header 'accept: application/activity+json' https://mastodon.social/@andybalaam | jq .     

The first needs that --location because it just redirects back to lemmy.ml (unlike Lemmy, which has it's own copy for all remote actors).

The second has 2 fields - 'indexable' and 'discoverable' - which probably dictate how searchable you are. The first doesn't have these. If they they were added, it might mean that community activity which had made its way to Mastodon would be searchable.

But we can't add these ('cos we don't have the private keys for the Community) and Lemmy devs are unlikely to add them, 'cos they're meaningless to lemmy (could be wrong, but a lot of potential fediverse interaction is stymied by 'No, you fix your service to work with mine' cat fights)

[–] [email protected] 3 points 7 months ago (1 children)

Thanks, such experiment taught me a trick. And I see that a lemmy user - also followable from mastodon- also lacks those two fields. Maybe it's not so hard to add that info (with an option in settings), but devs have their own priorities, so I suppose the point of this community is that more people learn how to submit PRs for details in lemmy?

[–] [email protected] 3 points 7 months ago (1 children)

Hmm, I'm not sure what the end goal is. More devs would be the ideal I suppose. More people who can respond to questions is good too (I posted a while ago, asking why Lemmy sent an Undo of a Dislike as an Undo of a Like, and people gave their opinions, but it ended up being me who eventually answered the question).

I can't imagine myself ever submitting a PR - aside from my rubbish programming abilities, the GitHub politics of many open-source projects is often the biggest hurdle (taking ages to craft a PR right, for it to be dismissed by a lead dev with an airy "I'm not sure we need this ..." or "Oh, I've solved that problem - and so much more - on my private branch ... [that'll never see the light of day]").

Also, whilst I've seen the suggestion that the front-end is being re-done in Rust, for now it's in NodeJS, and for me it's the UI that needs the most work (erroring, rather than waiting for unknown remote Communities to resolve, stops so many of them from ever taking off). Other UIs are available of course (who handle stuff like this better) but the implosion of Tesseract suggests that anything that isn't the official one will ever get any back-end support - see https://lemmy.world/post/9014308 for evidence of some GitHub drama. Same is true of mobile apps too - Jerboa is arguably the worst, but it's the only one that'll ever be official - and that's a whole different bunch of technologies.

Sorry for such a long reply. I just meant that even if a bunch of us learn Rust from this Community, it won't necessarily lead to a better Lemmy, 'cos knowing Rust is only a small piece of the puzzle.

[–] [email protected] 3 points 7 months ago (1 children)

Sure, I'm also far from being likely to submit PRs, but the potential is there.
About Lemmy UIs , I'm now using Alexandrite - for a better layout of columns etc, easily setup on a local docker.
I'd be surprised if Rust makes sense for UI, but we'll see what they come up with.
It is convenient to use the same language back and front. For my interactive climate model I use scala.js and am happy with that.
So here to learn what rust can do that scala can't (if anything, beyond not needing GC)?

[–] [email protected] 2 points 7 months ago (1 children)

so I'm here to learn what rust can do

Me too. So far for Lemmy, I've done a 'trending communities' bot, an ActivityPub-based AutoMod, and a virtual Lemmy Community that posts stuff from Mastodon. An embarrassingly huge proportion of it is written in Bash - so I'm only just now learning that all variables aren't supposed to be global.

[–] [email protected] 2 points 7 months ago

My personal thinking was that while there'll naturally be large variation in what people will get out of this community and what, if anything, they'll be able to contribute back to the lemmy project ... having the lemmy code base, the fediverse and ActivityPub as projects with generally shared interest and awareness as well as the actual core devs more or less around ... all made sense as a sort of umbrella motivation for applying rust. That the lemmy core devs seem to be rust fans too means that they'd appreciate this place to some extent too.

Of course there's no need for anyone to feel compelled to contribute back to lemmy. I'd personally be happy if I or someone else from here got to that point. But the overriding goal, IMO, is to learn together for sure.

@[email protected]