But first I should probably leaen Nim! Have just been admiring from afar.
What I'm describing would be the inverse of Nimporter, allowing you to import Python code as a Nim library (without making Python calls). That way, you get the performance of Nim but the years of Python package development. "Transpiler" might be a better word?
I've never worked on anything so difficult so I'm really just spitballing. But... wouldn't it be cool? :)
[0] https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programm...
Besides that Nim uses UFCS, you can mimic 90% of your OOP needs without using pragmas or methods or anything like that.
Nim intentionally gives you very spartan objects. It is by no means an OOP-first or even an OOP-heavy language. The object type is little more than a storage container for named values, and should be treated as such. There is no magic like what you get with Python objects.
I've said it before, but the frequently thrown around, "it's just like Python but typed and compiled" has probably been a net negative for the language. It is syntatically similar, but once you get beyond those initial appearances it is a very, very different beast. So if you try to write Pythonesque Nim, you're not going to have a good time with it. It's no different than trying to write JavaScript like Python - they're just different languages that don't work the same way.
The macro chapter in Nim by Example is a good tutorial for writing a macro, but I don't know that it's a big improvement. For the most part, it just allows you to remove the `self: ObjectType` from methods that act on an object. I guess that's okay? But even Python makes you include the `self` in class methods.
https://nim-lang.org/docs/manual.html#procedures-method-call...
Tell me if I'm wrong.