I’m excited about Nim. I spent some time last week playing around and really liked what I see.
But somehow I found the import mechanism a bit confusing. I didn’t quite understand that importing a module makes all its members available in the current scope, but they’re also dot-accessible using the module name. And also, since func(a) and a.func() are equivalent (correct me if I’m wrong), there are like 3 ways to call a function defined in another module.
For instance, in the strutils example, if I start reading this code with no other context, I would assume that split() is defined for string types. But it’s actually a part of strutils module. And s.split(), strutils.split(s), and split(s) are all doing the same thing.
I guess you start picking these things up the more you work with a language. But I have a Python background, so code being very explicit is something I’m used to and have really come to appreciate.
Yeah, I hear you. Nim is a little different in this regard, but we do get a lot of the same sentiment. If you’re interested do give us your thoughts in this RFC on GitHub: https://github.com/nim-lang/Nim/issues/8013