Nelua is a minimal, simple, efficient, statically typed, compiled, metaprogrammable, safe, and extensible systems programming language. Nelua is designed for developer looking to build performance sensitive applications like game engines and real-time services. The languge syntax and semantics share many similarities with the popular programming language lua, while utilizing optional garbage collection. Nelua also uses ahead-of-time compilation to generate optimized native binaries.

Nelua Features

Statically typed

Nelua takes advantage of type notations to do type checks at compile time and to generate efficient specialized code. Most of the type notations are optional and the compiler can infer them at compile time.


Nelua should be as efficient as C when programming with manual memory management, and more efficient than Lua when using the optional garbage collector.


Nelua is as simple and intuitive as Lua. Some additions like type notations, efficient data structures, and metaprogramming utilities are available, unlike Lua, but all of them are optional.

Lua flavored

If you know how to code in Lua then you probably know how to code in Nelua. It tries to have the same syntax, semantics, features, and APIs.


Nelua takes advantage of ahead-of-time compilation using powerful, optimized C compilers such as GCC or Clang, and thus generates very efficient native code. No interpreter is needed at runtime.


Nelua provides mechanisms for implementing features instead of providing a host of features directly in the language. For example, although Nelua is not an object-oriented language, it does provide mechanisms for implementing classes and inheritance efficiently at compile time via metaprogramming.


Nelua tries to be safe by default for the user by minimizing undefined behavior and doing both compile-time checks and runtime checks.

Low level

Nelua has C-like low level features to allow micro-optimizing parts of the code when needed.


Nelua keeps its host features minimal and provides metaprogramming mechanisms, allowing the semantics to be extended in unconventional ways at compile time. For example, Nelua allows you to create generics, polymorphic functions, and specialized code at compile time using Lua and using the concepts system.


Nelua's compiler is written in Lua and is completely modifiable on the fly via the preprocessor, thus you can change the behavior of the compiler at compile time, allowing, for example, direct manipulation of the AST, or even extensions to the language syntax, semantics, or the code generator.

C Compiles to C

Nelua compiles to C first then to native code, thus you can read and debug the generated C code, mix in other C code without costs, create or use C libraries, use C tools, and reuse the generated C code. You can think of Nelua like a "better C" heavily inspired by Lua.

Run anywhere

Nelua has minimal dependencies. This means you can use it for any system where C is available, including the web.

Optional Garbage Collection

Nelua uses a garbage collector by default, but it is completely optional and can be replaced by manual memory management for predictable runtime performance and for use in real-time applications, such as game engines and operational systems.

Self contained

Nelua does not use external libraries. Its standard library is written in Nelua and you only need a C compiler to use it.

Nelua Information

Nelua Pricing

Nelua is a free and open source programming language released under the MIT License.