8 ms·
Rust is a really frustrating language for me: I understand the safety it provides but find the pain of actually using it makes it uncompelling. Plus, the Rewrit
by fiddlerwoaroof 3y ago
Rust is a really frustrating language for me: I understand the safety it provides but find the pain of actually using it makes it uncompelling. Plus, the Rewrite it in Rust movement is very off-putting
- fiddlerwoaroof 3y agoAs far as specific complaints go, async rust seems to be a trap: I’ve heard of several companies adopting it and then regretting the decision six months later because of the failure of that abstraction to adequately abstract.
- anonymoushn 3y agoIt's difficult to avoid, right? If you are writing a network server or client that manages a lot of connections, you can either use the popular async executor or you can stray far from the beaten path.
- mplanchard 3y agoFor more anecdata, I have been working professionally with async rust for three years and don’t understand why people complain so much about it. It solves the problem well, it provides predictable performance, and most of the time it’s straightforward to write and reason about.
- kstrauser 3y agoRust pissed me off until I stopped fighting it. When I finally gave up and started doing things its way, it became a lot more fun. And `cargo clippy` is flat-out helpful for learning Rust’s idioms. While I’m not yet out to rewrite all the things in Rust, I understand the appeal of rebooting archaeological projects with a modern approach.
- fiddlerwoaroof 3y agoThe thing is, I just don’t want to write programs the way Rust wants me to. Among statically typed languages, Java is the closest to what I want to use but my true love is Common Lisp. With the arrival of Coalton, I can get the best of both worlds: a type system with nice properties for the rare program that would benefit from them and CL for the majority of programs.
- satvikpendem 3y agoThen I guess you don't have to write Rust? It seems like it doesn't solve any new problems for you so don't feel forced or pressured to use it (for any technology, really), and I say this as someone who really likes and uses Rust.
- fiddlerwoaroof 3y agoYeah, what’s frustrating is (a) I wanted to like it; (b) it’s taking up a lot of the job market relative to other alternative languages I’d rather use; and (c) I like the language Graydon describes as “the language I wanted” https://graydon2.dreamwidth.org/307291.html https://graydon2.dreamwidth.org/307291.html
- satvikpendem 3y agoSeems like you want something like OCaml then.
- tialaramex 3y agoSo, the reason Rust took the direction it did is that a lot of people want a language specifically like this, while there were already plenty of languages roughly in the ballpark Graydon wanted. I don't have a clear use for one of those languages, I might use it in some cases anyway, but I was compelled by Rust, it's more or less exactly what I needed. I can have a proper type system like an ML, and touch the metal like C? Yes please.
- soniczentropy 3y agoB is exactly how I've felt about, in order: C, C++, Java, C#, Javascript. I spent almost 20 years writing languages I did not like because I couldn't find jobs in anything else. Rust saved some of us from a lifetime of exactly the problems you have with Rust, maybe let us have this one :)
- kstrauser 3y agoAlright, so when I’m appointed Lord Emperor, we’ll all be writing CL. Until then, I’m digging Rust. It’s like garbage collection, but where you can always tell exactly when a thing is going to be collected.
- aquova 3y agoRust was a language that I firmly embraced for my own projects for about 2 years, then I eventually came to the conclusion that the benefits it gave me weren't really that useful for the things I was working on, and I switched away to other languages that I personally enjoy using more.
- goodoldneon 3y agoWhich languages do you enjoy more?
- nwallin 3y agoRust is a frustrating language for me too. I never saw the need for it, really. I just stuck with the language constructs in C++ that makes it basically impossible for memory leaks/use after free/use outside of bounds to occur or if they do occur, explode loudly in debug environments. I haven't used new/delete in a personal project in like a decade; longer than Rust has been around. Now I'm working on a project where the main developer is...a cowboy. Everything is insane. Not only is new/delete everywhere, but so is malloc/free. In C++ code. You have to navigate to where the thing is allocated to figure out whether to use free or delete. Everything leaks, everything crashes, everything races, everything deadlocks. Oh and the guy is my boss. So on the one hand, rust might fix these problems, on the other hand, rust is a non-starter. So now what. I still don't need rust because I don't code like a crazy person. And the people who do code like crazy people will never use it anyway because it doesn't let them...express themselves.
- nindalf 3y agoHell is other people’s code. Of course our code is perfect, and we would never write a buffer overflow or issue that would be solved by memory safety. But I find consistently that other people seem to, and then I’m forced to contribute to the same code base.
- ignoramous 3y agoGP isn't wrong though. There genuinely are total hell codebases. Not everyone is as dedicated to their craft like Mozart was. There are levels. And some teams and individuals do indeed produce better outcomes because not only they know how but also show how.
- resonious 3y agoWhat kind of solution would you propose to folks like your boss? One positive aspect I see about "rewrite it in Rust" is that you can to some degree expect a random Rust project to not leak and crash and expose vulnerabilities quite as much as a random C++ project. It's silly, but "written in Rust" acts somewhat as a badge of safety and performance, whereas "written in Java" and "written in C++" each only carry one of the two. Of course, developer skill is also huge. You can write slow Rust code or fast Java code, yadda yadda.
- rtpg 3y agothe frustrating thing for me has been trying to "port over" C++-isms or Python-isms both fail from one direction or another. I've found that data structures with _lots of helper methods_ (thinking about things like `Result` in particular) tend to be nice. You do have to learn about Rust-specific things to figure out how to nicely structure your code for everything to work. But the payoff is less pain. There are still a lot of futzy ownership questions, and even when you write out your supposedly performant and cool system, easy outs like cloning end up hiding in your system leading to some awkward performance questions. Fortunately the systems are merely slow, and it tends to show up in profiling.
- datadeft 3y agoRust is for people who stick around, can come over hurdles, can take in new concepts and see the overall benefits. It has a steep learning curve that pays off. For me there are three reasons why Rust is suitable for many usecases: - performance - safety - static binary compilation with targeting different cpu architecture After spending majority of my time with Python and Java in the last 10 years these are things i really learned to appreciate.
- fiddlerwoaroof 3y agoPerformance isn’t a problem for Java for just about any business application most programmers will work on and, if it is, you can usually figure out how to optimize Java to hit your performance target. Safety is also not a problem in Java. And fat jars remain the single best way to deploy an application I’ve seen in just about any ecosystem (and nix is working out pretty well to bring their benefits to the rest of the programming world).
- eklavya 3y agoHopefully with Valhalla landing, memory footprint can also go down enough.
- alex_suzuki 3y agoEven better than fat jars are jlink‘ed images, maybe even wrapped in a nice shell using jpackage. Bundling the JDK and stripping it of unneeded modules eliminates so many types of issues. All courtesy of your JDK.
- datadeft 3y agoI have the exact opposite experience. In fact for a while I lived on optimizing Java projects to meet with performance numbers even my junior Rust code can beat easily. Most Java devs have no idea how to write performant software.
- Shorel 3y agoPerformance and static binary compilation are available in 40-year-old languages, not forgetting Dlang, which is the central topic of this post. The only reason left to really use Rust is safety.
- odiroot 3y agoTry V https://vlang.io/ https://vlang.io/ ;)
- srjilarious 3y agoI've had the same experience - I spent 6 months last year really digging into Rust and came to the conclusion that for the software I'm writing it's trying to save me from problems that I just don't run into enough to make it worth it. I ended up jumping over to Zig and have been really enjoying it. I ported the same hobby 2D game engine project from C++ to Rust, and then over to Zig. A simple tile map loader and renderer took me about a week to implement in Rust and 3 hours in Zig. The difference was a single memory bug that took 15 minutes to figure out.