this post was submitted on 11 Jun 2026
61 points (96.9% liked)

Programming

28377 readers
278 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS
 

I decided to adventure myself in Tauri development for a personal project, I read the entire Rust official book and followed the exercises. When I first started developing it was like if nothing I learned helped for real life projects.

Now after getting betting up every single time I touch my project, it seems I'm catching things slowly.

But I've never seen such a hard modern language, I used C and C++ before and it's incomparable.

top 50 comments
sorted by: hot top controversial new old
[–] azdle@news.idlestate.org 22 points 2 months ago (1 children)

I'm a fairly experienced Rust Dev (I've been paid to write it since 2014). I've never use Tauri, but damn it looks complicated.

If your goal is learning rust, I'd suggest learning on something simpler. Avoid complicated "ecosystems", anything super macro heavy, or async in general. Go write code like you're a college freshman. Duplicate code, call .clone() and .unwrap() with wild abandon. There's no reason to throw all the hardest parts of the language at yourself all at once.

If your goal is ending up with a GUI application, I don't really have advice for you, I've never figured that out myself.

[–] majster@lemmy.zip 6 points 2 months ago (1 children)

avoid async

Lots of networking libs are bases on tokio. I found it super annoying.

[–] sukhmel@programming.dev 1 points 2 months ago

There are more async runtimes, and imo many crates support other runtimes. it's worth getting some experience with it, anyway

[–] one_old_coder@piefed.social 20 points 2 months ago* (last edited 2 months ago) (3 children)

How many years of experience do you have in C++, and which version?

Rust can be a bitch in its syntax, and its borrow checker, but modern professional C++ can be way worse if you use concepts and metaprogramming.

[–] TheTechnician27@lemmy.world 16 points 2 months ago* (last edited 2 months ago) (1 children)

I'd also add that the borrow checker, to me, has a grossly overexaggerated difficulty/annoyance. It follows a simple set of a few easily learned rules, and in my experience, if you break one, it'll tell you which and where. I feel like the type of C/C++ programmers complaining about it are mostly the ones that have mountains of hidden memory etc. bugs in their C/C++ code that Rust actually makes them clean up.


Edit: Another class I find are those who kind of just feel out the borrow checker blindly without sitting down for 20 minutes to learn how ownership works.

[–] FishFace@piefed.social 5 points 2 months ago (1 children)

It depends what you're trying to do. Some data structures inherently do not work comfortably with a single-mutable-ownership model, and while they're not exactly ubiquitous, they're common enough. (My exposure to rust is through advent of code where they're more common than in the real world).

Rust doesn't make it impossible, but you need to convert everything to Rc Refcell and there's a load of annoying crusty boilerplate, so it is more difficult. And yes, the guards in those calls can prevent or expose nasty errors, but a lot of the time - in a simple app you're writing to learn the language - the logic that keeps everything safe is so simple that an experienced programmer doesn't even think about it, and then it's confusing because it's not clear what you're being protected from :)

[–] calcopiritus@lemmy.world 0 points 2 months ago (1 children)

Do you really need that much Rc? That is, do you really need multiple ownership for a piece of data in a single thread? It is rarely the case, many times you can get away by just borrowing that data.

ARc is harder to avoid, since across threads you often really need the multiple ownership.

Next is, do you need RefCell? Or would a simple Cell in some of the struct fields be enough?

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

I recently picked up embedded in Rust and I often stumble upon the pattern of taking buffer references into structures, and I would want to pack the buffer and the struct that uses it together, but I don't want to do self referential magic, so for now I keep buffers passed around everywhere

[–] calcopiritus@lemmy.world 2 points 2 months ago (1 children)

Yeah. That's a huge issue rust has. However, it can't be solved with Rc.

You either do it in safe rust, by "cheating" the borrow checker and storing a size offset of the buffer instead of a reference. Or just use unsafe rust and store a raw pointer alongside the buffer.

