timothypratley / power-turtle

Interactive turtle power in your browser
http://timothypratley.github.io/power-turtle
23 stars 6 forks source link

Importing reagent and re-frame from power-turtle #22

Open Folcon opened 5 years ago

Folcon commented 5 years ago

I’ve created a rough starting point for a clojure/script roguelike tutorial: https://folcon.github.io/my-little-roguelike/start.html

The code is here: https://github.com/Folcon/folcon.github.io/blob/master/my-little-roguelike/start.html

I tried to start with using power-turtle, but unfortunately I couldn’t import reagent/re-frame even though they appear in the source. In the end I thought it was more important to get a small toy working that could be improved extended if people thought it had merit than trying to get that specific path to work.

Any ideas what I can do to get it working?

timothypratley commented 5 years ago

Hi Folcon,

Interesting idea! I'll take a look at it and see what advice I can give.

On Sat, Dec 8, 2018 at 5:13 AM Folcon notifications@github.com wrote:

I’ve created a rough starting point for a clojure/script roguelike tutorial: https://folcon.github.io/my-little-roguelike/start.html

The code is here:

https://github.com/Folcon/folcon.github.io/blob/master/my-little-roguelike/start.html

I tried to start with using power-turtle, but unfortunately I couldn’t import reagent/re-frame even though they appear in the source. In the end I thought it was more important to get a small toy working that could be improved extended if people thought it had merit than trying to get that specific path to work.

Any ideas what I can do to get it working?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/timothypratley/power-turtle/issues/22, or mute the thread https://github.com/notifications/unsubscribe-auth/AADAktgd1iwQuLNpyE5QGYpfumjFI6hPks5u27sDgaJpZM4ZJodC .

Folcon commented 5 years ago

Thanks, much appreciated!

It's not intended to be finished, as one way or another I'm intending to add additional entries. Advice is certainly appreciated!

timothypratley commented 5 years ago

Hi @Folcon,

I like what you have created, great idea.

I've adapted your doc/lesson-1.md file to a very similar file rouge-pt.md which I put in a gist here: https://gist.githubusercontent.com/timothypratley/bd24a6da5874fb3fb62cd141b6750fee/raw/c024037f283b49681b0a225df34e941e2b9a5718/rogue-pt.md

To view the lesson in Power Turtle you can use this link: https://timothypratley.github.io/power-turtle/#lesson//gist.githubusercontent.com/timothypratley/bd24a6da5874fb3fb62cd141b6750fee/raw/c024037f283b49681b0a225df34e941e2b9a5718/rogue-pt.md

You can load your file directly using this link: https://timothypratley.github.io/power-turtle/#lesson//folcon.github.io/my-little-roguelike/doc/lesson-1.md

But currently, you don't have a canvas specified so it defaults to turtle instead of html, and there are no slide separators. Slide separators are ---.

I see that you discovered and are using Klipse. Klipse is really cool because you can load dependencies. Power Turtle does not have a good way of doing that. You can make use of reagent and re-frame directly using fully qualified symbols like (reagent.core/ratom {}) but you are limited to only use libraries that were compiled as part of Power Turtle. Also Klipse allows live snippets.

Have you seen https://www.maria.cloud/ -- It takes a more notebook style and you can save your work as you go, but I don't think you can load dependencies in it either.

The idea behind Power Turtle is to make it easier to create lessons as you just write markup slides. I think this is more engaging for readers because they can step through the process and are forced to interact with the REPL. However, one big drawback right now is that students cannot save their work very easily.

I think that combining Klipse with slides markdown and keeping a history of the user program would be a really interesting combination that might capture the benefits of all three approaches.

I hope this gives you some ideas.

Thank you for the example, it has made me think harder about ways to easily create lessons.

Folcon commented 5 years ago

Thanks for this @timothypratley! :)...

I'll have a review of this tomorrow/day after. I do intend to put together another lesson during the new years break. I want to do an overview of what I've covered in the tutorial so far, a tutorial introducing the repl and spec at a very simple level (basically define an example, build a simple function that uses that example, build a spec that's a more general version of the example, test your function to see if you haven't done something silly, repeat) and then move onto the next part of the roguelike tutorial building on that knowledge.

To quickly touch on some of the points you raised: 1) I'm definitely onboard with how power-turtle works, I've been thinking about it and I very much want to adapt the instructions on top, (or on the side as I have) so the instructions appear as bite sized chunks that the student is doing with explicit "next", "previous" buttons. I think it really helps to break up the lesson.

2) I have seen maria.cloud, it looks great, but similarly as you mentioned I couldn't work out how to get dependency importing working. I really think that it facilitates a python notebook style of development.

I'm personally thinking of moving to a more mixed approach, I think we can simulate "files" without too much difficulty (basically a hash-map of hash-maps of filename/namespace to string file-contents + meta) and as we have a namespaced repl available we can actually get an in-browser editor which mimics a proper workflow.

I could be wrong about this, but the thing I really feel is lacking is a decently sized tutorial/example that accurately mimics repl based development, where the student builds a decently sized project. That's basically why I wanted to do a roguelike, it can be done as a really small project which can grow as the student feels the need to add features/functionality.

Then hopefully if I've done it correctly when they finish the tutorial I can put up a nice big "Export" button which will grab all the "files" they've been developing, zip the into a zip file which they can take away with them with the final lesson being a tutorial for using leiningen or boot. Or they can keep using the tool until they feel it doesn't do enough. Just use a local-storage atom to make sure they don't lose their work :)...

Hopefully that's reasonable >_<...