4 ms·
Rust is one rabbit hole I really, really regret going down. Put weeks of work into it, got frustrated nearly every day, wrote copious notes, re-read things, and
by LAC-Tech 5y ago
Rust is one rabbit hole I really, really regret going down. Put weeks of work into it, got frustrated nearly every day, wrote copious notes, re-read things, and the end result is... I still can't use it for anything gnarly (ie everthing, because why else would I use a systems programming language if I wasn't doing funky stuff with memory?)
Rust has great PR but I found it to be a profound waste of time. YMMV.
- ALittleLight 5y agoI tried picking it up recently. Not for any real reason, just curiosity. I didn't get terribly far, but found a lot of frustration. I then watched a YouTube video where a guy was saying how even though he knew and liked Rust he still got frustrated a lot by it and found that developing in Go was much more productive. I dropped Rust and started experimenting with Go because I began to get afraid that I wouldn't get past the unwieldy stage with Rust.
- ebingdom 5y agoPersonally, I've had the opposite experience. Rust is one of the few languages that has proper support for algebraic data types and pattern matching, which I consider table stakes for a programming language. I know that's not what draws most people to Rust, and I'm also drawn to many other aspects of it, but it bothers me that most languages embrace product types but have little or no support for their categorical dual.
- Cyph0n 5y agoI’m not sure what “gnarly” things you tried to implement, but for anyone else in a similar situation, a good starter usecase for Rust is writing a command line utility. Crates to check out: - clap for command and argument parsing - anyhow for “easy” error handling - log + env_logger for logging - reqwest for HTTP requests (start off by using the blocking client) - serde + serde_json for handling JSON - rayon to “magically” parallelize your code (using multiple threads)
- tick_tock_tick 5y agoI think Rust gets much easier when you understand it's the most or close to the most opinionated language ever made. If something is hard or feels really awkward to express it means you're "doing it wrong". A lot of classic solutions to problems that you've learned over your career are hard or impossible for Rust to validate. When you run into these hurdles you're supposed to switch to different style/solution rather then trying to fit a round peg in a square hole.
- pkolaczk 5y agoYeah, this. Particularly when you come from a language that is heavy on using references like JS, Python or Java (and probably a good majority of languages with GC), you might get initially hard time with Rust. After I started appreciating pass-by-move, accepted occasional cloning and used references mostly for temporary, short-term borrows, suddenly it all clicked for me. The upside is that this way the code is actually much simpler than a spaghetti of cyclic references I got used to in big Java projects.
- sydthrowaway 5y agoWhat's an alternative?
- olah_1 5y agoZig or Nim maybe
- winrid 5y agoZig is way more low level. Nim is a great alternative though. 90% of the performance with 50% of the work.
- kaba0 5y agoThere is no more low-level. Rust and zig can express the exact same programs. Rust just catches a few more erroneous ones at compile time, but you have to manage memory explicitly in both.
- winrid 5y agoZig doesn't even have a string type. It's not an alternative to Rust, which is meant as a safer C++. Nim has a huge stdlib.
- sydthrowaway 5y agoDo any of them have a wasm target?
- antifa 5y agoNim can target js directly, but if you really want wasm it's mostly probably possible https://forum.nim-lang.org/t/7365 https://forum.nim-lang.org/t/7365
- conradludgate 5y ago> because why else would I use a systems programming language if I wasn't doing funky stuff with memory? We use Rust for regular boring old backend servers at work. Not for speed or efficiency either. Rust doesn't need to be just a hot mess of memory manipulation (and you're never going to learn it like that) If you want to learn it, don't do the weird stuff first, it'll just be confusing
- pkolaczk 5y ago> why else would I use a systems programming language if I wasn't doing funky stuff with memory? Actually quite the opposite. You would appreciate Rust in applications that manage non-memory resources. RAII is a breath of fresh air compared to all those try-with-resources / AutoCloseable hacks.
- pjmlp 5y agoExactly, Rust's sweet spot are kernels, drivers, firmware, GPGPU and everything else where using a language with automatic memory management isn't an option.
- kaba0 5y agoChances are you don’t need Rust then. I think the only fail of Rust is that it markets to a much wider audience then needed. It is a low-level language, period. Sure, it is one of the most handy and expressive low level languages, but if your program doesn’t have to sit too close to the hardware than the litany of managed languages will be just good enough. GCs are plenty fast so the slight tradeoff is entirely worth itz
- LAC-Tech 5y agoI was much more productive with C++20. Finding a known bug in the borrow checker (people were telling me what I wrote should have compiled) was the last straw for me.