I have been kicking an idea around for an HDL toolchain for some time now. As part of the lowering process, optimizations happen at various levels of description of a circuit.
I would like to use the nanopass framework for some of these kinds of optimizations. However, I am currently doing this in Common Lisp to support dynamic generation of core images of the Lisp process.
My question is, how feasible is it to implement a nanopass framework in Common Lisp? I want everything to remain in Common Lisp to create a uniform environment for working with hardware, everything from the hardware language to the simulator would be written in Common Lisp.
To be clear, I am fine dumping a hardware description to a separate file for the Racket or Scheme versions to optimize, but would like to reduce the number of languages used.