Category:Goboscript

This programming language may be used to instruct a computer to perform a task.
| Official website |
|---|
| Parameter passing methods: | By value |
|---|---|
| Lang tag(s): | compiled, transpiled, Scratch |
| See Also: |
|
From the goboscript repo:
goboscript is a text-based programming language that compiles to Scratch. 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 is a transpiled language implemented in rust which enabled the use of text-based workflows when targeting the popular "kids'" programming language 'Scratch.' This includes using tools like git, editors like vscode or a keyboard-centric workflow using vim. Its transpilation step via the command line also allows you to use a build system like Make to programmatically generate files e.g. costumes which could be used in your project. Goboscript also has a C-like preprocessor which allows for modularization of code via the %include <filepath> directive.
Goboscript, while targeting scratch, has a syntax strongly resembling C. It is most influenced by C, rust & python. In a nutshell, goboscript is a language that acts as a text-based representation of (most) scratch code, with a number of abstractions placed on top, notably the preprocessor, functions (with return), structs, and enums.
Types
In goboscript, a type is either the built-in value type, or a struct. Enum values belong to the value type. In variable declaration, the type comes before the name: var Vec2 mousePosition;. If the type is the default value type, then no type is supplied before the variable name: var health;. This syntax also applies to function/procedure arguments, local variable declaration, and list declarations. It does not apply to macros because the preprocessor, like C, is akin to a "copy+paste machine", and it does not apply (yet) to structs, because goboscript does not have support for nested structs.
Missing features
Goboscript as a language may look like C, however, due to it acting as a layer on top of Scratch, the language features are significantly impacted by what scratch provides. Notable features missing from goboscript as a result are pointers, nested lists, distinction between numbers & booleans & strings, proper utility for strings, and standard concurrency. While some of these features could be implemented, the target platform of Scratch presents a huge challenge for creating a general abstraction for these features. For example, one could use a single list as a stack/heap and then pointers would be indices referring to that list, however Scratch has a built-in 200,000 length limit for lists. In scratch, string comparison is not case-sensitive, however there are some hacks which allow for 'proper' string comparison, most commonly using the switch_costume and costume_number() blocks. There does also exist a niche alternative using a number of sprites and using the "thing of thing" block instead. In goboscript, lists are separate entities compared to variables, and are not a type. Goboscript does not have local lists either. Additionally, local variables have 'undefined behavior' for (non-tail) recursion. Aside from limitations and performance inhibitions caused by the Scratch platform, Goboscript misses notable features compared to more established languages. Goboscript notably lacks nested structs, generics, any kind of namespacing, procedural macros/compile-time evaluation, and a functioning package ecosystem.
Syntax
Goboscript's syntax is rather C-like however the built-in procedures/functions are all tightly connected with the name of blocks in the Scratch programming language. Most blocks from scratch fall into 4 categories in goboscript: procedure-like, reporter, hat, or control flow. A procedure is a subroutine which can take arguments but does not return a value. Examples of built-in procs are goto x, y;, pen_down;, and set_color_effect 150;. Procs are valid as statements. A reporter has the same syntax as a function. It may take in 0 to n arguments, and will return a value. Examples of built-in reporter/functions are timer(), distance_to("_mouse_"), and color_is_touching_color(0xff0000, 0x00ff00). Reporters are valid as expressions. A hat block is a top-level block which initiates the running of a block of statements. Examples include onflag { do_some_stuff; }, ontimer > 10 { do_other_stuff; }, and onkey "up arrow" { do_a_barrel_roll; }. These are only valid as top-level 'declr' blocks, and are not valid as statements. Control flow syntax includes if cond {} elif cond {} else {}, until cond { do_something; }, and forever { do_more; }.
Not all scratch blocks fall under this syntax. Some blocks have built in syntax: ==, str1 in str2, proc greet arg1 {say "hello, " & $arg1; }, &c.
Code style
Goboscript does not have an official naming convention or code style. The official standard library does silently follow this convention:
- macros:
SCREAMING_SNAKE_CASE - procs, funcs, vars, and lists:
snake_case - structs:
PascalCase
However, because goboscript lacks namespacing, an alternative code style in larger projects could be as follows:
- macros:
camel_snakeCase_m,camel_snakeCase_mi,camel_snakeCase_mf(macro, macro input to library, macro flag) - structs:
camel_snakeCase_t - variables:
camel_snakeCase
"Namespaces" would be separated by underscores, and the type of value that that name holds would be denoted with a suffix. However, this convention is extremely verbose and because of goboscript's lack of robust editor-autocompletion, it is not ideal for most projects.
Goboscript tooling
Goboscript is a niche language and most of its tooling is made by the author of the language, aspizu. Other than the compiler, there is a small (partially AI-generated) standard library, a decompiler (sb2gs), a web IDE, and an MCP server which connects to TurboWarp desktop. Goboscript has some editor support for VSCode, Notepad++ and Sublime Text. A tree-sitter grammar is in development to work towards support for the Zed editor and neovim. Goboscript however lacks an LSP implementation as of 2026, so this editor support is only in the form of syntax highlighting and some snippets. Any completion suggestions for now either come from the editor recognizing whitespace/symbol delimeted tokens or LLM completion. However this is not perfect because the editor cannot know which files are relevant to the file and so may provide irrelevant completions or not provide suggestions that you actually want. Refactoring is also difficult with the main option for renaming being global find+replace. The presence of a preprocessor would likely make the utility of any LSP implementation somewhat limited in and of itself, however the preprocessor is a key feature and utility of goboscript.
Package managers
Despite being a relatively new programming language, goboscript has multiple package managers. However, goboscript does not have a proper package ecosystem. The official backpack was rewritten twice, and inflator is partway through a rewrite as of 2026. Both of these package managers work by installing packages from a git forge like github, adding them to a central directory, and symlinking them to a special directory in your project which can be referenced using the %include directive.
Pages in category "Goboscript"
The following 5 pages are in this category, out of 5 total.