RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
valderman
Mage


Joined: 29 Aug 2002
Posts: 334
Location: Gothenburg, Sweden

PostPosted: Fri Dec 26, 2003 12:23 am    Post subject: Oops...I did it again. [quote]

I realized that the VVM (my old scripting system, in the engine section here on RPGDX) stack machine is fubar, so I decided to start over on a new scripting system...or actually, the new system jumped on me when doing something completely unrelated.
Anyway, here's what I've done on it so far...I'd be interested in hearing your comments on the somewhat odd approach to program flow control I've taken, and the design of the language itself (Is == better than =? Is postfix better than prefix?)

Zip with script class and example script, if anyone is interested.
_________________
http://www.weeaboo.se
Back to top  
Rainer Deyke
Demon Hunter


Joined: 05 Jun 2002
Posts: 672

PostPosted: Fri Dec 26, 2003 7:08 am    Post subject: [quote]

Kind of a poor man's Interpreter Pattern. I think you'd be better off using the full Interpreter Pattern, even though it's initally more work. Also, a full recursive descent parser would probably be worthwhile if you plan on doing anything interesting with this system.

There are a couple of things about the scripting language which really bother me. Like having to pass dummy values, implicit assigment to 'ret', and the appearent inability to nest expressions. 'loadmem' and 'savemem' look like they should be handled implicitly behind the scenes, not as explict parts of the script. 'number = anothernumber + 10' should work. And I really don't like the block syntax - either Python blocks (colon and indentation) or C blocks ({ and }) would be preferable to writing "end if", although this is very subjective.

As for the code itself, I think the less I say (*mumble* manual memory management *mumble*) the better.
Back to top  
valderman
Mage


Joined: 29 Aug 2002
Posts: 334
Location: Gothenburg, Sweden

PostPosted: Fri Dec 26, 2003 11:33 am    Post subject: [quote]

Yeah, all those things you pointed out bother me as well (esp. return values being returned to 'ret', but I'm lazy). To tell the truth, I prefer the C-style syntax as well, but I guess things like this happen when a language grows way beyond what it was intended for. When the need arises for that full recusrive descent I'll probably start all over again, so I don't think I'll spend any time doing such major modifications to this code.
loadmem and savemem can be handled behind the scenes, since they're just wrappers for the variable list Load and Save members. Now that I think of it, I think I forgot to put that file in the archive, so it won't compile...crap. I'll have to do something about that.
As for manual memory management...well, at least it doesn't leak, though you're really right. It was a real pain in the ass to get all the destructors to delete the right things at the right time (INSTRCHAIN especially).

I guess I'll have a go at creating a small, RPG using that language for scripting, adding things as I go and hope that it'll be enough. After all, I'm doing this to learn.
_________________
http://www.weeaboo.se
Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum