▲ | kllrnohj 3 days ago | |||||||||||||||||||||||||||||||
> I don't see why CLI tools are special in any respect. Because they don't grow large or need a multi-person team. CLI tools tend to be one & done. In other words, it's saying "Zig, like C, doesn't scale well. Use something else for larger, longer lived codebases." This really comes across in the article's push that Zig treats you like an adult while Rust is a babysitter. This is not unlike the sentiment for Java back in the day. But the reality is that most codebases don't need to be clever and they do need a babysitter. | ||||||||||||||||||||||||||||||||
▲ | vlowther 3 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
It isn't even really that -- most CLI tools are single-threaded and have a short lifespan, so your memory allocation strategy can be as simple as allocating what you need as you go along and then letting program termination clean it up. | ||||||||||||||||||||||||||||||||
▲ | johncolanduoni 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
I think this focus cuts both ways though - most "one & done" CLI tools will not be bottlenecked by a GC. Many are so performance insensitive that Python is totally fine, and for most of the rest the performance envelope of Go is more than enough. Why would I reach for Rust or Zig for these? "I like C, Zig is like C" is a totally acceptable reason, but then this whole article is preaching to the choir. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | Klonoar 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Rust isn’t a babysitter so much as it is having a second adult in the room that you’re bouncing stuff off of; they just care about memory safety and will tell you when you’re doing something stupid. You can override them if you want to. | ||||||||||||||||||||||||||||||||
▲ | cestith 3 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
Do you know any other languages that tend to be safer than C and suitable for CLI tools but without the borrow checker? Over many years I’ve seen a lot in C++, Go, Perl, Python, Ruby, Pascal, various shells, assembly, Java, and some in Haxe, Ada, Lisp, Scheme, Julia, forms of Basic, and recently JavaScript or Typescript. Most of those are more memory safe than C. None of them have the borrow checker. This leaves me wondering why - other than proselytizing Zig - this article would make such a direct and narrow comparison between only Zig and Rust. | ||||||||||||||||||||||||||||||||
|