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?
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.
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.
In fact there are a bunch of them for the terminal.
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.
*Perl
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?
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.
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.
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.
Give it a try.
It also helps that rust attracts the kind of devs that make nice tools.
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.
Honestly though I thought we were past the "written in Rust" phase.
For example: On my home machine I have the following keymapper hotkey: Windows + T: Activate Telegram On my work machine that's mapped to: Windows + T: Activate Teams
The environments are basically the same in each but there’s some functionality I can do I one that I cannot do in another
https://github.com/cquintana92/dotfilers
Congratulations, you too unlocked the "None of the hundreds that are out there work exactly like I want, so I'll write my own" badge.
If you work a lot in remote dev environments (I use coder a lot at work) that really does the trick.
The home servers are nixOS, the rest basically have the CLI environment managed with nix-darwin and nixos-wsl, all with one flake (Git repo) containing all the configuration.
Case in point - this morning I’m rebuilding one of the servers onto new hardware, and the longest time spent was getting the flake config onto the server with git clone. Now just watching the rebuild switch command output, after which it’s good to go.
Ansible is the best for these things, no symlinks needed, just configure what you want to exist and where and you can template configs or copy them or use some modules like `git_config` to then generate that ini file etc. Ansible vault also handles encryption easily so i can manage ssh keys, passwords...
1. git clone my dotfiles repo
2. run `stow .`
3. profit
This pretty much guarantees that if my Mac dies today, I can just get up and running in no time on a new machine.
This looks like it can work with windows as well and you can easily switch between profiles if you have multiple which is great too
the functionality OP is searching for is already provided by chezmoi. and many more features.
Personally I have a git repo in my home directory and just commit dotfiles to it. The only drawback is that git always think there’s a git repo no matter where I am in my home, so I usually rename the .git folder to .git_hidden. And on the (rare) occasion that I want to update one of my dotfiles I just rename the .git_hidden directory back to .git.
It’s really just two “mv” commands, I can’t believe you need a tool for just that.
What am I missing out on?
I don't know how big your .gitignore must be when trying to use a tool that wants to own every file and directory to manage your /home but if that works for you, more power to ya
And I don’t even bother with ignoring files! I just git add the ones I want to track :)
Specifically looking to see where this differs from chezmoi.
I’ve been using it for a couple years now and it’s worked well for me across multiple machines.
What can this one do that the other ones don't?
The README lists features that, well, I'd already expect modern dotfile managers to be able to do.
my dot file scripts just have very opinionated dir/file naming conventions and things just fall into place. it's not like you need to give tune much... even adding the template thing which i think is overkill (time would be best spent with a way to validate code cross platform of you ask me.. templating makes this more difficult while pretending to remove the need for it)
Good, because I am a fan of yadm, but I also don't feel the need to switch ;)
The baffling part though is recommending using homebrew to install it on linux.
Do they really? Probably AI-generated.
I only have two actual dotfiles on my system (git and one more)