(no title)
glutamate | 1 year ago
Is Rust building up a decent ecosystem now for application programming? When I tried developing in Rust I came to the conclusion that you pay a heavy price for not having a garbage collector. Was I doing it wrong?
glutamate | 1 year ago
Is Rust building up a decent ecosystem now for application programming? When I tried developing in Rust I came to the conclusion that you pay a heavy price for not having a garbage collector. Was I doing it wrong?
lionkor|1 year ago
It's a general purpose language, but it does give you full control. Plus, of course, you can encode a large amount of program states in the type system and borrowing checks enforce rules that programmers usually have to check in their head.
I find that when I write Rust, I have to worry about an order of magnitude less about silly things like lifetime bugs, reference bugs, resource cleanup, all of which are 80% of my job when I write C#, or other similar managed languages.
Plus Rust can generate a static executable, which is reasonably small, and doesn't require a third party runtime.
pjmlp|1 year ago
Rust executables are only 100% static on OSes that expose system libraries as static libraries, and there are not many of those around, outside embedded systems.
terminaltrove|1 year ago
In fact there are a bunch of them for the terminal.
https://terminaltrove.com/language/rust/
https://terminaltrove.com/language/go/
sepositus|1 year ago
K0nserv|1 year ago
1. Historically a CLI like this would often be written in C, so Rust isn't that strange of a choice.
2. Rust is know for the borrow checker and being a great low level language. However, it's also an excellent modern general purpose language with a great ecosystem. People end up using it for all kinds of things because it's a joy to use.
"When I tried developing in Rust I came to the conclusion that you pay a heavy price for not having a garbage collector. Was I doing it wrong?"
Rust is tricky to grasp initially, the learning curve goes pretty much vertical immediately, but once you "get it" it's very nice. When I started out I overused borrowing and ran into heaps of lifetime problems. I think limiting yourself to only using references for function arguments and, rarely, return values is a good place to start. As soon as you are start adding references to struct you should stop and think about who owns the data and what its lifetime is. Thinking properly about ownership is the big shift from GC languages. Once you've gotten into that habit, lifetimes are downstream from that.
oguz-ismail|1 year ago
*Perl
goku12|1 year ago
I don't face much friction from the borrow checker to consider it a 'heavy price for not having a garbage collector'. There are even tools like bacon [1] that can give your real-time feedback on your code. It's even better with the default language server. I sometimes train other developers in Rust - mostly people who are not even into systems programming (JS, Python programmers). However, they don't seem to struggle too much with the borrow checker either. Could you elaborate a bit on what you consider as 'the heavy price'? What sort of issues were you facing frequently?
[1] https://github.com/Canop/bacon
ForTheKidz|1 year ago
I will say that rust is pretty damn productive once you organize your brain around ownership. I haven't had to mark a lifetime in over a month.
pkolaczk|1 year ago
zsoltkacsandi|1 year ago
I also recently started some open source projects (mostly CLI tools) where I picked Go for one reason: Rust’s learning curve is super steep.
In order to make my projects approachable for other developers Go seemed to be a better choice over Rust.
m11a|1 year ago
You do pay a bit in syntactic overhead (lifetimes, borrow checking perplexities), though you get used to it. I'd still not use it for a standard product-y web app. For CLI tools though, it's pretty good.
pinoy420|1 year ago
[deleted]
atoav|1 year ago
Give it a try.
spoiler|1 year ago
unknown|1 year ago
[deleted]
tempay|1 year ago
It also helps that rust attracts the kind of devs that make nice tools.
unknown|1 year ago
[deleted]
thiht|1 year ago
This is because empirically, they usually work better, feel more polished, faster and I can easily contribute patches if I need. If a tool is written in Python, I’ll go out of my way to find a rewrite in another language.
Starlevel004|1 year ago
OtomotO|1 year ago
HackerThemAll|1 year ago
goku12|1 year ago
jvanderbot|1 year ago
Honestly though I thought we were past the "written in Rust" phase.
unknown|1 year ago
[deleted]