katsaii / catspeak-lang

A cross-platform modding language for GameMaker games.
https://www.katsaii.com/catspeak-lang/
MIT License
93 stars 6 forks source link
compiler domain-specific-language dynamically-typed gamemaker-studio-2 games language lexer-parser programming-language
Catspeak Logo

The Catspeak Programming Language

A cross-platform scripting language and compiler back-end for GameMaker projects. Use Catspeak to implement, fast and sandboxed modding support by compiling and executing arbitrary user code from files or text prompt.

Developed and maintained by Katsaii.
Logo design by Mashmerlow.

Overview

The spiritual successor to the long dead execute_string function...

// parse Catspeak code
var ir = Catspeak.parseString(@'
  let catspeak = "Catspeak"

  return "hello! from within " + catspeak
');

// compile Catspeak code into a callable GML function
var getMessage = Catspeak.compile(ir);

// call the Catspeak code just like you would any other GML function!
show_message(getMessage());

...without any of the vulnerabilities from unrestricted access to your game code:

var ir = Catspeak.parseString(@'
  game_end(); -- heheheh, my mod will make your game close >:3
');

// calling `badMod` will throw an error instead of calling the `game_end` function
try {
  var badMod = Catspeak.compile(ir);
  badMod();
} catch (e) {
  show_message("a mod did something bad!");
}

Projects Using Catspeak

In no particular order:

(If you have a project you would want to appear here, please get in contact!)

Features

If you run into any issues using this project, please create a GitHub issue or get in contact on Discord through the GameMaker Kitchen server.

📝 Minimal Setup Required

☯ Seamless GML-Catspeak Interoperability

🏃‍♀️ Performant Runtime

👽 Cross-platform

🔨 Customisable, Sandboxed Runtime Environment

💪 Built for Power Users

🙀 Cute Name and Mascot

Acknowledgements

Thanks to JujuAdams for giving important feedback on aspects of the implementation, an important step towards making sure Catspeak is battle hardened.

Thanks to TabularElf for donating lots and lots of prototype code for new Catspeak features.

Thanks to anyone spreading the good name of Catspeak.