quil-lang / quilc

The optimizing Quil compiler.
Apache License 2.0
454 stars 73 forks source link

Expose basic Quilc functionality via a C API #788

Closed kartik-s closed 2 years ago

kartik-s commented 2 years ago

Problem

I want to be able to use Quilc as a shared library, e.g. libquilc.[so|dll|dylib]. This would serve as lighter alternative to the existing RPC server mode for users who want to use Quilc from other langauges like C or Python, especially when working on a single local machine.

Scope

As a first pass, I am proposing that this shared library should expose Quilc functionality for:

This is a small but useful set of functionality to begin working off of.

Solution

We can use sbcl-librarian to expose Quilc functionality as a shared library.

stylewarning commented 2 years ago

This sounds like a good blueprint for starting a C API effort with quilc. Exciting!

karlosz commented 2 years ago

We'll probably want a higher level Python API to wrap this functionality as well.