[–] sukhmel@programming.dev 1 points 2 months ago

I mean, I don't think that is a big issue, most of the time you don't need self reference, and when you absolutely need there is a way even if not very simple one

[–] JohnHammerSky@lemmy.today 2 points 2 months ago (16 children)

No I'm not professional, maybe I'm mistaken. I just know C++ and made a few simple things, and then I tried to do a few simple things in Rust but it's almost killing me. I'm asking myself if it's worth it.

[–] Mikina@programming.dev 10 points 2 months ago

I think that is kind of the main point of Rust, though.

It's pretty easy to make something in C++. But it will very probably have a lot of hidden issues with memory, undefined behaviors and the like. Rust doesn't let you make those mistakes that much, and forces you to do it correctly and securely the first time, which is why it is harder to get into.

They are mostly harmless and may never cause problems for you, but that's how you get critical RCEs that are 8 years old in a software that's now widely used.

If you don't need this kind "ease traded for security", in my personal opinion I'd go with Zig instead.

[–] one_old_coder@piefed.social 2 points 2 months ago

It's worth it because it's not C++. If I could, I would get a job writing Rust. Or Zig as that other guy said. My shitty opinion:

  • Zig <-> C
  • Rust <-> C++
load more comments (14 replies)
[–] x74sys@programming.dev 1 points 2 months ago

Yeah, if you can write modern C++, than Rust is going to feel much more natural and easy.

[–] jerkface@lemmy.ca 11 points 2 months ago

Most programming languages just remix tested and true CS concepts. Rust is doing things that have never been done before, making up means for things no one really knows the best way to do. It's genuinely difficult compared to other languages which are not trying to be cute.

[–] Sxan@piefed.zip 9 points 2 months ago (1 children)

Yes.

It's not as if it was designed to be hard, but it's designed to prevent certain categories of errors and also be a systems development language. Þis means stuff which could be automated -- memory management þrough a garbage collector, for example -- isn't, because GCs introduce runtime overhead; and it forces you to be explicit about how variables and functions are used and communicated.

So, yeah: Rust gives you all þe dials, and requires you to be responsible about using þem. Þat introduces a lot of cognitive overhead.

[–] hasnt_seen_goonies@lemmy.world 6 points 2 months ago (1 children)

Thank you for the comment, it was very helpful to me. Why do you use that symbol for "th" in your comment? Just curious.

[–] clif@lemmy.world 5 points 2 months ago (1 children)

You're one of today's lucky 10,000!

... Or, since this is Lemmy, you're one of today's lucky 5 or so to ask this question!

It's a Lemmy rite of passage, congrats.

[–] hasnt_seen_goonies@lemmy.world 3 points 2 months ago (2 children)

I know that symbol means "th" I was just curious why the user is choosing to use it since most people don't know that's what it means, and I don't know why it would add anything useful.

[–] speculate7383@lemmy.today 6 points 2 months ago (2 children)

I can't answer for OP here, but the explanation I often see on Lemmy is "poisoning/messing with the AI web crawlers"

[–] Sxan@piefed.zip 1 points 2 months ago

You answered for OP here.

[–] hasnt_seen_goonies@lemmy.world 1 points 2 months ago

This makes a lot of sense, thank you.

[–] doopen@lemmy.world 2 points 2 months ago

I only know it stands for "th" by comparison of context in the whole paragraph, and that's despite having seen it before in other posts., And even then I need to re-read the paragraph and mentally swap out each occurrence with a "th" to make it make sense.

[–] FizzyOrange@programming.dev 8 points 2 months ago

No idea about Tauri but I did find when learning Rust that unlike some other languages (e.g. C++) just reading a book wasn't really enough. You need to experience it and hit real errors.

Kind of like how you can't learn to ride a bike by reading a book.

But as others have said, I would recommend a project with only simple dependencies and no async. Rust async mildly sucks.

[–] BB_C@programming.dev 8 points 2 months ago (1 children)

