On Tue, May 1, 2012 at 10:32 PM, [ex]
<exeqtor@gmail.com> wrote:
Hello List,
I decided to change the syntax of Lua and integrate it with Love (a
game engine) for a personal project of mine.
Right now the virtual machine has not changed but I suspect that
changing it is very likely in the future.
So by now most of the changes were done in the lexer and parser.
My repository can be found here: https://bitbucket.org/ex/love
This time only windows supports due to my laziness (sorry). But
support for other platforms is in the way.
If you are interested in playing with the language there is a compiled
interpreter and some scripts for test in the directory.
Also the game engine loads a simple tetris clone I did to test everything.
I'm preparing a post with more information but in resume the main
differences between Killa and Lua are:
- Killa (moon in Quechua) is a language based in Lua 5.2 (think in Lua
with a _javascript_-like syntax)
- Killa requires variable declarations (no more silent typo errors)
- Local variables and local functions are default, global symbols
require the "public" keyword.
- Array tables start with index zero (no 1, so Dijkstra is finally happy)
- _javascript_ like blocks: for, while, do. (missing switch)
- Ternary operator: (x != null)? doThis() : elseDo()
- Assignment operators: +=, -=, *=, /=, %=
- Use "this" instead of "self"
- Use "::" instead of ":" due to _javascript_ labels and gotos. This can
change in the future, I want to get rid of it and use default methods
for objects.
Also Killa is not _javascript_, because no matter how much flair
_javascript_ is getting right now, it has very horrendous parts, so I
was aiming for the "beautiful parts" (T)
- Blocks require the braces, they are not optional (you'll have to
type two extra characters now, the madness)
- Killa require variable declaration, the "global" symbol is required
to access global objects.
- Lua variable scope (no _javascript_ hoisting, no need to declare
everything at the beginning and must declare before use)
- No arrays (by now) only Lua tables
- No switch neither exceptions (by now) also prototype mechanism.is
missing (and I don't think I'll add it later)
- No ++ -- operators (they are not coming, many reasons, most
important I'm not that smart to decipher quickly the one liners I have
seen in real life)
- Lua Multiple assignment and return values
- Lua coroutines
- Lua powered for fast embedding and small footprint (this rocks) :D
There a lots of things I want to add to Killa (native arrays, classes,
vectors, matrices, etc) because Killa is more focused for game
development
I need speed and I want small footprint, so if I can speed things I'll
do it, (without resorting to JIT by now).
I hope the game Lua community could give me some ideas and things they
would like to see in Killa 0.2 and hopefully find some users
interested on using it.
Thanks!
Laurens Rodriguez