scarb icon indicating copy to clipboard operation
scarb copied to clipboard

[DRAFT] add casm json target

Open tohrnii opened this issue 9 months ago • 3 comments

Addressing #676

tohrnii avatar Apr 28 '24 05:04 tohrnii

Now that I think about it, please consider if your usage isn't already covered by a tool called universal-sierra-compiler https://github.com/software-mansion/universal-sierra-compiler/tree/master, which is already capable of compiling Sierra json to Casm json format (and has not been available when the issue has been created).

maciektr avatar May 01 '24 07:05 maciektr

@maciektr Thank you. That tool should already cover the use case. I'll close this PR.

tohrnii avatar May 01 '24 07:05 tohrnii

@maciektr After discussion with @rodrigo-pino, there are a couple things missing from the generated casm json by the universal-sierra-compiler, namely entrypoint and builtins. It might be better for scarb to produce the json file directly instead of relying on yet another tool since it already generates the sierra json file. What do you think?

tohrnii avatar May 01 '24 09:05 tohrnii

@tohrnii It can be added to the universal-sierra-compiler if you need it. Happy to accept any PRs there :)

Arcticae avatar May 07 '24 17:05 Arcticae

Hi @tohrnii!

Very sorry for the delay in response, we had a national holidays here in Poland, so I've been out of office for a bit.

After discussion with @rodrigo-pino, there are a couple things missing from the generated casm json by the universal-sierra-compiler, namely entrypoint and builtins.

I believe this should be added to USC then. I second @Arcticae here.

It might be better for scarb to produce the json file directly instead of relying on yet another tool since it already generates the sierra json file.

We do see Scarb as primarily Cairo -> Sierra compiler, and the CASM is just an addition here. We recommend using the USC wherever you rely on CASM programatically and the builtin Scarb feature for by-hand debuging. We move our tooling to use USC as well.

Would it be ok for you?

maciektr avatar May 07 '24 20:05 maciektr

Thank you @maciektr @Arcticae for the confirmation. Sounds good, I'll open a PR there. Closing this one then.

tohrnii avatar May 08 '24 00:05 tohrnii