I think the question of "Why use Nim?" is incomplete without context. There 
should be several specific variants of this question, each with a somewhat 
different set of arguments:

  * Why use Nim to teach 
[CS101](https://www.i-programmer.info/news/150-training-a-education/7511-python-becomes-most-popular-cs-teaching-language.html)?
  * Why use Nim for mobile apps?
  * Why use Nim for desktop apps?
  * Why use Nim for desktop games?
  * Why use Nim for Web front-end?
  * Why use Nim for [Web 
back-end](https://www.techempower.com/benchmarks/#section=data-r17&hw=cl&test=json)?
  * Why use Nim for a new OS kernel?
  * Why use Nim for command-line tools?



Etc. And sometimes the answer will be "No, Nim isn't the best option". In some 
comparisons C, Python, or ye olde shell script still wins... 😉

Since I focus almost entirely on **command-line tools** , I can provide the 
following reasons for using Nim to write, let's say, [a new 
ls](https://github.com/ogham/exa), 
[rsync](https://github.com/kristapsdz/openrsync), or nmap:

  * Much more productive and safer than C/C++, with almost no performance loss.
  * No run-time, and much smaller binary sizes than Rust, D, Go, Haskell, etc.
  * Nim is more portable than some languages to obscure Unix variants (ex. all 
BSDs, Solaris, AIX, MINIX), HaikuOS, etc. Many competing languages 
([Dlang](https://forum.dlang.org/thread/[email protected]?page=3),
 Swift, .NET Core, Julia, Red/System) don't even support OpenBSD! Many also 
don't support some CPU architectures (ex. RISC-V), while Nim is easy to port 
because it can leverage just about any C compiler.
  * Having the option of using a different backend (gcc, msvc, [IBM z/OS 
XL](https://en.wikipedia.org/wiki/IBM_XL_C/C%2B%2B_Compilers), 
[icc](https://en.wikipedia.org/wiki/Intel_C%2B%2B_Compiler), 
[aocc](https://en.wikipedia.org/wiki/AMD_Optimizing_C/C%2B%2B_Compiler), 
[pgi](https://www.pgroup.com/index.htm), etc) means better performance than 
LLVM (Rust, DMD, Crystal, Swift, Zig, Pony, Kotlin Native, 
[etc](https://llvm.org/ProjectsWithLLVM/)) on some specialized platforms.
  * Nim is still a [permissive licensing champion](https://archive.fo/YShGX), 
with no restrictively-licensed dependencies and all tooling being MIT-licensed 
(or [equivalent](http://copyfree.org)). This means Nim can be used in all 
possible contexts.
  * See the "base must compile base" reasoning for [OpenBSD rejecting base 
components written in "safe" 
languages](https://duckduckgo.com/?q="Integrating+safe+languages+into+OpenBSD%3F";)
 like Rust. If any language can supplant C there, the compiler itself would 
have to have very minimal compile time. Here Nim is second [only to 
Vlang](https://archive.fo/k5XfE#selection-473.0-478.0) (which isn't a serious 
competitor yet), and orders of magnitude better than anything based on LLVM.


Reply via email to