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

Programming

27223 readers
329 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 16 comments
sorted by: hot top controversial new old
[–] thingsiplay@lemmy.ml 4 points 43 minutes ago

Maybe the problem is, that you try to learn and use everything at once. Rust is not easy and it has lot of stuff to learn and get good at. And compared to many languages, Rust has a few set of core features that makes it more complicated to understand and also you need to learn the basics before getting started. So just doing the exercises is not enough. My advice is to write simple programs with a focus of specific set of language features and what you want to accomplish, before doing the more advanced stuff.

The difference to languages like C++ is, that Rust forces you to do the homework before running the program, not after. That is the reason why it looks to be "harder", but I think this is one of the reasons why its so misunderstood. In example if you MUST think about all possible states, variables and errors in a program before it runs, then you have to put so much work for this. In the end, you did all the work and the program should theoretically better than if you did not have. Compare this to other languages, where you can run the program simply by ignoring errors, all states a program can be in and be done in short amount of time. That looks easy. But in reality you didn't do all the work.

[–] ISO@lemmy.zip 1 points 7 minutes 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)?

[–] one_old_coder@piefed.social 13 points 2 hours ago* (last edited 2 hours 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.

[–] TheTechnician27@lemmy.world 6 points 2 hours ago* (last edited 2 hours 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.

[–] JohnHammerSky@lemmy.today 2 points 2 hours 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 3 points 2 hours 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 1 hour 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 2 hours 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 2 hours ago (2 children)

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

[–] fruitcantfly@programming.dev 1 points 1 hour ago

Once you've learned it, Rust is just a very nice compiled language to work with.

You get higher level constructs than in C++, a language without a billion weird edge cases, a modern package manager, and much more. In my experience, my code written in Rust is more likely to work as intended, both because of the stricter compile-time checks, but also because language features like sum types make it easier to check the core logic at compile time.

I work in both C++ and Rust, among other languages, but these days I never reach for C++ for a new project

[–] 30p87@feddit.org 1 points 1 hour 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.

[–] farmgineer@nord.pub 1 points 1 hour 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 2 hours 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 2 hours 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++

[–] slacktoid@lemmy.ml 3 points 2 hours 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

[–] dwt@feddit.org 2 points 2 hours ago

Yes. Hard that from Lots of people.