I stopped with rust

Hello fellow programmers,

I think I really stopped with Rust. Although I really like the performance there are too much issues for me. Maybe I will come back, but for now it does not look like that.
Partly inexperience, lazyness, non-interest probably.
Maybe just for feedback I put some reasons here...

The main reason is, I don't feel the satisfaction of the writen code. Except for the performance!

The syntax I cannot get used too. In general it looks too complicated for me with all the brackets, generics, trait implementations, results, abstract implementations. It does not feel like a "language", but more like a math puzzle I have to decipher.

My brain just does not want these, and these are easy ones!

pub trait ToOwned {
    // Provided method
    fn clone_into(&self, target: &mut Self::Owned) { ... }
}
pub fn missing_field<'de, V, E>(field: &'static str) -> Result<V, E>
where
    V: Deserialize<'de>,
    E: Error,
{
}

The macro language is another puzzle I do not want to dive into. I cannot find code when wrapped into macro's for example.

Too much crate dependencies for relatively simple tasks. I really think there should be "official rust" crates for these.

Another reason is the borrowchecking and references between objects.
Although I can see why it can be useful and good, as a programmer (and certainly in the hobby area) I want to be able to easily make an unsafe mess if I want to. And I just want to read and write to everything if I want to. Which is very difficult in Rust.
I also get the feeling this system is more difficult to represent reality. In realtiy things interact and change in all kinds of directions. Reality is not a tree.

It is not all negative. I really like a lot of things in the Rust language.
No GC and control over memory (unlike C#).
Of some things I like the clarity for example arrays / vecs. In C# you can choose from at least 12 obscure variants (including emergency performance thingy's) of these.
And I have seen very clear and readable crates, which set simplicity in front.

I am without favorite language now :slight_smile:
At least I produced a very fast chess engine and the beginning of a game.
It was the game which stopped me going on: too much troubles, not enough fun.

Best wishes to you all and thanks for all tips and comments I got.
Eric

23 Likes

This is indeed a valid reason to avoid Rust.

25 Likes

That is tragic. It's like someone realising they don't like any of their friends any more.

11 Likes

May I ask how long you’ve been trying Rust and approximately how old you are?

Then C is for you! But you'll be responsibe for the mess to. :slight_smile:

I'm learning Rust. And I'm just at the beginning. Rust can be frustrating. I know that things I want to do do work safely. And Rust sometimes is hard to convince.
I realized that Rust is not a piece of cake but I'm convinced it's worth it. I just adjust my speed, so my brain doesn't keep falling out.

1 Like

As a long time user of C and C++, not to mention compiled languages like PL/M, Coral and Pascal, that allow one to easily make a mess I feel that by the time you have managed to get the unsafe mess you have created to work reliably you have actually discovered and followed all the rules that Rust imposes. The difference being that the annoyance comes at compile time with Rust rather than at run/test/debug time with the others.

All that stuff about out of bounds array access, use of uninitialised/invalid pointers, use after free, race conditions etc is there for you to "unmess" by running, testing and debugging. That is why there are thousand pages long coding standards for C (for example). I'd rather have the compiler check for all that than have to do that tedious checking work myself.

That said, in four years of using Rust most of my Rust code reads as simply as any C or even Javascript. If I start to feel the need for lifetime annotations I start to think I'm over complicating things unnecessarily. I have never written macros, even generics are rare. Looking at my current effort in 3000 line software Rust I only have four clone().

I have to ask: What languages have you been using?

17 Likes

Have you looked at Zig? I think it should be a closer match, given your description of downsides and upsides. Still fast, still low-level, but with much fewer restrictions and guardrails, simpler syntax, and the macros are just ordinary Zig code.

D can be another interesting choice, if you're more of a fan of C++-like syntax. It's not popular in the industry, unfortunately, but that shouldn't matter much for hobby projects.

20 Likes

May I ask how long you’ve been trying Rust and approximately how old you are?

I have been trying for about 8 months. I am in my fifties! (aargh, but quite some experience).

I have to ask: What languages have you been using?

I have used Delphi (very long and not anymore) and C# (10 years) mainly.

Have you looked at Zig

Not yet, but planning to to do that.

4 Likes

I cannot understand this. After having written abominations like:

use std::collections::HashMap;
use std::fs::read_to_string;

const PROC_MEMINFO: &str = "/proc/meminfo";

pub fn meminfo() -> std::io::Result<HashMap<String, usize>> {
    read_to_string(PROC_MEMINFO).map(|text| {
        text.lines()
            .filter_map(|line| line.split_once(':'))
            .filter_map(|(key, value)| {
                value
                    .trim()
                    .split_once(' ')
                    .map_or(value.trim().parse::<usize>().ok(), |(value, unit)| {
                        value.trim().parse::<usize>().ok().and_then(|value| {
                            match unit.trim() {
                                "kB" => Some(1024),
                                _ => None,
                            }
                            .map(|factor| factor * value)
                        })
                    })
                    .map(|value| (key.trim().to_string(), value))
            })
            .collect()
    })
}

I actually occasionally feel like an artist when I managed to fit an entire function onto one statement.

That's a critique I often hear from other devs coming from other languages.
But then, I don't find the TMP stuff of C++ much more readable.
In fact, with Rust, I at least always know my trait bounds.

Understandable. I also had and still have a huge respect for macros and their authors.
It's some part of Rust that I still have not mastered, yet.
But at least I wrote some procedural macros myself, which I found easier to understand, than declarative macros, whose "magic" syntax still escapes me.

You need to choose dependencies wisely. I am not a fan of NIH culture, but one can also overdo it with dependency inclusion. When I look for a crate to solve a common issue, I usually check how often it is used and, most importantly, whether it is actively maintained.

3 Likes

I can definitely empathize with this. I've often wanted something like

impl<T: LocalToThisCrate + ActuallyCaredAbout> SomeTrait for T { .. }

so that I could "macro via generics", and macros do obfuscate the source code and confound IDEs.

I still reach for macros to avoid repeating myself, but it's usually with a sigh.

I agree with this somewhat as a general modern programming language[1] problem, though I'm not sure if that's what you meant.[2]

I also agree that for Rust specifically, the resources available to figure out which crates are "semi-official" (industry standard, don't hesitate to depend on it) are still lacking. I get the reasons to avoid official endorsements, and why std uptake of externally proven APIs is slow. But in the meanwhile, no satisfying alternative has emerged either.


The trait system and syntax, I never had a problem with, but I recognize some people really, definitely do. Unfortunately most attempts make things "simpler" by introducing alternative syntax and/or more elision and implied meaning actually make the language more complex and, frankly, worse, in my opinion.[3] Not sure what else to say about that.

As for the borrow checking... today I appreciate the gains[4] enough to think it's worth it, even if it's possible to do better than Rust has so far. And I don't mind the puzzles. But that wasn't the perspective I had when I started doing non-toy projects in Rust.

When I started I fought the borrow checker in the typical fashion, thought I knew better than it,[5] used unsafe to get around it in ways I now recognize were UB... I'm trying to think of what managed to get me out of this phase without burning out on Rust. I think part of it was just tenacity, but also not wanting to go back to C for the low-level stuff. My iteration time on new functional code was much less despite my UB crimes,[6] and I was already burnt out on C's "test, bug-hunt, attempt-fix" cycle.

Hanging out on this forum,[7] reading other people's questions and the responses by experts, went a long way in getting me to recognize that I didn't actually understand UB[8] or know better than the borrow checker. And I came to appreciate the community as well as the language. From there I got quite invested and poured a ton of time into Rust and this forum.

Part of what made that possible is also just life circumstances lining up right -- I had the ability to pour the time into it.


Anyway, those are my thoughts. Good luck with your next endeavor and maybe we'll see you back again!


  1. i.e. package managed ↩︎

  2. Sometimes it's ok to pad your own lefts. ↩︎

  3. "Does what you probably meant 90% of the time" means that 10% of the time you're utterly and completely confounded, unless you both understand the inner workings and have been given the tools to override the language assumptions. ↩︎

  4. less bugs, less maintenance hazard, shorter "why is this out of beta" tail... ↩︎

  5. this was pre-NLL too for whatever that's worth ↩︎

  6. and later I found my crimes had sound workarounds, which was fortunate ↩︎

  7. and previously, IRC ↩︎

  8. in Rust, and less than I thought in C, which I now consider to be a cultural flaw in the C world (or at least some parts of it) ↩︎

15 Likes

You could take another look at C - e.g. read Jens Gustedt's "Modern C". It has come a long way since K&R.

2 Likes

With your life experience, one of the hardest things is starting from scratch when learning something new and accepting the role of a beginner. But that same experience will likely remind you of what you might say to a child who wants to quit studying after just 8 months. :wink:

3 Likes

While it is nice when writing code, it is a pain during source-level debugging. This is a reason why I prefer for loops unless performance is critical (because iterator combinators often better optimized).

4 Likes

Ugh. I sure hope I never meet that kind of code in real life. Maybe it was a fun little puzzle for you, stuffing all that logic into a single method chain, but deciphering what the hell is going on is not fun for me.

Besides a complex block of logic rolled into a single expression, there's shadowing all over the place, with values significantly changing meaning, and no error handling in sight. I can't even begin to imagine what I'd have to change if I wanted to properly handle any parse errors in this mess.

10 Likes

On the "looking for a new favorite language" front you have more options than ever nowadays, some of them even good!

You should definitely try out Zig as mentioned, it's a much cooler C, but still very under documented, changing as they figure out a stable release, and has a fairly unique compile time code system that might throw you.

There's also Odin, which is designed specifically for games but that has the effect of being both very flexible and performant - useful for pretty much anything, but doesn't have a huge userbase.

Dynamic languages are also a good tool to have under your belt, and serve well to trade off with the rigid systems language as you need for the problem at hand, possibly even within the same program, though I haven't yet managed to hit a setup I like with that just yet.

1 Like

8 months only and ready to give up??

How long did it take you to become fully proficient in C# or even in Delphi?
Modern C# (2024 edition) is a large and complex language, it was much simpler when C# V1.0 was released (I am ex-Microsoft employee, 1999-2004).
Delphi in its entirely was also not all that simple to master.

IME - I first started learning Rust aged 59 (!!). First 6-12 months were relatively uncomfortable and then it got easier and easier. I am now (IMHO) close to intermediate level Rust coder - not any kind of Rust expert but now comfortable.

My coding experience is (since 1982) are Pascal, COBOL, C (I like C), SQL, a bit of little C++ (I do dislike C++), a fair bit of server-side Java and C#, a tiny bit of Kotlin and Scala and some Python 2.x. Finally Rust, since early 2020 (2018 edition).
And I stopped here.
I now refuse to code in any language other than Rust (except for writing
scripts in Python, because Rust for scripting is not a reality in 2024).

Out of all languages I have ever used, Rust is by far the most spectacular language. It's not just performance, it's all other good stuff. They have thought of everything!

The key, IMO, is to unlearn the previous programming language baggage which you may have many years of.... Rust is not like any other programming language.

To help you learn and to get more comfortable I can recommend to re-start at the beginning and read some superb Rust books that exist in 2024.

My favourites Rust books so far are:

  1. 2nd edition of Programming Rust by Blandy/Orendorff/Tindal (2021)
  2. 2024 edition of Effective Rust by David Drysdale.

More intermediate-to-advanced book is: "Rust for Rustaceans" by Jon Gjengset.
Note the 3rd edition of Programming Rust book is due in ~2025 (after new Rust edition is released??).

And the free official Rust "The Book" is probably the best beginner-1st Rust book to read - its on-line and free. If you have read it end to end already, move on to study the Programming Rust book next.

Rust is not for everyone but please show me any programming language that is for everyone or even for most programmers??
I would even argue that Rust fits more real production use-cases than any other language in 2024.

Unreadable code can be easily written in any programming language, Rust is no exception. It's worse in C++ and even in C.
The advanced Rust proc-macros are an acquired taste but you don't need to know them in great detail, in most cases, to write most real production apps in Rust.
Macros are more useful for library crate writers, may The Lord bless them! :smile:

Best wishes in your programming endeavours.

10 Likes

Thanks for sharing.

8 months only and ready to give up??
How long did it take you to become fully proficient in C# or even in Delphi?

Delphi took me some time (I already knew Pascal). Pascal took me about 1.5 year when starting programming I think. (i still remember not understanding what the $%= a boolean was).
Delphi took me some time with OOP.
C# took me basically a few weeks (it resembled Delphi, just flip around some things and replace begin end with {}).
But I had fun exploring these. With Rust I had that in the beginning but not anymore.
I like some concepts of it, but not at all sure if I like some of the things I mentioned!
Luckily you have a better experience.

1 Like

I have stopped with Rust multiple times so I understand what you are saying. I am in my early 40s and come from about a decade with Python, JavaScript and about half a decade of PHP before that. I had C/C++ in my college days and have fond memories of my adventures with them.

Why did I keep coming back?

I have always wanted to build software for masses. I have been on a career break. In the last few years, I felt disconnected with my work as a software engineer. Every startup wants a billion $ dream. I wanted to cater to the billions that no one cares about. I live in a little village in the Himalayas by choice. I do not care about hype. I needed a tool that would become more handy than Python has been. And I love Python.

When I heard about Rust the first time (2016 maybe), it was all the flashy computer science bits that I was looking at*. I picked up the language and failed multiple times till about last year. Rust was too hard, was not fun to write, had too much cognitive overhead. But I finally saw the other side when I started to think as the founder who also wants to empower the world - code that is reliable, fast, easy to maintain months or years down the line. Code I can reason with, code that was explicit. All that syntax comes at a cognitive price but gave me an edge to think about the software I want to create. To think about the data model, to have a conversation with my work like I have never had before.

Rust encourages me to look below the surface. I can take any crate - from simple SQLite wrapper to the fastest HashMap implementation and it is all in the same language. It is OK if I do not (I still do not) get lifetimes. It is OK if I can not write macros. But I know where to look when I need them. And I do not need to change my primary tool.

So I am building. Almost a year, full-time now. I am building products with more passion than I ever had. Knowing that I have a tool, that will allow me to dig deep into the heart of computing and unleash the potential for everyone. Software to empower masses needs to be fast, efficient, reliable. Rust has become a friend in my own journey. I just re-started Rustlings a week ago and my product is already reaching MVP. There is a sense of joy in knowing there is much to learn and much benefits to unlock from my creation.

Maybe there is a better tool for you. Maybe you will come back to Rust. I have not come across another tool that gives me quite this package. It took me many attempts, many breaks. And it was worth it.

9 Likes

I do understand that. Your problem is, that you do not want to invest that much time as you do programming for fun. If your fun is exploring languages, then explore a different one. If your fun is writing something useful (for you), pick a language you know and like to use.

Or have a walk in the forrest, and think about where you want to go in respect of software. If you have doubts about where to walk, don't forget your GPS :slight_smile: .

Minor note: The annual Rust survey has had questions for ex-Rust developers as well. When it comes around next time, you might want to reiterate what you wrote here in the survey, because these experiences are helpful to the Rust project.

19 Likes