NIL isn't Lua
This is not an official Blitz project, but since BlitzMax has support for Lua scripting, this can be interesting for the Blitz community anyway.
The Star Story game I showed earlier does use an engine written in BlitzMax, but scenarios and spells and many more things have been scripted in Lua. Something I hate about Lua is that everything never declared or defined is just a 'nil' value (I always used "strict" mode in BlitzMax for a reason), Lua also does not have class support, switch support and some other things, so here goes my extension to Lua, and yes, the Lua engine within BlitzMax should (although I've not yet tested it, since my main focus is now C#) support it.
NIL is a language on its own, written in pure Lua code, and will real-time translate its code to Lua. Fun part, functions and variables defined in Lua will be recognized by NIL and vice versa. To put it even stronger, NIL has class support and classes defined in NIL can be used easily in Lua
void Hello() print("Hello World") end Hello()
Will translate to:
function Hello() print("Hello World") end Hello()
Setting up NIL in BlitzMax! Should be easy. There are multiple ways to do it, but I'll go for the simplest method now:
- Copy NIL.lua into your Blitz project --> https://github.com/jpbubble/NIL-isn-t-Lua
- Create a file named "MyScript.nil" and write your NIL script in there.
- Create a "start.lua" file and put in the next two commands in it:
NIL = require "NIL" NIL.Use("MyScript.nil")
Well, now NIL should be working in your BlitzMax project. APIs for NIL to use can just be done the same way as you can do with normal Lua, no matter if you use brl.maxlua or pub.lua, or well, whatever you can think off, it should all work. Is NIL better than Lua? That depends on how you wanna script. For my own needs NIL fills some voids Lua has... Other than that everybody should decide for themselves what is better. NIL is currently still in prototype stage, so you should keep that in mind in your expectations of it, and as I am putting NIL to the test now in a very big project, I'm still fixing stuff or expanding the language as things go. ;)
This is great stuff Tricky, thanks for sharing!
Have you also thought about proposing your changes to the Lua community?
Perhaps I should, shouldn't I? Not sure if Lua itself should be changed, though, it's simplicity is great for scripting small addons, but if you have large stuff scripted in it, then NIL can be an option... I've been in a few communities regarding Lua, and let's suffice to say I'm glad I'm no longer there.... Then again, there are more programming communities like that (unfortunately).... But at least, thanks for your support...
Now my wiki is a bit straight to the point... Perhaps I should first write a beginner's tutorial for it. ;)
I think this is great and if something like this makes stuff more easier then it should not be ignored, perhaps make it as a plugin instead if the language supports it?
Anyways, keep it up as you are into something here and a beginner's guide should help more.
When it comes to the tutorial itself, I'm looking to find an easy way to set them up and also attach a comment section to each lesson, so I can answer questions about the language, easily (and without costs, as er.. I'm poor).
Anyway thanks for your encouraging talk. I've been in a miserable state the last few weeks, so I could use to peptalk (not just about NIL, but in general).
Sure thing, but that is still awesome. I actually prefer coffeescript over typescript, but it seems TS is now making waves.
good to know. I don't mind both PHP and JS as I have gotten used to it over the years doing web stuff.
hey, that's another step with your guide and perhaps you can add example sources like what they do on most pdf coding ebooks.
> hey, that's another step with your guide and perhaps you can add example sources like what they do on most pdf coding ebooks.
There are already some of those. For starters the assignments in my book want you to write some code, but in the appendixes, you can see I did those assignments myself as well showing you my code. :) Not to mention that I already used some code to explain things in general. But maybe I should add a few actual programs and a few small silly games, to demonstrate the language even more, eh?
Reply To Topic
Please log in to reply