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

> I wish the article would also mention Nim, a Python-like language that compiles to native, and compare it to Mojo.

I would not say that Nim is “a Python-like language”. The only significant similarity is in the usage of indentation instead of curly brackets. To me, it is much more similar to Pascal/Ada/Oberon, but less verbose.



I have not programmed much in Nim, and I think you are mostly right, but Nim also have keywords and concepts not found in Pascal/Ada/Oberon that clearly comes from Python, like "yield" and iterators:

    iterator iota(n: int): int =
      for i in 0..<n: yield i


I think the 1977 Icon language is where the generator concept originated. It had many other cool features I have not seen in other languages since: https://en.wikipedia.org/wiki/Icon_(programming_language)#




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

Search: