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

Nim?


Nim is often recommended as an alternative to Python, but how similar is it? I know it has Python-like significant indentation, but I'd have thought syntax is the least important consideration when choosing a language?


To be honest, the similarity is skin-deep only: * Python: VERY dynamic, interpreted, interactive * Nim: Static typing, compiled, non-interactive ("inim" gives it a good try tho)

That said, Nim has great metaprogramming facilities, and one of its similarities with Python is that it requires very very little scaffolding to get your program going. Unlike Java, or C, you don't need to write up classes and functions, it can literally be just a straightforward script written in Nim and it'll compile an executable from there.

It also has great modularity, so you can split up your solution into whatever makes the most sense to you.

So... I think the best way is to try it.

I'm pretty sure that if you like Python you'll like Nim.


https://github.com/nimpylib/nimpylib shows it can be made nearly identical.


This answer's @pansa2's question in a way that more leans on one aspect of Nim's greater syntactic & code transformation flexibility (which is great!), but I suspect pansa2 was more interested in differences in "idiomatic Nim" from Python for which there are more details here: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programm...


Crystal.




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

Search: