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

Support for Cairo builtins #2718

Merged
merged 15 commits into from
Apr 16, 2024
Merged

Support for Cairo builtins #2718

merged 15 commits into from
Apr 16, 2024

Conversation

lukaszcz
Copy link
Collaborator

@lukaszcz lukaszcz commented Apr 10, 2024

This PR implements generic support for Cairo VM builtins. The calling convention in the generated CASM code is changed to allow for passing around the builtin pointers. Appropriate builtin initialization and finalization code is added. Support for specific builtins (e.g. Poseidon hash, range check, Elliptic Curve operation) still needs to be implemented in separate PRs.

@lukaszcz lukaszcz added the cairo label Apr 10, 2024
@lukaszcz lukaszcz added this to the 0.6.2 milestone Apr 10, 2024
@lukaszcz lukaszcz self-assigned this Apr 10, 2024
@lukaszcz lukaszcz marked this pull request as ready for review April 12, 2024 10:00
@lukaszcz lukaszcz marked this pull request as draft April 12, 2024 10:14
@lukaszcz lukaszcz marked this pull request as ready for review April 12, 2024 10:28
@@ -5,7 +5,7 @@ import Juvix.Compiler.Casm.Data.Result
import Juvix.Compiler.Casm.Language

fromCairo :: [Cairo.Element] -> Result
fromCairo elems0 = Result mempty (go 0 [] elems0)
fromCairo elems0 = Result mempty (go 0 [] elems0) mempty
Copy link
Collaborator

Choose a reason for hiding this comment

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

since there are two mempty, it would be more readable with record syntax

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@lukaszcz lukaszcz requested a review from janmasrovira April 16, 2024 14:16
@lukaszcz lukaszcz merged commit ad76c7a into main Apr 16, 2024
4 checks passed
@lukaszcz lukaszcz deleted the cairo-builtins branch April 16, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Cairo builtins
3 participants