Home - jpbubble/NIL-isn-t-Lua GitHub Wiki

Welcome to the NIL-isn-t-Lua wiki!
Lua is a fantastic scripting language. Simple syntax, lightweight, fast, and very quickly for a programmer to write code in. Now Lua was originally only for config and later for small addons. The language was never worked out for very large and complex projects, but the language is being used for that more and more, and then you can get some issues.
Lua does not require any kinds of declarations, goes easy on data types, has not classes support etc. etc. A few things can be easily 'cheated' upon, but that can be quite a lot of work, and debugging can also be a downright disaster, as when you have over thousands lines of code (which is even for a Lua project not uncommon anymore) and you mispelled a variable name, then you're in trouble as where did you misspell the variable causing this mayhem to happen?
In the past I had to cancel some projects due to this kind of trouble.
Introducing NIL
NIL is a pre-processor, completely written in Lua, transcompiling it's own NIL language to Lua. It works run-time, so you don't have to pre-translate your scripts. Let NIL do its magic, and you get a fully working Lua script, and the best part is that Lua can interface easily with NIL and vice versa. A function set up in NIL can be called by Lua, and vice versa. NIL also comes with a 'class' interface, although creating the class itself can be quite hard to do in Lua (so I recommend to do that in NIL only), once created Lua can use the class just as easily and NIL can.
NIL also supports a simple macro feature allowing to work with 'constants' in stead of having to rely on 'risky' variables or "magic numbers".
NIL's syntax is heavily inspired by both Lua and C.
void Hello()
print("Hello World")
end
Hello()
For simple projects, keep using Lua. When a project is big and complex and can easily turn to a mess due to Lua's "too free" approach, then NIL can help you. Also note that NIL tries to guarantee that line numbers remain the same. So line 500 in a NIL script, should still be line 500 in the Lua translation, meaning that the line numbers in error messages are mostly quite accurate.