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

Wasm cairo integration #101

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cryptonerdcn
Copy link

@cryptonerdcn cryptonerdcn commented Jul 18, 2023

Because most of the codes in "Cairo by Example" are pure Cairo codes, adding an online playground for Cairo makes some sense.
Of course, this playground used https://github.com/lambdaclass/cairo-vm.

You can see how it works.
ezgif com-video-to-gif

or see this video.

@cryptonerdcn
Copy link
Author

Can you review this PR, sir?
@unbalancedparentheses @MegaRedHand @juanbono @klaus993 @SantiagoPittella

Copy link
Contributor

@SantiagoPittella SantiagoPittella left a comment

Choose a reason for hiding this comment

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

This looks awesome. I've been testing it and is really useful. Thanks you!

Just a couple of comments:

  • We should, instead of having the binary commited we should add an step in the deployment that runs the compilation (we could do that if you want).
  • Saw that you are using the version 2.0.0-rc2 of the compiler. Can you upgrade to latest?
  • Also, for programs it works awesome. But with contracts it tries anyways to run the main entrypoint. Can you change that? Basically changing the compiler for contracts, and not running any entrypoint, just check if it compiles.

Really great job 🚀

@cryptonerdcn
Copy link
Author

cryptonerdcn commented Jul 19, 2023

We should, instead of having the binary commited we should add an step in the deployment that runs the compilation (we could do that if you want).

Yes, let me make a script for this.

Saw that you are using the version 2.0.0-rc2 of the compiler. Can you upgrade to latest?

It is Compiler v2.0.1 I think. I will update it to 2.0.2.

Also, for programs it works awesome. But with contracts it tries anyways to run the main entrypoint. Can you change that? Basically changing the compiler for contracts, and not running any entrypoint, just check if it compiles.

Surely we can! It already has the function for this proposal. And all we need is just sth. like "Compiled success." or "Compiled failed." in the result dialog?

BTW: Can you tell me how to set up github pages for hugo.yml? I set my fork repo like this but .css and .js files are not there.
https://cryptonerdcn.github.io/cairo-by-example/index.html
スクリーンショット 2023-07-20 0 04 33

@SantiagoPittella
Copy link
Contributor

Surely we can! It already has the function for this proposal. And all we need is just sth. like "Compiled success." or "Compiled failed." in the result dialog?

Yes! That would be amazing.

BTW: Can you tell me how to set up github pages for hugo.yml? I set my fork repo like this but .css and .js files are not there.

I'm hooking you up with someone that can answer this. He should be answering soon.

@klaus993
Copy link
Contributor

klaus993 commented Jul 19, 2023

BTW: Can you tell me how to set up github pages for hugo.yml? I set my fork repo like this but .css and .js files are not there.
https://cryptonerdcn.github.io/cairo-by-example/index.html

Hey there!
Thinking about what could be going wrong, I see that the extra stuff I see in your fork is the assets/ directory. Does this work out of the box with hugo build/serve when testing locally? Maybe we need to modify the hugo.yml to correctly deploy this new code/directory to GitHub Pages. Maybe this doesn't end up in public/, that is what's uploaded to GitHub for the deploy. This is just my gut feeling, I can run some tests and get back to you, as it could be an entirely different issue, but let's see.

@cryptonerdcn
Copy link
Author

Hey there! Thinking about what could be going wrong, I see that the extra stuff I see in your fork is the assets/ directory. Does this work out of the box with hugo build/serve when testing locally? Maybe we need to modify the hugo.yml to correctly deploy this new code/directory to GitHub Pages. Maybe this doesn't end up in public/, that is what's uploaded to GitHub for the deploy. This is just my gut feeling, I can run some tests and get back to you, as it could be an entirely different issue, but let's see.

Thanks for the reply @klaus993 ! In the local machine, it works perfectly.
スクリーンショット 2023-07-20 1 52 42

In the Upload artifact step of my repo's github action, it seems everything was uploaded.
https://github.com/cryptonerdcn/cairo-by-example/actions/runs/5587110247/jobs/10212023055
スクリーンショット 2023-07-20 1 55 36

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

Successfully merging this pull request may close these issues.

3 participants