ZZ NIL with pre compiled scripts - jpbubble/NIL-isn-t-Lua GitHub Wiki
I have NEVER used pre-compiled scripts in serious projects myself. Main reason... It was a downright disaster! I guess it goes without saying that I therefore cannot tell how well NIL will work with Lua pre-compilers.
Oh, and here are my answers if you try to get me into pre-compiling anyway
-
Pre-compiling is faster
- Only during loading, and Lua compiles very fast. In run-time there is no difference as Lua cannot run non-compiled scripts.
- NIL hardly made a difference for me either so far (at least not noticeable to a human being).
-
Pre-compiled scripts cannot be seen by other people
- Like I care. Nearly all my work is open-source anyway, so you can see all my source on GitHub.
- Unlike machine language, compiled code made in scripting languages are mostly very very easy to de-compile, so it wouldn't make a difference anyway.
-
Pre-compiled scripts take up less space
- Depends on how much code was in the source code. Like many compilers smaller stuff often becomes bigger, and bigger stuff becomes smaller. In Scripting small scripts are not uncommon.
- My scripts are all packed with lzma in most of my projects, nullifying that reasoning also.
Also, when I just keep in in source code, it's easier for me to check if no file-corruptions took place in my distributions.
Now I never tried this, but I think the best way to go to pre-compile NIL scripts is to make a quick Lua-script translating the NIL script (with NIL.Translate) and write that code as a temp file (making sure you add "NIL=require "NIL"" at the top of it) and then run your Lua compiler. Although I never tried this, and I also cannot tell how "#use" statements will work although it's my guess they will still want the files they import in pure NIL or Lua (seems most obvious to me).
Since me and Lua pre-compilers were never good friends, perhaps a NIL pre-compiler is not the project I want to undertake, but it should certainly be possible.