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
Wasm cairo integration #244
Wasm cairo integration #244
Conversation
Wow this is amazing @cryptonerdcn ! Thank you for this.
Can you show an example of the returned string in case of success / error ?|
|
looks dope |
Amazing work! I'll take a look and see if my knowledge in wasm allows me to add some comments and give feedbacks. 👍🏻 |
This is still in progress. I will update it later.
Maybe there is a more elegant way to do this? Well this code still works so we can keep it and do sth. more important.
My bad. Yes I think we can use only one WASM file at the root of the book and don't need to duplicate it. I marked this one as a problem need to be solve. |
Also, I'm super curious to look at how you got Cairo1 WASMed. We can do wonders with that |
This is part of what I did for the Pragma Hackathon & Starknet Shanghai workshop. |
ad7dea9
to
e310347
Compare
Rebase to main for review. |
@enitrat Just to make sure. I guess we don't need to do anything with Starknet's contract (Maybe need to add a tag looks like Also I found See https://starknetastro.github.io/cairo-book.github.io/ch03-01-what-is-ownership.html |
If you wish to disable the play button for a code block, you can include the noplayground option on the code block like this:
|
https://taikai.network/pragma-oracle/hackathons/Cairo1hackathon/projects/clj5axhze03yuu601gir28kbr/idea |
e310347
to
b484130
Compare
It supports Cairo Compiler 2.0.1 and can show full debug info now! (Although it still cannot display exactly the same error information). If you need to check this locally, you need to copy |
The repo for WASM-Cairo: https://github.com/cryptonerdcn/wasm-cairo |
Is it possible to remove the
line? |
Reading the deployed version I stumbled upon this:
|
Do you mean https://starknetastro.github.io/cairo-book.github.io/ch01-02-hello-world.html this version? It is an old version that doesn't change since this PR was established. I will update it soon.
Yes, it is possible. |
0cde989
to
7c5cb1e
Compare
@enitrat I updated it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing. TYVM, @cryptonerdcn
@cryptonerdcn what's the process when updating compiler versions now? |
Because I have to make some manual changes to the official Cairo repo, there is still no easy way to update the compiler version automatically. |
I don't think it will be a big deal anyway, just wanted to know it'd be possible! |
Hey guys I am working on my project Wasm-Cairo. Basically, as its name, by compiling Cairo's rust implementation to Wasm, you can use Wasm-Cairo to complie&run the Cairo code in the browser.
I also find a way to use it in the mdbook and I did it. You can test it here.
Issues:
book.js
call this function. Can anyone help?Some examples:
Hello world example:
Another example:
Panic example: