🔒 Locked
Scripting Article Proposal
Advertisement
Original Post
I''m considering writing an article (or series of articles) on the subject of creating a scripting language using C++.
I''d like some feedback/discussion as to what some people would like to see included. Please feel free to share any ideas, and I''ll see what I can do.
Note: It may take a long time to get around to writing the article(s) as I''m already in way over my head with work. So don''t expect overnight miracles
"Don''t be afraid to dream, for out of such fragile things come miracles."
OK where are all those people I''ve seen clamoring for a good scripting series??
I guess the first thing we call all agree on is that it be done in C++ not VB (sorry nes8bit but... tough
)
_________________________________________________________________
Drew Sikora
A.K.A. Gaiiden
ICQ #: 70449988
AOLIM: DarkPylat
Blade Edge Software
Staff Member, GDNet
Public Relations, Game Institute
3-time Contributing author, Game Design Methods , Charles River Media (coming GDC 2002)
Online column - Design Corner at Pixelate
IGDC - the International Game Developers Chat! [irc.safemalloc.com #igdc]
NJ IGDA Chapter - NJ developers unite!! [Chapter Home | Chapter Forum]
I guess the first thing we call all agree on is that it be done in C++ not VB (sorry nes8bit but... tough
_________________________________________________________________
Drew Sikora
A.K.A. Gaiiden
ICQ #: 70449988
AOLIM: DarkPylat
Blade Edge Software
Staff Member, GDNet
Public Relations, Game Institute
3-time Contributing author, Game Design Methods , Charles River Media (coming GDC 2002)
Online column - Design Corner at Pixelate
IGDC - the International Game Developers Chat! [irc.safemalloc.com #igdc]
NJ IGDA Chapter - NJ developers unite!! [Chapter Home | Chapter Forum]
Actually, I''d like to see more of how to embed existing scripting languages (or subsets thereof) in your applications, so you don''t have to go to all the work of creating a new language. The ideal scripting language would be high-level enough for the user not to have to worry about variable types and such nonsense (it would be handled by the parser, with exceptions for ambiguous situations), freely available, clear in syntax, free-form (allow insertion of arbitrary whitespace) and verbose (lots of in-built routines to simplify common tasks).
By making it a complete language, it opens the possibility of users being able to completely modify the game (if the designer so desires) a la UnrealScript (which I''ve never seen or touched, but I''ve heard good things about). My prime candidates are Perl, Python, a PHP variant and Ruby. The Nebula device from Radon Labs embeds Tcl/Tk; Blender embeds Python... The skills gained are also applicable to a wider range of projects than pure gaming-related.
I know there are documentation and tutorials on this on the net, but since we''re on the topic...
By making it a complete language, it opens the possibility of users being able to completely modify the game (if the designer so desires) a la UnrealScript (which I''ve never seen or touched, but I''ve heard good things about). My prime candidates are Perl, Python, a PHP variant and Ruby. The Nebula device from Radon Labs embeds Tcl/Tk; Blender embeds Python... The skills gained are also applicable to a wider range of projects than pure gaming-related.
I know there are documentation and tutorials on this on the net, but since we''re on the topic...
hehe... not quite what I had in mind.
I was proposing more of a tutorial on how to create your own system for scripting, involving the creation of a virtual machine, and then forming a language that can be broken down into the simple instructions which the machine would understand, involving your own lexical scanning, parsing, and then the instruction generation.
"Don''t be afraid to dream, for out of such fragile things come miracles."
I was proposing more of a tutorial on how to create your own system for scripting, involving the creation of a virtual machine, and then forming a language that can be broken down into the simple instructions which the machine would understand, involving your own lexical scanning, parsing, and then the instruction generation.
"Don''t be afraid to dream, for out of such fragile things come miracles."
I''m creating a DDraw class based engine, and a Scripting language to control it would be nice. So that I can use the structures and objects I''ve created effectively in a game setting. So the virtual machine would be a platform for the game I guess.
So yes I am interested in a series of articles that explain how to create a scripting language in C++.
George D. Filiotis
So yes I am interested in a series of articles that explain how to create a scripting language in C++.
George D. Filiotis
My main concerns I think are:
Please make it actually comprehsnsible! There are plenty of scripting tutorials floating around which were obviously written by brilliant people to who every concept involved in writing a compiler and VM are obvious. I am not one of them
Please explain everything as well as you are able.
I guess my other concern is related to that; if you''re going to base your code off of the flex/bison combo, PLEASE don''t assume the reader is an expert in their use. Almost all scripting tutorials will show a page of flex/yacc source code and go "what this does is obvious". That''s my cardinal sin of tutorial-writing, not explaining everything. The whole point of a tutorial is to explain something, not throw some source code into an HTML file and say "now you know how to write a scripting language".
Looking forward to your article!
Anthracks
Please make it actually comprehsnsible! There are plenty of scripting tutorials floating around which were obviously written by brilliant people to who every concept involved in writing a compiler and VM are obvious. I am not one of them
I guess my other concern is related to that; if you''re going to base your code off of the flex/bison combo, PLEASE don''t assume the reader is an expert in their use. Almost all scripting tutorials will show a page of flex/yacc source code and go "what this does is obvious". That''s my cardinal sin of tutorial-writing, not explaining everything. The whole point of a tutorial is to explain something, not throw some source code into an HTML file and say "now you know how to write a scripting language".
Looking forward to your article!
Anthracks
You bring up some very good points, Anthracks... and these points are the main reason why I think a good scripting series still needs to be done, because I agree entirely.
That''s also why I wanted a good amount of feedback before even beginning, to bring these points into the open.
Now to answer your questions a little more directly:
I wasn''t planning on using lex, yacc, or any of their variants (flex and bison as you mentioned). Part of the reason is that I myself am not truly knowledgeable in their use, and perhaps their use would be enough to fill an article themselves. The other part is that brewing your own scanner(s) and parser(s) is itself educational, and allows you to learn a lot about what is really going on during the compilation process.
I plan to make things as comprehensible as humanly possible. The ideal would certainly be explaining everything without going into any fancy jargon/lingo-speak, and instead base everything off of practical/analytical programming-sense. If you''re programming, you certainly have this at the very least. Anything less would be a tutorial on how to program.
Symphonic: I think we''re on the same wavelength, although the use of the word "platform" may entail something different. Please explain what your concept is relating to the use of this word, to make sure.
"Don''t be afraid to dream, for out of such fragile things come miracles."
That''s also why I wanted a good amount of feedback before even beginning, to bring these points into the open.
Now to answer your questions a little more directly:
I wasn''t planning on using lex, yacc, or any of their variants (flex and bison as you mentioned). Part of the reason is that I myself am not truly knowledgeable in their use, and perhaps their use would be enough to fill an article themselves. The other part is that brewing your own scanner(s) and parser(s) is itself educational, and allows you to learn a lot about what is really going on during the compilation process.
I plan to make things as comprehensible as humanly possible. The ideal would certainly be explaining everything without going into any fancy jargon/lingo-speak, and instead base everything off of practical/analytical programming-sense. If you''re programming, you certainly have this at the very least. Anything less would be a tutorial on how to program.
Symphonic: I think we''re on the same wavelength, although the use of the word "platform" may entail something different. Please explain what your concept is relating to the use of this word, to make sure.
"Don''t be afraid to dream, for out of such fragile things come miracles."
Well, I think something on how to use Yacc and Lex would do, since everybody says that''s what you use to make script engines, but I havent seen how.
as for embeding, it is not too hard to come up with something, in fact I am embeding TCL in my engine, seems easy enoght, the thing is that it is hard to explain without already having at least the sprite engine working, so you have to rely on abstract ideas.
as for embeding, it is not too hard to come up with something, in fact I am embeding TCL in my engine, seems easy enoght, the thing is that it is hard to explain without already having at least the sprite engine working, so you have to rely on abstract ideas.
Believe me when I say that plenty has been written on using lex and yacc, though most of it has been vague from my experience.
Plus I don''t have much experience with either. The same goes for embedding an already existing language. Not to mention, where''s the fun in that?
So...
"Don''t be afraid to dream, for out of such fragile things come miracles."
Plus I don''t have much experience with either. The same goes for embedding an already existing language. Not to mention, where''s the fun in that?
So...
"Don''t be afraid to dream, for out of such fragile things come miracles."
It sounds like your series will be quite informative Redleaf, I''m glad we seem to share some of the same concerns regarding existing information on scripting languages. I find it interesting that you plan to write your own tools for it rather than use pre-existing ones...I actually tried that myself and had a little success (more than I ever did with yacc/lexx!), although I had to resort to painfully simple syntax in the scripts because I didn''t really know what I was doing
.
How complex do you intend to make the language you design in the tutorials? I could never think of a good way to support user-defined functions, with arguments and all that, so that would be interesting if you''re up for the challenge heh. I think object-orientation might be a bit complex for what 99% of the amateur game developers on the boards (myself incldued) need though, if you were even considering touching that mess
.
I guess that''s about all I can think of to ramble about now...good luck!
Anthracks
How complex do you intend to make the language you design in the tutorials? I could never think of a good way to support user-defined functions, with arguments and all that, so that would be interesting if you''re up for the challenge heh. I think object-orientation might be a bit complex for what 99% of the amateur game developers on the boards (myself incldued) need though, if you were even considering touching that mess
I guess that''s about all I can think of to ramble about now...good luck!
Anthracks
How about a scripting language based on a subset of java-script? This would be halfway between C and Basic, in a similar camp to Java, C#, PHP, etc.
My personal preference for implementation language would be C rather than C++. As a VB programmer, and I find it easier to incorporate sample C code by placing it in standard DLL functions which can be called by a VB application, rather than trying to tie C++ code into some ActiveX DLL framework which can called by VB. There might be others out there who prefer C rather than C++ for other reasons i.e. its the lowest common denominator for C/C++ programmers.
It would be good to see how an application can expose its own functionality to the scripting language, so that the scripting language can make calls to say the aplication''s game engine.
I''m looking forward to the article.
My personal preference for implementation language would be C rather than C++. As a VB programmer, and I find it easier to incorporate sample C code by placing it in standard DLL functions which can be called by a VB application, rather than trying to tie C++ code into some ActiveX DLL framework which can called by VB. There might be others out there who prefer C rather than C++ for other reasons i.e. its the lowest common denominator for C/C++ programmers.
It would be good to see how an application can expose its own functionality to the scripting language, so that the scripting language can make calls to say the aplication''s game engine.
I''m looking forward to the article.
I would just like to back up Anthracks 100%. Too many of the articles assume too much knowledge.... knowledge that, if you had it, you wouldn''t need the article anyway. Especially on the Lex/Yacc front, where they say that "using Lex/Yacc, all the hard work was done in 3 hrs". Whereas I have struggled with Lex/Yacc and the sparse documentation for days without working out how to get anything useful from it. I understand the theory, I can run the software, but getting my language all set up with it and done in the right order etc etc is totally glossed over in all the current documentation and tutorials. So if you were gonna describe how to do the lexing/parsing in another way, that would be fine.
There is a scripting tutorial on flipcode by Jan Niestadt (using flex+bison) which I used successfully to create a very simple language (integers only, +-*/, if/else, while loop) + a virtual machine, but it was helpful that I had some knowledge about formal languages/automatons. So I don''t know if it is useful for an absolute newbie...
Really Good Idea..... (Just what I was looking for to tell the truth)
I have made a recursive descent parser which works quite well expect for a few problems of speed and memory so I dont want to use it in a game.... so Im really looking forward to this
Also Im beginning to get sick of all the VB stuff... You find a tutorial of just what you wanted... start reading and once you get to the code... its vb (really bugging)
Well....
Thats all I had to say
Qix
Edited by - Qix99 on November 17, 2001 3:36:59 AM
I have made a recursive descent parser which works quite well expect for a few problems of speed and memory so I dont want to use it in a game.... so Im really looking forward to this
Also Im beginning to get sick of all the VB stuff... You find a tutorial of just what you wanted... start reading and once you get to the code... its vb (really bugging)
Well....
Thats all I had to say
Qix
Edited by - Qix99 on November 17, 2001 3:36:59 AM
I
Has source files that you can modify in plaintext.
Is based off of C/C++.
Has variables, functions, and objects(structs/classes).
See, I really dont quite understand VMs, and compiler thoery is unknown to me as well.
So maybe you want to have a series that first covers what you need to use a scripting language, then how you make a langue, and then how to implement a language.
I came, I saw, I got programmers block.
~V''''lion
d be interested.
Basically Id want a article that convers the essentials of using a scripting language that:Has source files that you can modify in plaintext.
Is based off of C/C++.
Has variables, functions, and objects(structs/classes).
See, I really dont quite understand VMs, and compiler thoery is unknown to me as well.
So maybe you want to have a series that first covers what you need to use a scripting language, then how you make a langue, and then how to implement a language.
I came, I saw, I got programmers block.
~V''''lion
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement