Finally I have managed to translate a 2400 lines Python Code to a nearly 2700 lines Nim code. The hardest part was a 550 lines long Python generator which calls itself (recursively) in many places and is called itself by another generator. This was only possible with the brilliant iterate macro by Timothee Cour. Unfortunately this had a bug when called recursively. Only with the fantastic help (sometime within seconds) of very kind people on Gitter, I managed to apply a non-trivial fix to that macro -- see https://github.com/timotheecour/Nim/issues/378
I've learnt a lot about macros and I'm still learning.
My personal conclusion is as follows:
let X_id = ident"X" .... quote do: ..... `X_id`
I am convinced Nim can replace Java sometime in the future if the community grows further, some big players jump on the bandwagon such that it gets on par with Javas wealth of libraries.
I predict a bright future in the growing market of embedded systems and I can image a mobile phone with a Linux kernel but infrastructure based on Nim.
Many thanks to the creator and the contributors to the Nim language!
I'm only missing some quoting mechanism to replace the boilerplate [...]
Ask and you shall receive: https://github.com/PMunch/macroutils#building-trees
The superQuote macro from my macroutils module is intended to help will the various grievances of the quote functionality. I'm not sure it 100% covers what you want to do, but if not please leave a feature request for it.