Re:Nim 2.0 thoughts
by michaelsbradley on Saturday May 15, 2021 @11:38AM
(#27166165)
> you need to import corresponding modules everywhere
It's a good practice to re-export "all modules whose types appear in public symbols of the current module".
For that and other good advice, see The Status Nim style guide:
https://status-im.github.io/nim-style-guide/03_language.html...
You import module X, which gets you objects as defined in the module Y. To use methods defined for that type, you need to import Y yourself. Python, of course, by virtue of binding objects to methods, doesn't need it.
There are some more namespacing quirks that may require one to give up on that sweet syntactic sugar to disambiguate things (two unrelated modules defining methods on a single type, with the same signature but different behaviors, and you need both modules imported for some reason?), but this is, again, something one would have to get used to. It's not a different world like Rust or Prolog.
It's not a complete showstopper, just something I keep bumping my head into now and then.