Quirrel is a fast, high-level imperative, OO programming language, designed to be a lightweight but powerful scripting tool that fits within the size, memory bandwidth, and real-time requirements of applications like games.
Quirrel has simple integration and bindings in any C++ application.
It is based on Squirrel Script language (http://www.squirrel-lang.org/), but modified to be safer, stricter and faster. Quirrel is not compatible with the original Squirrel (see Diff from original), but conversion usually can be done easliy.
Quirrel offers a wide range of features like dynamic typing, higher order functions, generators, tail recursion, exception handling, courutines, automatic memory management while fitting both compiler and virtual machine into about 6k lines of C++ code.
Repository is available on https://github.com/GaijinEntertainment/quirrel and your PR’s and feedback are welcome!
More details on Quirrel
Quirrel is a mature scripting language used in tens of games and other apps (including web servers and embeddable platforms) with hundreds of millions installations. It was created to be embeddable language to C/C++ applications with easy bindings and clear mental model.
Quirrel has a robust and predictable memory model. In most cases with reference count you never have unexpected freezes in runtime as well as predictable memory consumption. However, we are planning to add GC memory management without reference count, as it can be more beneficial in some ways of using language (when you always have enough computational time in separate thread to manage memory it allows you to have less latency)
Quirrel support concurrency with coroutines.
Quirrel wants to be safe. The main intent to evolve Squirrel into Quirrel was to make it safer. Being a dynamic language by its nature doesn’t mean that you can be more safe. Safety comes from different small syntactic and semantic changes, allowing more compile time validations and explicitly, making code less ambiguous and clear to reader and writer. Things like ‘let’ Named bindings declaration, freezing of tables and arrays, Destructuring assignment and imports, deprecation of modifying classes, redefine table keys and several others, as well as implementing static analyzer, helps to prevent many errors and allow code to be stricter.
Quirrel is fast. It is at least as fast as Lua (on compilation and runtime), with some tweaks to be sometimes closer to LuaJit with no JIT. We are also going to implement AST-based compiler with optimizations on AST, allowing code to become even faster in real-time (that will also allow making code safer and to add power of macros). Class hinting allow classes to be as fast as in Wren or LuaJIT.