Skip to content

Welcome to ScaffScript

Write organized and modular GML with ScaffScript's module system.

GML has functional and event-driven programming paradigms, so it’s perfect for rapid development. But this paradigm can make it difficult to organize and maintain large projects. ScaffScript solves this problem by providing a simple and effective module system for GML.

GML

Usually, a good GML library is split into multiple scripts.

scrMylibHelper
function mylib_something() {
// implementation
}
function mylib_another_thing() {
// implementation
}

The library also usually expose global enum/macro for configuration.

scrMylibConfig
enum MYLIB_CONFIG {
// some config or types
}
#macro MYLIB_VERSION "1.0.0"

The thing is, exported functions, enums, and macros is always exposed to the global scope if you write it in this way.

ScaffScript

In ScaffScript, you can define the module exports in a single file.

mylib.ss
export function mylib_something() {
// implementation
}
export function mylib_another_thing() {
// implementation
}
export class MyLib {
// some class
}

You can export various things from a ScaffScript module:

types.ss
export enum MYLIB_CONFIG {
// some config or types
}
export const MYLIB_VERSION = "1.0.0";

Features

  • TypeScript-like module system with export, import, and include.
  • Class syntax with separatable implementation that compiles to GML struct constructors.
  • Content directives for dynamic code insertion.
  • Special values like @now, @version, and @file.
  • Code generation blocks for organizing content.
  • Direct GameMaker integration, automatically updates your GameMaker project.

Language Philosophy

  • Minimal. ScaffScript doesn’t reinvent GML. It’s a superset that adds just enough to solve real problems.
  • Pragmatic. Designed for creating libraries and maintaining large projects without the verbose global-scope pollution.
  • GML-friendly. Keep all of GML’s power and paradigms, just write it more cleanly.

Workflow

  1. Write .ss files with TypeScript-flavored syntax.
  2. Use export to define modules, import and include statements to consume them.
  3. Write integration blocks (#[...]) and use intg statements to map them to GameMaker scripts/objects.
  4. Run the CLI to compile to .gml.
    • Optional: Inject the compiled .gml files directly into your project.
    • Everything resolves at compile-time, no runtime overhead.

Ecosystem

  • Create-Scaff starter templates for npm, pnpm, bun, and GameMaker projects.
  • Integrated compiler and CLI tool (scaff) for code generation and GameMaker project integration.
  • Alpha VS Code extension for syntax highlighting. Other features may be added in the future.

Roadmap

Will only be updated if this project is considered as successful by the community.

  • ScaffScript core language and CLI tool
  • Create-Scaff starter templates
  • VS Code extension for syntax highlighting
  • Change ScaffScript to use AST instead of regex for parsing
  • Add more language features, as close as possible to TypeScript
  • Add more CLI features
  • Add more features for VS Code extension
  • Add LSP support for ScaffScript

That’s it, what are you waiting for?

Let’s create GML libraries with ScaffScript!
Section titled “Let’s create GML libraries with ScaffScript!”