# Is there a Motoko playground for devs?

**URL:** <https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904>\
**Category:** Developers\
**Created:** [June 7, 2021, 6:56am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904 "2021-06-07T06:56:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [June 7, 2021, 6:56am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/1 "2021-06-07T06:56:20Z")

</div>

Hello,  
I am starting to learn Motoko and I am walking through the documentations which is fantastically written, but I am missing a playground where I want to just play with the code.  
Is there something like that or even a REPL where I can write Motoko code and just run without having to run all the setup?  
I am talking about something like this [https://www.typescriptlang.org/play](https://www.typescriptlang.org/play)

---

<div class="post-metadata">

**Author:** ![kritzcreek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kritzcreek/32/267_2.png) [@kritzcreek](https://forum.dfinity.org/u/kritzcreek)\
**Post date:** [June 7, 2021, 8:08am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/2 "2021-06-07T08:08:18Z")

</div>

If you’re already reading the documentation at [Motoko Programming Language :: Internet Computer](https://sdk.dfinity.org/docs/language-guide/motoko.html) every(most) code block in there already is such a playground. You can change them and press the `Run` button in the top-right to evaluate the code.

---

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [June 7, 2021, 11:15am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/3 "2021-06-07T11:15:20Z")

</div>

Thanks I didn’t know that you can change the code.  
Although this works, however I would recommend an improvement on this to be a stand alone page.

---

<div class="post-metadata">

**Author:** ![hackape](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/hackape/32/1165_2.png) [@hackape](https://forum.dfinity.org/u/hackape)\
**Post date:** [June 7, 2021, 2:57pm UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/4 "2021-06-07T14:57:29Z")

</div>

I put together a playground couple days ago. Not much, just the doc snippet moved to a standalone page.

[https://hackape.github.io/motoko-playground/](https://hackape.github.io/motoko-playground/)

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [June 7, 2021, 4:22pm UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/5 "2021-06-07T16:22:24Z")

</div>

Word of warning though. The playground supports both more features (eg. recursive actor classes) and fewer features (eg. cycle transfer, state rollback on trap) than code that is compiled to run on the internet computer. This is because it’s a simple interpreter designed to exercise some but not all of language design.

But thanks for doings this!

---

<div class="post-metadata">

**Author:** ![wang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/wang/32/446_2.png) [@wang](https://forum.dfinity.org/u/wang)\
**Post date:** [June 9, 2021, 6:10am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/6 "2021-06-09T06:10:27Z")

</div>

How feasible is it to compile moc to Wasm so we can have an on-chain compiler? What about to JS so we can build web IDEs?

---

<div class="post-metadata">

**Author:** ![chenyan](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chenyan](https://forum.dfinity.org/u/chenyan)\
**Post date:** [June 9, 2021, 6:13am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/7 "2021-06-09T06:13:57Z")

</div>

OCaml to Wasm support is not great. But we do have a JS version of moc, and will have a web IDE coming up in a few weeks 🙂

---

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [June 18, 2021, 5:52am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/8 "2021-06-18T05:52:18Z")

</div>

Thanks to @hackape I have also deployed his work on the ic  
check this out  
[https://bgtba-gyaaa-aaaad-qagya-cai.ic.fleek.co/](https://bgtba-gyaaa-aaaad-qagya-cai.ic.fleek.co/)

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [June 20, 2021, 9:27am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/9 "2021-06-20T09:27:33Z")

</div>

This would be nice to have on canlista!

[https://k7gat-daaaa-aaaae-qaahq-cai.ic0.app/](https://k7gat-daaaa-aaaae-qaahq-cai.ic0.app/)

---

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [June 20, 2021, 11:21am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/10 "2021-06-20T11:21:49Z")

</div>

How do I add it to canlista?  
Edit: found it

---

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [June 21, 2021, 9:16am UTC](https://forum.dfinity.org/t/is-there-a-motoko-playground-for-devs/4904/11 "2021-06-21T09:16:14Z")

</div>

What’s an easier/more elegant way to use the interpreter code instead of relying on the compiled code, so we can build on that.
