Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement compile_protoquil #15

Merged
merged 2 commits into from
Dec 2, 2022
Merged

Conversation

MarquessV
Copy link
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 notmgsk and Shadow53 and removed request for notmgsk November 29, 2022 19:37
Copy link
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

let mut compiled_program: quil_program = std::ptr::null_mut();

unsafe {
quilc_compile_protoquil.unwrap()(program.0, chip.0, &mut compiled_program);
Copy link
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
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
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