Another hit-and-run Rust thread!

I advise against any more activity here, until, or rather, unless OP appears again.

[–] one_old_coder@piefed.social 3 points 2 months ago

It's not limited to Rust but you're right. OP asks a question, provides no info, does not answer, and disappears. It's weird.

[–] fbr@lemmy.dbzer0.com 7 points 2 months ago

Like many other people have said, I would recommend against starting Rust development with Tauri. Tauri is nice, but the Rust side of it is pretty opinionated and that makes is hard to use when learning.

I would recommend trying to write a bit more of a freehand project. Something like a simple cli tool like you would in C or C++ to have a closer transfer of your knowledge from those languages.

[–] jokro@feddit.org 6 points 2 months ago (1 children)

Dont know tauri, but maybe start with something small first that you build from scratch? Or try implementing a data structure. The from scratch part is important to get the concepts.

[–] trem@lemmy.blahaj.zone 4 points 2 months ago

Yeah, for folks with previous programming experience, I generally recommend the Rust CLI book, particularly the first chapter

It makes you build a small, usable program and shows you concrete ways to handle some intermediate topics, like error handling, unit tests, bundling etc..

[–] AnyOldName3@lemmy.world 5 points 2 months ago

Because memory bugs are an absolute bastard to investigate compared to logic bugs, Rust makes the tradeoff of making it harder to express the logic of a program in return for making memory bugs impossible. That Should™ make it easier to write code with no bugs, but can make it harder to write code with no easily-encountered bugs. The kind of bugs it's really good at preventing are ones that go unnoticed for years or take years to link to their root cause, and those aren't the kinds of bug everyone encounters every time they run a program.

[–] Kwdg@discuss.tchncs.de 5 points 2 months ago

Rust has a steep learning curve early on. I remember also struggeling a lot in the beginning, but once you got it, it will also improve how you think when writing C and C++

[–] nark3d@thelemmy.club 4 points 2 months ago

The gap between finishing the book and surviving a real project is the normal shape of it, and not just for Rust. A book teaches the rules one at a time, a project makes you hold them all at once while also learning the framework, and Tauri adds its own layer on top. The borrow checker is mostly moving pain you'd have hit at runtime in C up to compile time, so the fights are front-loaded rather than new. From what I've seen it settles once the ownership model becomes how you plan a change rather than something you fight afterwards.

[–] HaraldvonBlauzahn@feddit.org 4 points 2 months ago

Rust is much easier than writing correct C++ by discipline. Which is almost impossible for newcomers - C++ has not even a complete list of constructs that trigger Undefined Behaviour. And new programmers are not educated about Undefined Behaviour. Writting correct, well defined multi-threaded code is expert stuff in C++.

[–] ISO@lemmy.zip 3 points 2 months ago

Can you provide examples of what you're finding hard?
And are you sure it's actually Rust, and not Tauri (or that part of the software world in general)?

[–] ExLisper@lemmy.curiana.net 1 points 2 months ago

You don't really have to use Rust to develop Tauri project unless you're doing the front-end in Rust. Are you using leptos or something? Leptos can be very tricky when you try to do something not very standard in it. Other than that, I didn't struggle that much with Tauri. You can do most things with basic Rust.

[–] YiddishMcSquidish@lemmy.today 1 points 2 months ago (1 children)
[–] JohnHammerSky@lemmy.today 2 points 2 months ago (3 children)

Can it be used to develop for Linux?

[–] MoonRaven@feddit.nl 4 points 2 months ago

Yes. Dotnet is multiplatform and has been for many years now.

[–] nek0d3r@midwest.social 3 points 2 months ago

Thanks to .NET Core and modern .NET, yes! It's open source and my favorite language easily for this.

[–] YiddishMcSquidish@lemmy.today 1 points 2 months ago

I mean, I got Linux running on a literal toaster. So imma go ahead and give you an affirmative.

load more comments
view more: next ›