QuTech-Delft / OpenQL

OpenQL: A Portable Quantum Programming Framework for Quantum Accelerators. https://dl.acm.org/doi/10.1145/3474222
https://openql.readthedocs.io
Other
100 stars 44 forks source link

recursive visiting the IR is powerful but currently hard to understand #484

Open jvansomeren opened 1 year ago

jvansomeren commented 1 year ago

Defining various forms of visiting the IR tree exist: from just bottom-up visiting to extract information, to pre- and post-walkers that, also taking context into account, transform an IR tree. When I now read those visitors, there is lots of C++ machinery around to make them work and I don't understand why it must be so much machinery. From CoSy experience, I didn't expect that and those were really powerful walkers. So propose to revisit their design and interfaces and investigate what makes them so complicated. Is it the IR structure itself that is the problem? Is it C++? Are the visitors over-designed?