Skip to content

Instantly share code, notes, and snippets.

@Zamiell
Zamiell / TSTL.md
Last active December 15, 2023 18:30
TypeScriptToLua & File Size

Introduction

Do you use TypeScriptToLua? Do you find the transpiled Lua output to be unsatisfying in some way? Please don't care about this. This blog will attempt to convince you why.


What is TSTL?

TypeScriptToLua, or TSTL for short, is a tool to automatically convert your TypeScript code to Lua.

export default class Queue {
private items: Array<() => Promise<void>> = [];
private waker: (() => void) | null = null;
constructor() {
this.processQueue().catch((err) => {
throw new Error(`Failed to process a queue: ${err}`);
});
}