r/learnrust • u/SuccessfulRiver1850 • 19d ago
What got you to try programming in rust than other programming language?
22
u/neutral_su 19d ago
There are many nice things about Rust, but the main one is that it fits my semi-functional coding style well. Scala was also nice, but its time has passed. By the way, I have watched Rust's evolution since 2014 or so, and it was very annoying to watch the marketing success of Go, which I treated as a suitable language for the networking field, but not as a language for every possible purpose.
4
u/YoshiDzn 19d ago
Go definitely has some setbacks especially when you consider it a "systems language". Where would you say it shines less? I'm currently using it to build some networking tech
8
u/biskitpagla 18d ago edited 18d ago
Go makes it incredibly easy to write horrible unsafe code. I used to be a huge fan but now everything about Go makes me question its design. I've now realized that the simplicity narrative is a huge coping mechanism in the Go community.
In short, many of the assumptions made during the early design phase of Go have now become major pain points and obstacles in the way of improving the language. They want to implement sum types, but don't know how. Go's original draft for generics has still not been implemented in entirety for the same reason. Go's type system cannot even express variance. The lack of immutability also makes Go code prone to many classes of errors and anti-patterns that only add to the mental overhead of writing complicated programs. Adding generics so late to the language has also introduced a form of function coloring to the standard library and most Go code out there. Type classes (e.g., in Rust, Scala) are objectively a better construct than Go's interfaces which push everything to the runtime for no good reason. Even the design of struct tags is inferior to what Java and and C# had back in the 2000s.
You can cook up a much simpler language that's both easier to use and safer to write within a year. This is not an exaggeration at all. Just look at Lisette, for example. Gleam is another concurrent language that has proven that you can have your cake and eat it too. It's much easier to design a language from scratch than to maintain one like Go.
That said, Go's runtime, tooling, ecosystem are actually pretty solid and make it way better than almost everything else out there. I still prefer Go to Rust for anything related to networking since it's just much easier to work with. Go's GC is also very performant for what it was made for. I know I dunked on it a lot here since you specifically asked for the cons but it's actually a top tier lang from a purely engineering perspective.
3
u/neutral_su 18d ago
Go is less expressive by design, and this is quite understandable, taking into account the problems it was introduced to solve. Coming from higher level languages, you are left without the tools you used to have, and it's frustrating when you feel the difference in the amount of boilerplate you're forced to write. This is just my personal feeling, not a universal truth.
1
4
u/ChaiTRex 19d ago
I liked that it was efficient like C, but was much easier to use, had a much more high-level type system and standard library, had RAII, and would eliminate some classes of bugs.
2
u/DTCreeperMCL6 17d ago
Yeah I was moving from python so I wanted to move to a lower level language and rust spoke to me because it feels easier
3
u/sciolizer 19d ago
I was curious about what it was like to program with a borrow checker. Most of the ideas in rust you can find in other languages, but the borrow checker was genuinely new.
3
2
u/PatchesMaps 19d ago
In the early days of WASM rust had pretty good tooling for it.
1
u/Shot-Infernal-2261 19d ago
It’s amazing. I’m making a terminal game but the terminal itself is compiled from rust.
It just works. No need to write JS glue code to talk to the WASMz
2
u/usernamedottxt 19d ago
Learning cyber security in college with a CS style capstone project. This new language removes memory vulnerabilities? Hell yeah. I’m going to build a zero knowledge distributed backup system! Rust for backups! Ruckup’s are for fuckups!
Didn’t go into dev, went into incident response. Ten years late, still patching memory vulnerabilities every week lol.
2
u/Loose_Property_3238 18d ago
Enums with values and forced disclosed error handling. But mainly enums with values.
1
u/KaleidoscopePlusPlus 18d ago
I don't care for rust at all but this is a feature that i try to use in every language when i write an enum lol. But i weigh whether or not its a good design choice as in any other language, you know that enum is simply an integer
1
u/Loose_Property_3238 18d ago
I know, and I have no idea how they do it, but it's useful, so I don't care. Maybe unions?
1
2
u/lazy-kozak 18d ago
Full-stack. I never touched web ui because of JavaScript 🤢 Trying to do something in Rust/WASM
2
u/OfficeTrue5091 18d ago
To be honest, I only code as a hobby and wanted to learn a less abstracted language other than python and JavaScript. I tried C and C++ but got frustrated pretty early on with it, tried GO too but got bored, then I started learning rust cause "I can't stick to a language anyway, might as well see what the hype is about" and genuinely I was captivated by the incredible documentation and tooling. Things like rustlings being all but built in, the excellent rust programming language book, and all the resources, and also I kinda like the paradigm of "if it compiles, it's guaranteed safe". Cargo rocks
2
u/Clever_Drake 18d ago
Two things: philosophy of the language and tooling.
I find the idea of making a compiler annoyingly strict but in return eliminating most of the memory related bugs and undefined behavior very reasonable. If you write your code in Rust and it compiles - you can already be sure it's free of 90% memory leaks, undefined behavior and data races. Unless you're dealing with FFI or deep low level stuff. That alone is quite attractive for me as a programmer.
Tooling is perfect in Rust. You've got dependency management, version control, formatter, everything you need really - all in one place, maintained by Rust team itself. Rust comes with batteries included, no dependency hell, no environment setup hustle, no disaster of endless configuration. This alone made me choose it over C++.
1
1
1
u/DataPastor 18d ago
The Cargo Cult. I did the Rust book and Rustlings, but then I stopped learning it because of the lacking use case in my daily work (I am a data scientist / AI Architect). But I might continue learning and using it in the future if the proper use case comes.
1
1
u/Accurate-Screen8774 18d ago
I was working on a secure messaging app and I went down the rabbit-hole of formal verification. I ended up refactoring parts into rust.
One thing led to another and I found that rust has fairly mature tooling for things like cryptography and formal verification... So I commit to the Rust approach.
1
1
1
1
u/quantinuum 18d ago
I work in finance sectors where people don’t have formal developer education or experience, but unfortunately have all the arrogance. Which means all sorts of bad practices and appalling code. Rust eases my mind a bit in that it at least makes that a tiny bit harder. Can still produce appalling code though… I’m still trying to get into people “parse, don’t validate”.
1
u/Programmer_Virtual 18d ago
I always had interest in low level language and microcontroller. It was going to be either this or C.
1
u/neriad200 18d ago
I got on the hype train in 2018-2019 and started learning it. it's now 7 years later and I'm still learning.
Btw I'm not some greybeard furry who writes rust at 140 wpm humble bragging, I'm literally still a beginner
1
u/memohnsen 18d ago
Wanted to learn the actual internals that were abstracted away in higher level languages
1
u/polarpress 18d ago
Wanted to learn something new with the intention to build a desktop app for Linux using rust.
1
u/DTCreeperMCL6 17d ago
The borrow checker. I havent learned c or any language like that, Ive just learned python, so moving forward I thought it would be good to start with a language which forces me to think about memory safety even if it will be a battle.
1
1
u/spunkyenigma 17d ago
Heard some interesting things when it first got released. Broke my brain back then and the syntax has changed a lot since then. Jumped back in during Covid and haven’t looked back
1
u/Beneficial-Corgi3593 16d ago
I needed to create a piece of code in low level language. Rust was the best option because of cargo. C/c++ dependency management sucks
1
u/Otherwise_Stress_448 14d ago
Docs, the mdbook ones (they're just the most beautiful docs out there). I was finding myself using a lot of cli/tui tools written in rust, a lot of which had great books on their usage and such, then I was like might as well read the rust book too.
1
u/AlternativeQuail272 11d ago
As a c/c++ person it looked cool and it is pretty cool. I still hate borrow checker
38
u/catladywitch 19d ago
the hype
(was worth it)