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

An ability to run sierra-compile produced casm with cairo-run #4949

Open
1 of 2 tasks
quasilyte opened this issue Jan 29, 2024 · 1 comment
Open
1 of 2 tasks

An ability to run sierra-compile produced casm with cairo-run #4949

quasilyte opened this issue Jan 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@quasilyte
Copy link

Feature Request

Describe the Feature Request

  • There is a cairo-compile that produces a sierra file
  • There is a sierra-compile that turns the sierra code into a casm file
  • There is also a cairo-run that runs a cairo file

What I miss here is the ability to run the produced casm file. It looks like the cairo-run eventually does convert the input program into casm (although it uses the SierraCasmRunner, not a casm runner directly).

It looks like the sierra-compile exists purely for the debug reasons (to see the textual casm representation of a sierra program).

There is also an issue like software-mansion/scarb#676 which is somehow related, but it's far more complicated and fundamental in my opinion.
It would be cool though to come up with some way to produce the JSON files with a new-style structured hints info (but again, it's for the future, my goals right now are much much less complicated).

Describe Preferred Solution

Since we seem to already have the building blocks needed, maybe there should be either a casm-run or a flag for cairo-run that would allow to execute the precompiled casm programs.

Describe Alternatives

I don't need a runner per-se (although it would be optimal), a simple tool like casm validator would be fine for now. A program that just tries to parse and prepare the casm program and reports whether it looks valid.

At the bare minimum, the sierra-compile docs should mention that it's not intended for any other use rather than debugging the compiler itself.

Related Code

Code in cairo-run maybe.

Additional Context

Why do I need it?

It would be much easier to do a reference implementation testing against the working casm runner. The casm docs can be improved, as well as other implementations that can run it, but only if it's easier to do this kind of testing.

If the feature request is approved, would you be willing to submit a PR?
(Help can be provided if you need assistance submitting a PR)

  • Yes
  • No
@quasilyte quasilyte added the enhancement New feature or request label Jan 29, 2024
@orizi
Copy link
Collaborator

orizi commented Mar 27, 2024

All the textual formats in the project (be it casm, or sierra) are for debugging purposes.
Stable formats such as jsons are provided by scarb for some of the files - but these should not be part of the repo here (as the Scarb binaries are generally the ones that should be used).

If you are already using the project as libraries - you should already be able to do whatever you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants