Its more like C/C++ than BASIC. Basic naming convention doesnt allow leading underscores in the names of identifiers, also square braces and curly braces aren't used at all in basic. Function return values using the return keyword. BASIC uses explicit assignment of the returns to the function name. These are C conventions. The only things it seems to take from BASIC is the if..else..then construct and worded operators.Graf Zahl wrote:I'd have to agree with that. I really, *really* don't like this language - at all!
It's a real shame that they had to use crap BASIC syntax as a guideline to design their language.
Lua
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- Ryan Cordell
- Posts: 4349
- Joined: Sun Feb 06, 2005 6:39 am
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Capital of Explodistan
As a matter of fact you're right. I just looked up some sample pascal code and Lua bears a most remarkable resemblance to it. Id say Lua was based strongly on pascal.Graf Zahl wrote:I don't see much of C in Lua. If not BASIC than more PASCAL - but no C.
ACS was modeled on C. But I believe that Lua would be a better choise. The syntax is more english like which seems better suited for scripting events in a virtual world. I think newcomers will be more at ease reading english like scripts than program like scripts. The veterans here would disagree but remember you're already versed in ACS/DECORATE/C++ but there are a lot of people who aren't.Blade Nightflame wrote:IMO, I never thought DoomScript was planned with UnrealScript at first. LUA seems a bit like an odd language to use or even master. C or C++ would sound awesome with it, but that's just my personal opinion.
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
- Ryan Cordell
- Posts: 4349
- Joined: Sun Feb 06, 2005 6:39 am
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Capital of Explodistan
I'm not the kind who just takes whatever that gets thrown at me but if Lua is any chance of seeing anything more advanced (because I don't like hacks anymore)... I'd say just let it happen.
I've been waiting for almost five years for DoomScript, I'm sure there are others who've waited even more (ZDoom will be ten years old next year!), I just don't want to wait anymore.
I've been waiting for almost five years for DoomScript, I'm sure there are others who've waited even more (ZDoom will be ten years old next year!), I just don't want to wait anymore.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49228
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Just looking at the Lua examples gives me the creeps. All the stuff I hated about Pascal which made me convert completely to C 15 years ago is back with a vengeance. I always found code that requires written keywords to declare blocks of statements very hard to read because there's nothing intuitive about these kinds of separators. C's braces are nice and easily spotted and among all programming languages I know are the most readable solution of all.
To be honest, I'd rather write an ACC-style compiler rather than use this language.
Yes, I know that a grammar-based parser is supposed to be the way to go and I also know that expanding this with unexpected new features might be harder but somehow I never got anywhere with a grammar based parser. It's just not my style of doing things.
A few years ago I did some work on ACC to expand it to be able to write action functions. It was working to some degree but since I never tried to eliminate ACC's limitations I gave up eventually. A language without type checking and a high risk of undetectable programming errors wasn't that appealing. But I think that with my current experience I could get something to work that can parse a more powerful language.
To be honest, I'd rather write an ACC-style compiler rather than use this language.
Yes, I know that a grammar-based parser is supposed to be the way to go and I also know that expanding this with unexpected new features might be harder but somehow I never got anywhere with a grammar based parser. It's just not my style of doing things.
A few years ago I did some work on ACC to expand it to be able to write action functions. It was working to some degree but since I never tried to eliminate ACC's limitations I gave up eventually. A language without type checking and a high risk of undetectable programming errors wasn't that appealing. But I think that with my current experience I could get something to work that can parse a more powerful language.
I'd prefer a C-like syntax over this, but if this is the only chance we have to get a lot of these features in...
I find no value in the argument that a programming language needs to look like English. I have a little experience coding in a lot of different things, and in my opinion the "English-like" languages are the worst. English is vague and ambiguous. Code should not be. Code does not have to look like prose to be readable. In most cases, that makes it worse.
I find no value in the argument that a programming language needs to look like English. I have a little experience coding in a lot of different things, and in my opinion the "English-like" languages are the worst. English is vague and ambiguous. Code should not be. Code does not have to look like prose to be readable. In most cases, that makes it worse.
For a non-programmers POV, it seems a little odd to be introducing something that is quite different in feel to what already exists. IMO, standardisation should be considered as an important factor rather than having to use one set of rules when doing one thing to Zdoom and a different set when doing something else to it.
Fun times.
Lua is certainly capable. Garry's Mod is a good demonstration of that, allowing custom weapons, game rules, menus, and a slew of other things I have no idea about because I never got into it. I'm more or less impartial about the whole style and syntax side of it; syntax has never really been an issue with me for small scripting languages provided a reasonable reference is available. Likewise, I think most people would probably pick it up if it were the only solution available. The value of that is in the eye of the beholder, though. Something that is reasonable and convienent for end users is very desirable, and how well Lua really does fit that... I can't be sure.
Lua is certainly capable. Garry's Mod is a good demonstration of that, allowing custom weapons, game rules, menus, and a slew of other things I have no idea about because I never got into it. I'm more or less impartial about the whole style and syntax side of it; syntax has never really been an issue with me for small scripting languages provided a reasonable reference is available. Likewise, I think most people would probably pick it up if it were the only solution available. The value of that is in the eye of the beholder, though. Something that is reasonable and convienent for end users is very desirable, and how well Lua really does fit that... I can't be sure.
Whitespace is another beauty of a language.Other people wrote:Brainfuck, Malbolge
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
Seconded! Oh, so seconded.Graf Zahl wrote:I always found code that requires written keywords to declare blocks of statements very hard to read because there's nothing intuitive about these kinds of separators. C's braces are nice and easily spotted and among all programming languages I know are the most readable solution of all.
@nash: http://www.dangermouse.net/esoteric/piet.html
I started working on an interpreter for it and its almost to the point that it works but I am stuck in a few areas.
As for lua, I think graf said everything that needs to be said on the topic.
I started working on an interpreter for it and its almost to the point that it works but I am stuck in a few areas.
As for lua, I think graf said everything that needs to be said on the topic.