▲ | nmilo 3 days ago | |||||||||||||
I don't know why anyone would write CLI tools in rust or zig. I/O is going to be your bottleneck way more often than GC, in fact I don't really get the GC hate outside of game dev, databases and other memory intensive applications. Why not use Go, Python, etc? People try to make a false dichotomy between memory safety vs. non-memory safety when really it's GC vs. no GC --- memory safety without it is going to be hard either way. More time should be spent on justifying to yourself why you shouldn't be using a GC, and less on which kind of GC-less language you use. (If you go no GC "because it's fun" then there's no need for the post in the first place --- just use what's fun!) | ||||||||||||||
▲ | shmolyneaux 3 days ago | parent | next [-] | |||||||||||||
Instant startup times are really nice. You definitely notice the difference. It also means that you can be a bit lazier when creating wrappers around those tools (running 1000's of times isn't a problem when the startup is 1ms, but would be a problem with 40ms of startup time). Distribution can also be a lot easier if you don't need to care about the user having a specific version of Python or specific packages available. | ||||||||||||||
| ||||||||||||||
▲ | seabrookmx 3 days ago | parent | prev | next [-] | |||||||||||||
Go is a great option for CLI tools (even though I'm not a fan of the language itself). Python CLI apps can be a big pain to distribute if you have a bunch of dependencies. I think this is also why Rust and Zig are also attractive.. like with Go it's easy to create a statically compiled binary you can just cp into /usr/local/bin. | ||||||||||||||
▲ | efnx 3 days ago | parent | prev | next [-] | |||||||||||||
I will always reach for a language that has sum types, pattern matching and async support. Catching errors at compile time is a boon too. It doesn’t have to be Rust, but after those requirements- why not? | ||||||||||||||
▲ | astrange 3 days ago | parent | prev | next [-] | |||||||||||||
> in fact I don't really get the GC hate outside of game dev Most mobile games are implemented in a system with GC (Unity with il2cpp), and it's not even a /good/ GC, it's Boehm. | ||||||||||||||
| ||||||||||||||
▲ | pjmlp 2 days ago | parent | prev | next [-] | |||||||||||||
It is basically cargo cult, whole graphical workstations have been built with GC based languages 50 years ago. - Interlisp => https://interlisp.org/ - Cedar => https://www.youtube.com/watch?v=z_dt7NG38V4 Imagine what we could have today with hardware that is mostly busy running Electron crap and CLI tools from the 1970s. | ||||||||||||||
▲ | K0nserv 3 days ago | parent | prev [-] | |||||||||||||
Not Python because getting Python to run on different machines is an absolute pain. Not Go because of its anaemic type system. |