{"repo":"bytexenon/Tiny-Lua-Compiler","free":true,"listed":false,"github":"https://github.com/bytexenon/Tiny-Lua-Compiler","clone":"git clone https://github.com/bytexenon/Tiny-Lua-Compiler.git","description":"🌸 Possibly the smallest Lua compiler ever","language":"Lua","stars":307,"topics":["compiler","lexer","lua","lua-compiler","tiny-compiler","tokenizer","lua-the-tiny-compiler","lua-tiny-compiler","lua51","parser"],"license":"MIT","category":"dev-tools","readme_excerpt":"An educational Lua 5.1 compiler and virtual machine in one Lua file Inspired by Jamie Kyle's The Super Tiny Compiler Tiny Lua Compiler (TLC) is a complete Lua 5.1 compiler written in pure Lua. It tokenizes source code, builds an AST (Abstract Syntax Tree), lowers it into Lua 5.1 function prototypes, emits real PUC Lua 5.1 bytecode, and executes those prototypes in its own register-based VM. The whole core lives in tlc.lua, and the file itself is only 4,700 lines long, or about 3,000 with the educational comments removed. Most compiler learning material falls into one of two buckets: on one side are toy compilers that are easy to finish but skip the parts that make real languages interesting. On the other are production compilers that are real, but so large that the main ideas get buried under architecture and history. TLC is meant to sit in the middle. It is small enough to read in a weekend, but real enough to deal with lexical scoping, closures, upvalues, varargs, multiple returns, method calls, loops, tail calls, bytecode encoding, and execution. It is not a production compiler, and it is not trying to replace the standard Lua implementation. It is an educational compiler that tries to stay honest: small enough to understand and complete enough to be interesting. Tiny Lua Compiler is not a port of the standard Lua implementation. It was built completely from scratch. That keeps it extremely small and straightforward, but it also means some edge cases may be handled differe","default_branch":null,"files":null,"tree":[],"storefront":"/r/bytexenon","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/bytexenon/Tiny-Lua-Compiler/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}