katsaii / catspeak-lang

A cross-platform modding language for GameMaker games.
https://www.katsaii.com/catspeak-lang/
MIT License
81 stars 4 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.compileGML(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.compileGML(ir);
  badMod();
} catch (e) {
  show_message("a mod did something bad!");
}

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.