this post was submitted on 04 Mar 2024
742 points (97.9% liked)

Technology

59428 readers
2858 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] SorteKanin@feddit.dk 3 points 8 months ago* (last edited 8 months ago) (1 children)

You have to fight Rust a lot to build anything complex

nutomic, one of the main Lemmy devs, didn't know Rust before he started working on Lemmy. He just started working on Lemmy and learned Rust in the process. The difficulty of Rust is exaggerated.

[–] thundermoose@lemmy.world 3 points 8 months ago (1 children)

Hyperfixating on producing performant code by using Rust (when you code in a very particular way) makes applications worse. Good API and system design are a lot easier when you aren't constantly having to think about memory allocations and reference counting. Rust puts that dead-center of the developer experience with pointers/ownership/Arcs/Mutexes/etc and for most webapps it just doesn't matter how memory is allocated. It's cognitive load for no reason.

The actual code running for the majority of webapps (including Lemmy) is not that complicated, you're just applying some business logic and doing CRUD operations with datastores. It's a lot more important to consider how your app interacts with your dependencies than how to get your business logic to be hyper-efficient. Your code is going to be waiting on network I/O and DB operations most of the time anyway.

Hindsight is 20/20 and I'm not faulting anyone for not thinking through a personal project, but I don't think Rust did Lemmy any favors. At the end of the day, it doesn't matter how performant your code is if you make bad design and dependency choices. Rust makes it harder to see these bad choices because you have to spend so much time in the weeds.

To be clear, I'm not shitting on Rust. I've used it for a few projects and great for apps where processing performance is important. It's just not a good choice for most webapps, you'd be far better off in a higher-level language.

[–] SorteKanin@feddit.dk 1 points 8 months ago

I really disagree, I think Rust's excellent error handling and reliability is paramount to any software project and it's very useful for web apps as well. Besides, for a web app you rarely need to go for any of those things you mentioned (i.e. Arcs and mutexes and such).