News for hackers. Stuff that matters.
Re:Nim in 2020: A Short Recap by matthiaswh on Thursday December 31, 2020 @08:51AM (#25592666)
I've written a large-ish amount of Nim code on personal projects while using Python day to day at work, and almost every time I'm working with Nim my brain is screaming at me at how unlike Python it is.

Nim took some inspiration from Python's syntax, but the similarity is only skin deep. The construct of the language is very, very different resulting in code that usually looks and is structured differently.

IMO going into Nim thinking it will be like Python but compiled! and faster! with types! is not a good way to approach it. It is an entirely different language altogether.

Re:Nim in 2020: A Short Recap by pjmlp on Thursday December 31, 2020 @09:38AM (#25593016)
Actually it feels more like a Python flavoured Object Pascal.
Re:Nim in 2020: A Short Recap by rattray on Thursday December 31, 2020 @09:30AM (#25592948)
I'm curious - how would you describe the qualitative differences in code structure that results?

Are there ways in which Nim nudges you to structure your code in better ways than you would in Python? Are there footguns?

Re:Nim in 2020: A Short Recap by planetis on Thursday December 31, 2020 @11:51AM (#25594336)
Yeah, it values composition over inheritance (mentioned in the official tutorials) and discourages you from using methods and other OOP concepts. It's by far a procedural language. Functional style is also not preferred either, imho a good thing, fp does not result in fast code.
Re:Nim in 2020: A Short Recap by johnisgood on Thursday December 31, 2020 @03:20PM (#25596698)
I mentioned in what ways it is similar to Python, but of course it is different to it in other ways.