HACKER Q&A
📣 rgupta999

Command Line Utility Rewrite in Go?


https://www.youtube.com/watch?v=zThQPZVWScs https://github.com/rantlabs/RANT

I created a command line utility / app I have written in Python. I want to rewrite the app in a language that gives me the ability to easily compile into a binary for Mac/Linux/Windows and I want increase the concurrency performance alot. Ideally I could have as many threads running as the server / host could handle (current limit with my python code is around 30 threads). I would love to be able to hundreds of threads or more.

Does anyone have good suggestions on what language I should try writing this in. I believe Go is likely the correct choice, but I am curious about Elixir.

Also if anyone is interested in helping rewrite this, would be happy for the help.

Thanks!


  👤 weatherlight Accepted Answer ✓
Both Go and Elixir are solid picks. Go's concurrency model with goroutines and channels is a breeze to work with and is great for squeezing out a lot of performance. Cross-compiling to different platforms is straightforward, too.

Elixir, on the other hand, is a champ at handling many concurrent connections with low overhead, thanks to its Actor Model. If your utility needs to be resilient and fault-tolerant, the BEAM (Erlang VM) could really shine.(check out the burrito or bakeware elixir libs.)

I'd say, give both a shot with a small prototype. You can't really go wrong, they're both solid for concurrent programming.

If you're also thinking about going down the rabbit hole of systems programming languages, Rust might be a worthy contender. It's not as easy to pick up, but the performance and memory safety it offers are top-notch.


👤 ezekg
I wrote my company's CLI [0] in Go using the Cobra framework, and I don't regret it at all. Cross-platform compilation is a breeze, and having a single binary to distribute is *chef's kiss*.

[0]: https://github.com/keygen-sh/keygen-cli