Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm coming at this from a starting point of "I want a fairly safe modern compiled language" - I'm a lot more interested in hearing why I'd choose nim over a similar language than why I'd choose it over e.g. python (which is such a different language that it's hard hard to even begin to compare, IMO). Maybe that's not the same question that a general audience would ask.


I think that you make a good point, there will likely be a fair amount of readers asking those questions.


I think the chapter has a good overview of other language comparisons, but the final table should probably include a few others like D and OCaml (and if you're including those you should also include Lisp via SBCL and Racket..) and stress that for Nim the GC is not only "Yes, multiple" but also optional/bypassable, which is of great importance to C/C++ people. Maybe an appendix for more details / more languages? Rust and D probably deserve more details but anything with a forced GC, probably not... So I second the opinion that perhaps a little too much time is spent comparing with Python, but you're in a much better position to tell how many newcomers to Nim are actually dropping Python just about completely for it. (For me, even though I'm still in the playing stage with Nim, I can already say with certainty Nim won't replace the things I use Python most for already, especially since I'm committed to a preference for dynamic typing over static, and I would argue the sentence on page 17 that "Replacing Python is especially easy because its syntax is so similar to Nim's" is false for any non-trivial Python code...)

The biggest dimensions for me when first evaluating a new language that I might want to learn more about someday are typing (dynamic, untyped, or static, and if static whether that's of the Haskell variety or more mildly anti-certain-class-of-errors-driven plus performance-driven like most other things) and garbage collection (none, forced, or optional). That info helps me immediately bucket what sorts of applications this new language could help me take on in a better way than other languages I know. With Rust, watching it develop I didn't think too highly of their decision to remove the @ sigil (that is, remove the GC from the core language). That's what ultimately made me think of Rust only as something I'll ever try to learn and use if I come across the narrow (in my interests) problem domain of "I absolutely require a Safe program but for some reason I can't use a GC language."

I think your first 12 pages do a pretty good job at highlighting some of the hooks that originally put Nimrod on my watch list whenever ago, though personally I'd put the style insensitivity thing last (and it doesn't cover things like omitting parens for single-arg or no-arg functions but you mix that particular style choice around throughout the chapter). Those hooks, including some you don't really cover yet, are speed (like, at or even sometimes beating C-level speed), all three of optional, tunable, implementation-detail-swappable garbage collector with access to malloc/free or even just embedding C code directly like you might embed ASM code directly in C code, inferred static typing to minimize ceremony, the huge list of pragmas to tell the compiler -- which humbly admits it tries its best but is not all-knowing -- about useful things for performance or other reasons, user-defined compiler demands (not "hints", as it's not optional) to make optimizations via term-rewriting macros, style choices (but sadly no Lisp-like dashes in function names), and an awareness of and support for many higher level language features enjoyed by other languages. No forced main() and whitespace indentation make it immediately comparable to Python on the surface which is a nice bonus (for those that like Python anyway). Taking all these things together, there isn't really a comparable language, or at least not one that's on very many people's radar. I think the only language worth mentioning (or not, per strategy) as one that might surprisingly come up from behind in n years and eat Nim's potential big lunch by then is Pony.

Another nitpick, in the section on functional programming, why use var instead of let? The immutability story is just as important as first class functions... And you're missing the item (->) in the list of things the modules were imported for...


Thank you for this very thorough review :)

I agree with many of your points and I will do my best to incorporate them into my book.

The reason I have compared Nim to Python so heavily is for two reasons:

1) I used to be a Python programmer and chose Nim as a replacement.

2) I see a lot of Python programmer's trying out Go and saying describing it as a "better, faster Python". Perhaps that is just a HN illusion. I in turn believe that Nim is far closer to Python than Go will ever be. I am trying to show people that. Perhaps I should be comparing Nim to Go more as well.

Your list of hooks is brilliant. It's hard for someone like me to remember features which make Nim unique since I use it almost every day, so these are really useful. I will see about mentioning some more of those things, in order to hopefully grab more people's attention!

I have heard of Pony but have not had a chance to try it out. Looks promising.

> Another nitpick, in the section on functional programming, why use var instead of let? The immutability story is just as important as first class functions... And you're missing the item (->) in the list of things the modules were imported for...

Will fix, thank you! I have started out using 'var' then changed everything to 'let' (where appropriate), must have missed that one.

Thanks again!


I don't think I'll ever fully understand the Python --> Go transition, I sometimes have to shrug and attribute it to the power of big company backing. I think the drain has mostly been from Python web and networking programmers, probably a bunch of devops scripters too, but with web pretty much everything else that offers easy to use and high performance web servers out of the box is a cause for drain too, so I think the transition to Go directly is probably less severe than what one might think from HN submissions. Python is much more anyway and will remain a strong choice for many areas for years to come. For your point 2 I agree completely, for the few reasons that I can kind of understand why one would do Python --> Go, Python --> Nim (among several other viable options) ought to weigh in as a better choice based on the same reasoning, and Nim offers other extra reasoning criteria to sweeten the deal. I'm not sure how to target Go users other than to consistently show their favorite domains are done better with another language.


I also found several items in Pony to be interesting, and Andreas is very aware of Pony. One drawback of Pony is that it is written in C, while Nim is written in Nim. But a lot of the concepts in Pony are worth looking hard at :)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: