1. 27

  2. 3

    It would be great if anyone here with practical Nim experience could write down a few paragraphs of what they think of that language.

    1. 1

      I don’t know if you’d call my experience “practical”, but back in March of 2020 I explored Nim to see if it would be a good main language for me to write general-purpose CLI programs in. The Nim files left over from my experiments contain a total of 72 non-blank lines, so I wrote perhaps 120 lines of Nim while trying it out.

      To give you an idea of my background, at the time I had used C#, C++, Ruby, and Python but not C, Go, D or Rust. I was hoping for a strict upgrade from Ruby—I wanted something about as easy to use, but with static typing and perhaps better performance.

      I liked Nim’s concise syntax and its type safety compared to Ruby. But I found Nim’s documentation (edit: and its Learn pages) difficult to learn the language from. I see that one of my leftover Nim files contains type errors in two functions that use generic types—I assume this means generics were difficult to learn. I also remember encountering some code samples in the non-experimental section of the manual that wouldn’t work without enabling certain undocumented experimental features. I submitted PRs to fix the problems I noticed, but the documentation may contain other, similar problems.

      The last straw for me was learning that despite my expectations for a recently-designed language, Nim doesn’t solve the “billion-dollar mistake” of nulls. That is, Nim allows any ptr or ref to potentially contain nil. (Nim includes an experimental notnil feature, but it does not solve the problem in practice.) I decided that if I were to go to the effort of learning a new language for my personal projects, I’d like it to be one that avoids that problem.

      I haven’t picked a replacement language in the space of imperative, null-safe languages to learn instead. Kotlin and Swift are platform-specific, and Rust requires tedious memory management for the sake of performance that my programs wouldn’t need. I’m in no hurry to find a better language, though—so far I’ve been okay using the languages I was using before in personal projects.

      1. 1

        I found Nim’s documentation difficult to learn the language from

        That’s why there is also the learn section, where you can find lots of both official and unofficial tutorials and other resources for learning the language.

        1. 1

          Sorry for the confusion. When I was trying to learn Nim, I did read that Learn section of Nim’s website in addition to the Documentation section. In my comment I left out the link to the Learn section because I had forgotten the structure of Nim’s website and I assumed all learning materials would be under Documentation.