this post was submitted on 11 Jun 2026
8 points (100.0% liked)

Programming

27223 readers
322 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 13 comments
sorted by: hot top controversial new old
[–] one_old_coder@piefed.social 9 points 1 hour ago* (last edited 1 hour ago) (2 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.

[–] JohnHammerSky@lemmy.today 2 points 56 minutes ago (3 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 2 points 48 minutes 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 1 points 29 minutes 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++
[–] 30p87@feddit.org 1 points 53 minutes ago (1 children)

If your code touches sensitive stuff (eg. public networking) and needs to be low level, probably Rust (or another compiled memory safe language). Otherwise, just use C++.

[–] JohnHammerSky@lemmy.today 1 points 48 minutes ago (1 children)

But then what's the point of Tauri? I mean there are plenty general use projects in Tauri, why'd they chose Rust?

[–] 30p87@feddit.org 1 points 37 minutes ago

A fake sense of security by pretending that simple apps that don't expose low level interfaces and use wrapping libraries for all parts of networking need to be implemented by-design memory language, or for people who just like rust.

[–] TheTechnician27@lemmy.world 2 points 1 hour ago* (last edited 57 minutes ago)

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.

[–] farmgineer@nord.pub 1 points 7 minutes ago

I haven't touched rust in a few years so the cookbook and the language may be different. I agree that the book didn't do a great job of preparing for a real project of any size/complexity, but there are other resources out there worth reading. Reading best practices documents might help some things make sense.

The borrow checker is something you will get used to. Lifetimes is another one that took me a bit to understand. I only ever did a little bit in C and even less in C++, but did have professional experience with Java, Perl, JS, PHP, and more at the time I first started looking into it. I was able to replace some fairly simple production PHP code with rust that ran much more reliably and with fewer resources, but didn't tackle anything huge.

[–] TehPers@beehaw.org 2 points 57 minutes ago

What do you find hard about it?

For me, what made it take so long to learn and really understand was that it's different from most modern programming languages. It's not C, C++, or based on my own experiences, C#, JS, Java, etc. Approaching the language as someone who's really into C# made it difficult to throw away that experience to learn something completely new, whether because I now had to wrap my head around lifetimes or because I can't have one type inherit the fields and methods of another.

Eventually, if you keep sticking to it (and have interest to do so), you'll learn how the language was designed to be used, and why it was designed that way.

Reading source code is your friend, by the way. If you want to learn the language, you should spend at least as much time reading code others have written as you also spend writing code. This can be as simple as "go to definition" on some imported function from a library you're using. Try to understand how that code works, and eventually you'll even begin to form opinions on what works well vs. what doesn't. Heck, you might find yourself opening PRs against something like Tauri in no time.

[–] Kwdg@discuss.tchncs.de 2 points 1 hour 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++

[–] dwt@feddit.org 2 points 1 hour ago

Yes. Hard that from Lots of people.

[–] slacktoid@lemmy.ml 3 points 1 hour ago

Its more of what do you want out of a compiler.

https://www.manning.com/books/learn-rust-in-a-month-of-lunches

A great analogy for Rust is that of a critical but helpful spouse.

And I kinda agree with that. Maybe a little excessive but when you're done you have a much more likely to not hit a segfault