quil-lang / quilc

The optimizing Quil compiler.
Apache License 2.0
457 stars 72 forks source link

compile_protoquil C function does not strip HALT, circuits, gates, etc. #896

Open notmgsk opened 1 year ago

notmgsk commented 1 year ago

When using the quil-to-native-quil RPC handler with protoquil: true, the resulting compiled program will have non-"protoquil" parts stripped out of it. This is achieved by app's process-program function. The compile_protoquil C function does not do the same.

One option I can think of is to move the process-program logic into a new "transform" pass in cl-quil where it will be available to quilc's RPC server and C library, rather than duplicating the code into both.