Skip to main content
gamedev.net
🔒 Locked

Creating a scripting language

Started by oWen 19 replies 1.2k views
Original Post
oWen
oWen
Hey Guys, I''ve always had an urge to create an interpreted language, and I think I''m ready to start, but I don''t know where to begin. Does anyone know of a good site or maybe a book that explains the basics and beyond? Any help would be appreciated. Later
WMiller
WMiller
The "Purple Book" -- Structure and Interpretation of Computer Programs, by Abelson, Sussman, and Sussman is very good.

On the downside, it''s all in LISP/Scheme
oWen
oWen
Sweet! But I don''t know Scheme. hehe.
I''ll look in to it though. I love learning languages.
LilBudyWizer
LilBudyWizer
Try "Writing Compilers and Interpreters" by Ronald Mak. It''s in C++.
Keys to success: Ability, ambition and opportunity.
Staffan
Staffan
flex/lex and bison/yacc are awesome, and they come with good documentation and are easy to use. A must.

Also there are some pretty good articles at www.flipcode.com that I recommend if you don''t want to cash out the money a book costs.


"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
Eraserhead
Eraserhead
quote:
Original post by Staffan

flex/lex and bison/yacc are awesome, and they come with good documentation and are easy to use.


LOL!



Edited by - Eraserhead on April 20, 2001 11:47:01 AM
Staffan
Staffan
quote:
Original post by Eraserhead

[quote]Original post by Staffan

flex/lex and bison/yacc are awesome, and they come with good documentation and are easy to use.


LOL!



Edited by - Eraserhead on April 20, 2001 11:47:01 AM

But they _are_! It''s all in the manual(/info)!


"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
oWen
oWen
Well, How would you guys feel about a language that is converted into C then compiled say w/ GCC?

For instance, I could make the parser w/ Perl and have it translate the code to C and then let it be compiled w/ GCC.

I read somewhere GCC does the same thing; I could be mistaken though. Does anyone know more about this?


Edited by - owen on April 21, 2001 10:40:09 PM
merlin9x9
merlin9x9
Sure, that''ll work. But if you want a scripting language, chances are that you want it to be platform-independent without the need for recompilation, and this technique will not allow that.

You read somewhere that GCC does what?
oWen
oWen
Well, I guess the language would no longer be considered a scripting language if it was done that way, but the translater/language would be platform independent. (made in perl and using GCC).

oWen
oWen
Thanks for the link! You do a good job explaining the basics of creating a language, and I hope you finish it soon. Also, I'll need to pick up on Assembly; do you recommend any good books?

BTW, I'm looking forward to Ultima 1 - A legend is reborn. =)

Thanks again,
Owen


Edited by - owen on April 22, 2001 11:01:14 AM
Livecoma
Livecoma
Lots of Win32 MASM tutorials here with a descent forum:

http://spiff.tripnet.se/~iczelion/


They have a huge assembly languedge reference here in the form of a .pdf. I haven''t checked it out myself yet though

http://webster.cs.ucr.edu/nonFrame.html

gonzo
gonzo
Check out www.flipcode.com they have a tutorials section that goes through how you write a scripting language....also get the "Dragon Book" about compiler design....

Matt
Zipster
Zipster
What a coincidence! I''m in the process of writing my own scripting language. A lot of linked lists, lemme tell ya. Right now I''m just working on the parser. I already have it read the file and load the parameters into linked lists and such, as the parser is just about done. All I need to do is work on more complex statements than function calls, like assignment statements and loops and such. My suggestion to you is to design how you will store all the script information first, and whether or not you want to use linked lists or static arrays, etc. Then you want to figure out a way you want your script to be formatted so that the loader can actually read the file and load your data structures with the right information. After you have all the basic loading/parsing done, you want to be able to interpret the scripts into actual commands and functions and have the program execute the right thing. If you have any more questions, I''d be glad to help. Scripting engines are fun to work on... at least for me.
ritesho
ritesho
He guys,

anybody knows were I can get that Flex or Bison tool?

The website would be good to

Thanx
ritesho
ritesho
He guys,

anybody knows were I can get that Flex or Bison tool?

The website would be good to

Thanx
oWen
oWen
Hey Guys,

I was doing some searching for Flex and Bison when I happen to run accross a tool called Gentle. I was wondering if anyone has ever used it, and if so what are your thoughts on it?

To me it seems like a very usefull

Gentle : http://www.first.gmd.de/gentle/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.