Script language design questions
I''m about halfway through developing a scripting engine (sort of like QuakeC or UnrealScript) for my project and I''ve reach a dilemma: Should the script language be object oriented or not?
The reason I''m even asking the question is because I would like this language to run as fast as possible while at the same time be as easy to work with as possible from the end-user''s standpoint.
Here''s the tradeoffs as I see them:
OOP approach:
Easier interface for the user, more easily extensible, considerably more effort required during run-time. (need to maintain current class context while running)
Structured approach:
User code can do faked OOP stuff without much trouble. Not as easily extensible, more effort required during script development. Much more efficient during run-time (no need to keep class context)
If anyone has any thoughts on this, please post ''em.
Thanks
You might consider just having built-in objects. More like super-primitives than objects per se. I can''t think of that many reasons that a person would want to create objects inside a scripting language to begin with. Just make sure your built-in objects are reasonably complete. i.e. include list types, etc.
January 27, 2000 02:47 PM
At first I was just going to use a structured approach, very C-like with game objects represented by struct equivelants. Then I took a look at UnrealScript to see how Epic did their scripting. The whole thing is OO''ed, and they use class instances for game objects which allows some nice features.
Reading that got me thinking "Gee, can I incorporate some of their ideas into what I have? Should I even bother?"
That''s what got me on this whole tangent to begin with.
Reading that got me thinking "Gee, can I incorporate some of their ideas into what I have? Should I even bother?"
That''s what got me on this whole tangent to begin with.
Hmmm,
For some reason my last post comes up under "Anonymous Poster". Strange...
For some reason my last post comes up under "Anonymous Poster". Strange...
Hmmm, I guess it depends on a couple things. Are you directly interpretting the code, or are you compiling it to an intermediate code? If you are compiling it, you should be able to use a simple OO structure with little overhead.
It also depends on how much work you want to do. A structured language won''t take as long to implement as an OO one will. Remember, most scripting languages are just set up to do what is needed. You don''t need to implement a full C++ clone to have a very effective language.
SiCrane''s idea is one that is use extensively in game scripting languages. In fact, there''s an article over on Gamasutra in the programming section about the scripting language that Jedi Knight used. You may want to look there for ideas.
It also depends on how much work you want to do. A structured language won''t take as long to implement as an OO one will. Remember, most scripting languages are just set up to do what is needed. You don''t need to implement a full C++ clone to have a very effective language.
SiCrane''s idea is one that is use extensively in game scripting languages. In fact, there''s an article over on Gamasutra in the programming section about the scripting language that Jedi Knight used. You may want to look there for ideas.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement