Skip to content

implement compile_protoquil#15

Merged
MarquessV merged 2 commits into
mainfrom
7-implement-compile-protoquil
Dec 2, 2022
Merged

implement compile_protoquil#15
MarquessV merged 2 commits into
mainfrom
7-implement-compile-protoquil

Conversation

@MarquessV
Copy link
Copy Markdown
Contributor

@MarquessV MarquessV commented Nov 29, 2022

Closes #7

I also tried to see if I could find a workaround for #12 but I don't think it's possible without changing libquilc.

@MarquessV MarquessV requested review from Shadow53 and notmgsk and removed request for notmgsk November 29, 2022 19:37
Copy link
Copy Markdown
Contributor

@Shadow53 Shadow53 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of questions

Comment thread src/lib.rs
let mut compiled_program: quil_program = std::ptr::null_mut();

unsafe {
quilc_compile_protoquil.unwrap()(program.0, chip.0, &mut compiled_program);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this fail? Is there an errno we should be checking or anything?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point to bring up. I wondered about this while writing the original bindings, and, IIRC, you do get back an error but there isn't much context to go along with it. One of those things that needs improving on the quil-lang side.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, what Mark said. The error is a generic ERROR_FAIL message. Implementation here. We could implement it in all the methods now, but seems better to revisit when we actually get some real errors back from the lib side.

@MarquessV MarquessV merged commit 3d6fbb9 into main Dec 2, 2022
@MarquessV MarquessV deleted the 7-implement-compile-protoquil branch December 2, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement compile_protoquil

3 participants