4 ms·
I’m surprised they said Rust is their new language of choice for CLI tools. I’m no expert but always saw Go as the better choice for CLI tooling where performan
by vonseel 4y ago
I’m surprised they said Rust is their new language of choice for CLI tools. I’m no expert but always saw Go as the better choice for CLI tooling where performance is important, Rust more of a low level language for highly performant libraries and tools, and Python a good choice for scripting or plumbing that needs to work and be easily maintainable, without special performance concerns (Python is my primary language, I’ve only dabbled in Go and Rust).
- coxley 4y agoGo is the go-to for many teams, especially CLIs. Unfortunately there are strong opinions held by high influence on Rust vs. Go instead of Rust + Go. To the point of finger pointing any chance they could with "see??" Many have left as a result. Weird hill to die on. :)
- mustache_kimono 4y ago> I’m no expert but always saw Go as the better choice for CLI tooling where performance is important I'm no expert in golang, so golang may in fact be better(?) by some metric of better, but as the author of a Rust CLI tool[0], I will say that Rust is extremely performant, and pretty fantastic at this very use case. It seems like a sweet spot to me. [0]: https://github.com/kimono-koans/httm https://github.com/kimono-koans/httm
- vonseel 4y agoSure, I wasn't really implying that Go is more performant than Rust, but that Go is a better choice where performance is important, but not so important that you'd forgo the simplicity of Go for Rust's more complex development style (borrow checker, etc?). I'd really love to get into Rust (and Go, tbh) but haven't needed the performance when I'm working on personal stuff and it's generally 1000x faster for me to jump in Python and write a quick script, using threading or asyncio when I need more perf and my program is IO-limited.
- mustache_kimono 4y ago> Go is a better choice where performance is important, but not so important that you'd forgo the simplicity of Go for Rust's more complex development style (borrow checker, etc?). I understand why someone might feel this way, but I think it may misunderstand/misinterpret a few things. First, a more complex development style is not a chronic condition, because you become proficient in the language you work in. For instance re: the borrow checker, you begin to understand what it wants you to do, and why. Rust may be harder to pick up, but, once you do, it's just as easy to build a CLI tool in Rust. Second, obviously, it depends on the type of CLI tool you're writing. Maybe the CLI tools Meta are writing look less like Python scripts, and more like Valgrind or tcpdump. Third, not to disparage golang in any way, but golang's simplicity is something of an illusion. Because all "simplicity" is an illusion. It breaks down quickly at the edges. As someone else noted, you should take a look at "I want off Mr. Golang's Wild Ride"[0] but also perhaps "Simple Made Easy"[1]. [0]: https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-ride#garden-variety-takes-on-go https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-... [1]: https://www.youtube.com/watch?v=SxdOUGdseq4 https://www.youtube.com/watch?v=SxdOUGdseq4
- vonseel 4y agoThose were very good points and def. introduced a new way of thinking about it! I will check out the links, thanks!
- didip 4y agoI am surprised too. If your number one problem is short deadlines, using Go is simply more obvious for CLI.
- mustache_kimono 4y agoI think this makes some sense if you're a golang shop, sure. But FB doesn't seem to be using it much anywhere else.
- al_mandi 4y agoA good read about why golang does badly: https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-ride https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-...