3 ms·
The answer, as with many things is: it depends. What does your CLI app do? What platforms are you intending it run on? Is it going to be doing a lot of CPU-int
by kintamanimatt 14y ago
The answer, as with many things is: it depends.
What does your CLI app do? What platforms are you intending it run on? Is it going to be doing a lot of CPU-intensive work? Is this CLI app going to be long-lived, run infrequently (e.g. fsck), or run perhaps many times a day by an actual real user (e.g. grep)? Is your app expended to be part of a Unix pipeline? All of these things are the real deciding factor between a compiled language and scripting language.
If it's not doing anything particularly computationally expensive, perhaps a scripting language like Ruby or Python. Hell, you could even do it with JavaScript with NodeJS. CLI apps are usually utilities and their start-up time often matters. With any of these scripting languages there will be a palpable start-up time. This might not be so important if your CLI app is to be run infrequently, or is otherwise something that's long-running.
If you're writing something that's going to munch and crunch data, or is otherwise doing a lot of calculations, or is going to be run frequently and needs a fast start up time, Go, C, C++ are good bets. There are probably others that may be appropriate, but I'm not familiar with Haskell, etc.
The vast majority of CLI utilities are written in C or C++ and this is for a reason. Not many are written in scripting languages, although some are, such as Puppet, Vagrant, Fabric, etc.
- klaussilveira 14y agoIt's a very big application, that requires an MVC approach for commands and their subcommands. That's why i'm looking for a language that has been battle-tested for complex CLI applications. This means frameworks, libs, docs and more. From what i could see, Ruby stands out in these terms. I'm not actually looking for a specific language feature, but the ecosystem.