Lua

Archive of the old editing forum
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.
User avatar
Niya
Posts: 150
Joined: Thu Sep 14, 2006 8:56 pm

Post by Niya »

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.
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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49228
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

I don't see much of C in Lua. If not BASIC than more PASCAL - but no C.
User avatar
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

Post by Ryan Cordell »

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.
User avatar
Niya
Posts: 150
Joined: Thu Sep 14, 2006 8:56 pm

Post by Niya »

Graf Zahl wrote:I don't see much of C in Lua. If not BASIC than more PASCAL - but no C.
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.
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.
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.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

However, the switch to Lua would make the newbies pick it up but would bamboozle the vetrans who are used to using C-style syntaxes in ZDoom.
User avatar
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

Post by Ryan Cordell »

Certainly Randy could implent Lua AND C (Either work when used. Don't think crossing between should be possible), but that would take WAY more time and, well.. Hearing from Randy then will be like knowing anything about Area 51.
User avatar
Nash
 
 
Posts: 17487
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49228
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

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.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

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.
User avatar
Enjay
 
 
Posts: 26984
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

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.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

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.
Other people wrote:Brainfuck, Malbolge
Whitespace is another beauty of a language.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

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.
Seconded! Oh, so seconded.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

I share the opinion that it'd be nicer to have something closer to C, however as others have stated, if this is the way it's got to be done for us to have the power of DoomScript, then I'm all for learning a new language.
User avatar
Nash
 
 
Posts: 17487
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Speaking of esoteric programming languages, which was the one where you had to actually DRAW the code (the source is actually an image where different colours and directions will be intepreted as different commands and stuff).

It was beautiful. :trippy:
User avatar
Necromage
Posts: 484
Joined: Thu Feb 10, 2005 3:13 pm
Location: NJ
Contact:

Post by Necromage »

@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.
Locked

Return to “Editing (Archive)”