quil-rs icon indicating copy to clipboard operation
quil-rs copied to clipboard

Support an immutable program

Open MarquessV opened this issue 1 year ago • 1 comments

Downstream, immutable programs could be a helpful tool. For example, a template program that can be used as a base for similar programs, but the template itself shouldn't change. Maybe this is scope creep, but supporting immutability is a something a Rust SDK is well suited to solve. In Python it's hard to guarantee the immutability of something, but in a Rust SDK w/ Python bindings it's relatively trivial to lock things down.

I think it could be implemented as a new type wrapper around a private Program:

pub struct ImmutableProgram(Program)

with methods to go from a Program -> ImmutableProgram and back. The API could be as simple as that, but we could also port read only methods to the new type wrapper.

MarquessV avatar Jul 12 '23 17:07 MarquessV