Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Alternative Lua implementation
C++ C Assembly Other
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



Rocket is an alternative implementation of the Lua language. The core of the parser
and the VM are written from scratch, although they draw a lot of inspiration from
the Lua implementation. The implementation of the standard libraries is taken
directly from Lua.

It is currently in development and is not complete. See the TODO section for a list
of features that are still being worked on.

See COPYRIGHT for license information

Differences from Lua 5.1:

  - Support for C++ style single line and block comments
  - break does not have to be the last statement in a block
  - More strict handling of invalid escape sequences in a string
  - Includes bit library

  - Added lua_setgchook function
  - Added lua_pushtypename function
  - IO library can be registered with callbacks for custom file system access

Rocket uses premake4 (requires at least version 4.4) to generate build files.
premake4 is available from

Garbage Collector

The garbage collector in Rocket uses a combination of reference counting
and incremental mark and sweep. The purpose of this hybrid approach is to act as
a sort of generational garbage collector, where we can identify a subset of the
objects which are likely to be garbage and collect those first.

To avoid the overhead of pure reference counting, objects do not track references
from the stack. Instead the stack is scanned prior to releasing any objects which
have a reference count of 0 to ensure there are no references from the stack. 
Incremental mark and sweep is used to collect objects contained within cycles
which could overwise not be collected by the reference counting system.


- Weak tables
- __gc metamethod
- Garbage collector controls
- Coroutines
- Constant folding for logic operations and conditionals
- Debug functions
Something went wrong with that request. Please try again.