Squirrel is a high level imperative, object-oriented programming language, designed to be a lightweight scripting language that fits in the size, memory bandwidth, and real-time requirements of applications like video games. MirthKit, a simple toolkit for making and distributing open source, cross-platform 2D games, uses Squirrel for its platform. It is used extensively by Code::Blocks for scripting and was also used in Final Fantasy Crystal Chronicles: My Life as a King. It is also used in Left 4 Dead 2, Portal 2 and Thimbleweed Park for scripted events and in NewDark, an unofficial Thief 2: The Metal Age engine update, to facilitate additional, simplified means of scripting mission events, aside of the regular C scripting. Dynamic typing Delegation Classes, inheritance Higher order functions Generators Cooperative threads (coroutines) Tail recursion Exception handling Automatic memory management (mainly reference counting with backup garbage collector) Weak references Both compiler and virtual machine fit together in about 7k lines of C++ code Optional 16-bit character strings Squirrel uses a C-like syntax. Factorial in Squirrel function factorial(x) { if (x