11 comments

  • njoyablpnting26 days ago
    This is super cool! Would love to see how you hooked up Ruff and ty.<p>Just curious, why not use Pygame?<p>Scratch abstracts away a ton of stuff to allow the student to focus on logical building blocks that mirror the mental model one might have when writing a real program. I&#x27;m wondering if keeping a lot of those abstractions when transitioning to text programming is educationally useful?<p>For example, it might not be clear that @on_forever is really just a loop, etc. One thing I&#x27;ve noticed when teaching beginners is that when you introduce a library&#x2F;framework at the same time as a language, they start to form a model of the language that often wrongly includes parts of the library.<p>This is why I think Pygame is so useful for education, it sits at just the right level of abstraction for learning. In Pygame, your game loop is just a loop, handling input is just conditions in your loop, etc.<p>Regarding rewriting the AST to avoid async&#x2F;await, do you have some experience or evidence to suggest that these should be abstracted out? I can see an argument for both sides, so just wondering how exactly you arrived at that decision.<p>Also, I tried a program with an infinite loop and the UI became unresponsive and I had to close the page. This indicates to me it&#x27;s running on the main browser thread. Kids (and sometimes senior engineers) write infinite loops occasionally, so I highly recommend executing the user&#x27;s code in a worker to prevent the harsh experience of losing your work suddenly.
    • notenlish25 days ago
      Pygame would be the perfect use case for this. It also supports running in the browser via <a href="https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;pygbag&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;pygbag&#x2F;</a>
  • Noumenon7225 days ago
    One possible consequence of generating Scratch by writing code is that you can ask an LLM to generate your Scratch. I worry that this could take away the fun of Scratch the same way I can no longer maintain any interest in going to Python night, because the computer can do it all.
  • varun_ch26 days ago
    See also!<p>Leopard[0] translates existing Scratch projects JavaScript with a a library for creating games with a really nice API for &#x27;rendering sprites, collision detection, audio, and more&#x27;<p>and on the other side, goboscript[1] is a text based programming language that compiles to Scratch projects. It lets users write Scratch projects with text syntax that you can write in an IDE and version control etc.<p>maybe both of these could be interesting stepping stones? personally when I &#x27;graduated&#x27; from Scratch as a kid I just dumped into writing HTML&#x2F;CSS&#x2F;JS websites, which is a very different environment entirely. It actually took a while before I realized where the overlap was with what I learned through Scratch.<p>[0] <a href="https:&#x2F;&#x2F;leopardjs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;leopardjs.com&#x2F;</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;leopard-js&#x2F;leopard" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;leopard-js&#x2F;leopard</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;aspizu&#x2F;goboscript" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aspizu&#x2F;goboscript</a>
  • chuliomartinez25 days ago
    Look really cool.<p>Only suggestion, if at all possible avoid special characters like @ and _ . In my experience, kids have a hard time to find them and it get even more complicated for non-english keyboard layouts.
    • emil-lp25 days ago
      On the contrary, I would say, _ is relatively easy to type, and if they know how to type capital letters using Shift, they know to type underscores.
  • hdndnjd25 days ago
    Nice idea! However I would like to smooth the transition by also having a Scratch layer with a &quot;peek behind the curtains&quot; button to see the equivalent python code
  • stefanka25 days ago
    What about Godot? It’s not Python but it’s a simple written language. It also allows growing by generating more complex games in 3d
    • emil-lp25 days ago
      Probably because it&#x27;s not Python.<p>I was under the impression that the main goal was learning programming, not game development.
  • conartist626 days ago
    I like the direction youre moving. Would a drag and drop editor for Python syntax be useful for a project like this?
    • askvictor24 days ago
      Having taught schoolkids both python and scratch, I feel that typing is better, but having the blocks visibly coloured as in scratch would be really useful
  • bgilroy2626 days ago
    I have loved Scratch for many years. This looks cool! Thank you for sharing!
  • BiteCode_dev25 days ago
    The music &quot;boss_battle&quot; rocks. Where does it come from?
  • scelerat25 days ago
    Very helpful comments in much of the example code.
  • soferio26 days ago
    Looks fantastic.