An attempt to make a prototype Rust backend #5
antanas-kalkauskas-sensmetry
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have implemented a prototype Rust backend and it is available in this repo.
For code generation, we used a fork of
language-rust
by Galois except for one piece of code that does not depend on Copilot specification where we simply pasted a string. Manipulation of Rust AST vialanguage-rust
is low level. Partially because of this, parts of this prototype backend are quite verbose and could be simplified, refactored, and cleaned up.This backend is not complete. In particular:
step
andinternal_step
functions have a different shape than I would potentially prefer. Namely, I would like theinternal_step
not to execute the trigger functions but to return verdicts and arguments for trigger functions to the publicMonitor::step
function.Example
The repository contains an example Copilot spec:
Running
from the directory of the repo produces the following Rust code:
If an appropriate main function is given, the generated code compiles (with some warnings about Rust naming conventions for unused variables as function arguments) and seems to work.
Beta Was this translation helpful? Give feedback.
All reactions