Hi,
I recently asked if AmiBlitz to Hollywood Convert was possible?
I have looked at some LUA code and it seems to strongly resemble Hollywood code.
So is it possible to convert LUA to Hollywood or is there a command comparison table available?
Please keep in mind I didn't look at LUA too indepth, I just read something about LUA and checked out some code.
If it's not possible then let me know and this post can die.
Thank you.
LUA to Hollywood Convert, Possible?
- airsoftsoftwair
- Posts: 5887
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: LUA to Hollywood Convert, Possible?
It's basically possible but there are lots of differences that you need to take care of. Here are some that come to my mind:
- syntax is different, e.g. lua always uses "end" to close all kinds of scopes (I don't find that very readable)
- Hollywood uses zero indices while lua starts at 1 (which is totally ugly IMHO)
- lua is case sensitive, Hollywood is not
- lua requires you to declare variables, Hollywood does not
- Hollywood doesn't have the coroutine feature of lua
- lua has a much stricter handling of nil
- lua has a special boolean variable type; in Hollywood a boolean is just a number
- not all calls of the lua standard libraries are available in Hollywood but the most important are there
- Hollywood has all kinds of extensions to the lua language that were necessary to keep compatibility with Hollywood 1.x or that were just vanity changes because I didn't like the lua implementation
Keep in mind that Hollywood 1.x didn't use lua but my own VM. Thus, the challenge for Hollywood 2.0 was to replace the VM and keep compatibility with all old scripts. That's the reason why Hollywood's flavor of lua is quite different from lua.
- syntax is different, e.g. lua always uses "end" to close all kinds of scopes (I don't find that very readable)
- Hollywood uses zero indices while lua starts at 1 (which is totally ugly IMHO)
- lua is case sensitive, Hollywood is not
- lua requires you to declare variables, Hollywood does not
- Hollywood doesn't have the coroutine feature of lua
- lua has a much stricter handling of nil
- lua has a special boolean variable type; in Hollywood a boolean is just a number
- not all calls of the lua standard libraries are available in Hollywood but the most important are there
- Hollywood has all kinds of extensions to the lua language that were necessary to keep compatibility with Hollywood 1.x or that were just vanity changes because I didn't like the lua implementation
Keep in mind that Hollywood 1.x didn't use lua but my own VM. Thus, the challenge for Hollywood 2.0 was to replace the VM and keep compatibility with all old scripts. That's the reason why Hollywood's flavor of lua is quite different from lua.
- airsoftsoftwair
- Posts: 5887
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: LUA to Hollywood Convert, Possible?
Also, lua allows you to leave out the function parentheses if the function takes a string or table. So the following lua code
maps to
in Hollywood.
Code: Select all
myfunc{x = 1, y = 2}
myfunc"hello"
Code: Select all
myfunc({x = 1, y = 2})
myfunc("hello")