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
Uh oh!
There was an error while loading. Please reload this page.
-
We have implemented a prototype Rust backend and it is available in this repo.
For code generation, we used a fork of
language-rustby 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-rustis 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:
stepandinternal_stepfunctions have a different shape than I would potentially prefer. Namely, I would like theinternal_stepnot to execute the trigger functions but to return verdicts and arguments for trigger functions to the publicMonitor::stepfunction.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