New Playground! - Blast

Check it out here
[https://jglts-daaaa-aaaai-qnpma-cai.ic0.app/]

I hope you have fun!

I will add some more blasts and announce in on Twitter in a few days.
If you have ideas or code for presets they will be much appreciated.

I will add soon:

  • more blasts
  • sharing
  • better canister interface inspection
15 Likes

Cool thank you for sharing! Should definitely help with onboarding newcomers

1 Like

Added canister inspection

Tries a different approach when explaining interfaces

Added table display

3 Likes

Added Motoko to the playground.


Internet Computer Content Validation Bootstrap
You can deploy & redeploy test code.
You can also hit “Make Immutable” and then share your blast.
I think it will fit when someone wants to make a small contract for the purposes of proving airdrop fairness & drawing a random number, etc.

I am using [ GitHub - dfinity/node-motoko: Compile Motoko smart contracts in Node.js and the browser. ] which I believe is originally intended for the VS Studio Code addon? and the Motoko Playground.
I very much appreciate that repository.

There is an issue I got, but figured out a temporary workaround [ Subsequent compilations of the same code result in different wasm · Issue #25 · dfinity/node-motoko · GitHub ]
One of the problems is having deterministic compilations.
Which also includes finger-pointing Motoko compiler versions for older code.
@rvanasa

If it’s outside of the scope of this package, I will fork it, but it doesn’t seem to be a lot of hassle to do.
I will also need to prove that Blast’s front end isn’t cheating, which probably means I’ll give code to users to verify contracts on their own. Something using the node-motoko package.

6 Likes

Happy to announce that I’ve added inline Motoko (no need to install it in canisters)
This example demonstrates stable nested @ZhenyaUsenko’s HashMap, probably something every new dev wants to do.


Changed the editor from Codemirror to Monaco (used in VScode)
Added installing packages
Added Motoko syntax highlighting + compiler checks & errors

@rvanasa I ran into a problem (while using run). Adding more than 20 lines of code results in “Maximum call stack size exceeded” which somehow magically fixes after 3-4 retries. Can I increase the limit somehow?

My goal with these examples is to help the next Mark Zuckerberg make a web3 startup from his dorm room. I will be adding more, usually in response to discord #motoko questions. There are currently 3 pages (blasts) here [https://jglts-daaaa-aaaai-qnpma-cai.ic0.app/]

@claudio @rossberg @ggreif I hope you approve of what I am doing with your language. I will be happy to take any criticism.

Edit: I am wondering - are there plans to make classes stable? asking because the community is going towards rewriting all data structures to work on data instead of being inside the data - like the example above

2 Likes

It’s currently possible to compile and run WASI to get around the stack overflow issue (example). My understanding is that this works for everything except actors / actor classes, so I’ll ask the team if there’s a way to add support for these so it could fully replace the interpreter in this situation.

Well, except for the strange goal – if there’s one thing the world doesn’t need, then it’s another sociopath with way too much unchecked power. ; )

3 Likes

Oh, I didn’t know that will solve it. Thanks, it’s enough!

It would be great if we can create an actor and call its functions (without installing), but I don’t need that right now.

1 Like

I don’t think the wasi compiled code will ever perform a GV, since GC is currently tied to IC messaging (unless @nomeata slipped that in somehow). I expect realistic examples will run out of memory.

I’m not sure why the stack overflow occurs , but suspect it’s because js_of_ocaml can’t handle indirect tail calls, and the interpreter relies on them heavily.

http://ocsigen.org/js_of_ocaml/latest/manual/tailcall