-
Notifications
You must be signed in to change notification settings - Fork 3
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
Generated rust code doesn't compile #16
Comments
minor comment:
|
Thanks @womeier ! |
Welcome @workingjubilee ! Thanks for your interest in the experimental (!) rust extraction. Have you tried it yourself on examples? There is some type information available at extraction time, but it may not be complete. See sec 5.5 here https://arxiv.org/pdf/2108.02995.pdf |
@spitters I believe that this exact issue with renaming the loop keyword was discussed before (cannot remember where) but I don't think we have any pre-processing step to rename keywords. We definitely need some better tests for the rust extraction plugin. The remaining issues with vs_easy and vs_hard looks to be related to remapping of the stdlib type |
Prefixing some of these idents with fn main() {
let r#loop = loop {
};
} This may be a more general solution. |
Honestly, you have won my attention by managing to induce SIGSEGV in the Rust compiler! I will try to make the
For some cases, partial type information can be annotated via turbofished type arguments with an underscore to indicate the absent part, where relevant, e.g. let v = iter.collect::<Vec<_>>(); |
@womeier For rust extraction we have the following tests: I think they should be relevant as general benchmarks for certicoq. |
yes, we'll include them. thanks! |
Quick update: we needed a few more small manual fixes
vs easy
|
I'm trying to extract the CertiCoq benchmarks to rust and run them.
The extraction succeeds for all of them, but not all of them compile.
What works
export RUST_MIN_STACK=1000000000
otherwise the rust compiler crashes, see rustc stackoverflow (SIGSEGV) rust-lang/rust#122715)What doesn't work (see compilation errors below)
Rust extraction setup in one diff
see this diff
To set up yourself
cd benchmarks && make
for the extraction, runs one benchmark successfully (prints 100))python3 run_rust_benchmarks.py
, this callscargo run
for all benchmarks, which includes printing some lengthy s-expressions to stdout)Versions
Coq: 8.17.0
MetaCoq: v1.2.1-8.17
rustc: 1.76.0 (07dca489a 2024-02-04)
coq-rust-extraction: most recent (6e72e1c)
Errors
vs easy
vs hard
Sha fast
The text was updated successfully, but these errors were encountered: