from Hacker News

Show HN: Goboscript, text-based programming language, compiles to Scratch

by aspizu on 5/19/25, 5:51 AM with 59 comments

goboscript is a text-based programming language which compiles to Scratch. It allows you to write Scratch projects in text, and compile it into a .sb3 file - which can be opened in the Scratch editor, TurboWarp or be uploaded to the Scratch website.

goboscript allows you to create advanced Scratch projects with ease, you can use any text editor, use a version control system such as git. You can refactor your code using search and replace. Text code can be copy pasted, which allows you to easily reuse code or share it with others. goboscript syntax is concise and easy to read.

goboscript allows you to integrate external tooling and workflows, such as using a script to generate costumes for a text rendering engine. Or loading in images into lists.

goboscript has a powerful macro system - similar to Rust's macro system. This allows you to write macros to generate code.

goboscript is more than just an 1:1 mapping of Scratch blocks to text, it also has additional features like local variables for procedures (custom blocks).

goboscript also performs optimizations, detects problems and unused code.

  • by AlexanderDhoore on 5/19/25, 6:23 AM

    I love teaching Scratch to kids. Some years ago, I used to do "CoderDojo", which is like a hobby club where kids can learn programming. Some kids go to soccer, others to art academy — and these kids learn programming. Super cool to teach.

    However, most kids get stuck after they master Scratch. Especially kids around the age of 8–10. They learn Scratch. It's awesome. They make some advanced games and really get the hang of it.

    Then they ask to do something more — some “real programming.” And that's where the hurdles start to pop up. First problem: my kids don't speak English, so most documentation and tutorials are out of reach. Second problem: suddenly they need to learn everything about computers — source files, graphics, networking... This is too big a hurdle for them to take. Third problem: text-based programming. Most of them literally can't type on a keyboard properly. Text is also much less fun than visual programming.

    What I've always wondered — and this project reminds me of it — is: can we make the transition smoother? Stay within the Scratch ecosystem, which they know, but start introducing extra concepts step by step, without the big jump.

    GoboScript introduces "text-based programming" as a first step, while staying within the Scratch world. I would have liked it more if we could teach the kids a real-world programming language, like Python or JavaScript — because then they’re moving toward "real programming" step by step.

    The next step would be: introduce other computer concepts like file systems or networking.

    I would love to build this myself. Alas, no time. Maybe one day.

  • by japanuspus on 5/19/25, 6:19 AM

    Thank you for making this!

    My initial take was to share this with my son who used to built all kinds of things in Scratch, but I know that the lack of simple install instructions will be a deal-breaker for him.

    Given that (part of) your audience will be persons like my son graduating out of graphical programming in Scratch, it might be worth spending a little time on non-dev install instructions. Even more so as you can leverage the rust toolchain and just suggest something along `cargo install --git ...` [0], without even publishing as a crate.

    Apologies if this comes across as entitled: I just want to communicate that a single README-sentence on top of the work you already put into this would make it significantly more accessible.

    [0]: https://doc.rust-lang.org/cargo/commands/cargo-install.html

  • by varun_ch on 5/19/25, 4:06 PM

    I got into coding through Scratch, and I've been involved with Scratch for over a decade now (I'm 18). I think an often overlooked aspect of Scratch is that it's more than just a drag and drop coding editor; there's an entire community site to share projects on too. And the site is super 'hackable', the APIs are fairly open and all of the client side code is open source too. There's a whole ecosystem of other kids building stuff for/around Scratch (like the Scratch Addons browser extension [0]), as well as projects like this.

    To be honest, I learnt more from hacking Scratch than using it as intended. I thought this was just a 'me thing', but last summer I was an intern on the Scratch Foundation's engineering team, and my mentor explained that they're totally aware of this effect, and that they take it into account when designing the platform. I like Scratch.

    [0] https://scratchaddons.com/

  • by falcor84 on 5/19/25, 10:29 AM

    This is great! I'd also like to mention pytch.org which takes a slightly different approach to the same problem, essentially recreating most of Scratch within python, and teaching learners how they'd go about writing code to do the same sort of stuff they would have done with Scratch, and then to extend it with python stuff that isn't possible in Scratch.

    Thinking of it now, I wonder if the two approaches could be combined?

  • by nis251413 on 5/19/25, 8:53 AM

    Next step: create a visual programming language that compiles to goboscript.
  • by TrnsltLife on 5/20/25, 2:21 AM

    This is cool. Also check out Pico-8. I just learned about it and started showing it to my kids, ages 8 - 13. They all liked it and engaged with it to varying degrees.

    It has a code editor with 8 tabs for organization and uses Lua with some extra functions for the game loop and sprites.

    It has a built in sprite and map editor, plus sfx and music editor.

    It reminds me of the integration and experimentation I had with TI Logo and Amiga Basic.

    There is a free education edition available online.

  • by ninetyninenine on 5/19/25, 1:45 PM

    Why is text preferable to scratch? What is fundamentally wrong with scratch to make this transition desirable?
  • by ferriswil on 5/19/25, 7:19 AM

    Looks fantastic! Now it simply needs a non-Scratch runtime and a Scratch-like frontend, and we'll finally be able to teach bootstrapping to the 5-10 year old demographic.
  • by arnavsurve on 5/19/25, 6:12 AM

    This is hilarious yet awe inspiring at the same time. Great work
  • by arjvik on 5/19/25, 6:09 AM

    This is beautiful, and brings back so much nostalgia!
  • by sriram_malhar on 5/19/25, 7:00 AM

    I love it! It has features that I'd have liked Scratch to have, like return values from functions, local vars, structs etc.
  • by jony1266 on 5/21/25, 6:32 PM

    where was this when i was making scratch games in elementary school?? would've been exponentially more efficient to write text instead of dragging blocks around.
  • by _vicky_ on 5/19/25, 3:56 PM

    In Not in

    These two are enough to build a programming language

  • by web3aj on 5/19/25, 6:14 AM

    This is hilarious because it defeats the purpose of scratch.