Books and URLs for Scripting Languages, or creations thereof

Started by
16 comments, last by DakeDesu 21 years ago
Well, after the list of articles on this site, I have decided to do some further research Googling ''Compiler Design'' brings back about 9.2e5 results (most of them plugs for books), so suggested URLs are a nice thing (I will be making my way through this, just wish I had some website pointers). So what are some suggestions on books and websites for learning how to make a scripting language? Wizards Rule #2: The action with the greatest intent, can have the most serious consequences "You need to know your friends / you need to know / I''ll be waving my hand / watching you drown / watching you scream / quiet or loud / and maybe you just need / a friend as clumbsy as you''ve been / there is no one laughing" Our Lady Peace :: Clumsy "All warefare is based on deception" Sun Tzu :: Estimates | Calculations | Planning :: Verse 17. "We will not rest until terror is gone" President Bush, saving the world from the Terrorist Boogieman.
[ Six Hour Game Contest | ( Thread | Blog | Wiki | 6hour Bio ) ][ Website | (Blog | Gallery ) ]
Advertisement
The industry standard is known as the ''Dragon book'' by Aho etc al. Its actual title is ''Compilers: Principles, Techniques, and Tools''
http://www.amazon.com/exec/obidos/ASIN/0201100886/qid=1049840066/sr=2-1/ref=sr_2_1/102-6781748-9940121

It is very expensive, so I recomend getting it from a university library.

It''s over 10 years old, but it is still the best. I''m sure I wont be the last person recommending this book to you.
The Dragon Book is still good, but it''s not what I''d call the "best" anymore. It''s definately showing it''s age. I still recommend picking it up, but a far better book is the recent "Modern Compiler Design":

http://www.amazon.com/exec/obidos/tg/detail/-/0471976970/qid=1049947481/sr=8-1/ref=sr_8_1/102-0890133-6456946?v=glance&s=books&n=507846

Also, I wrote this one book called Game Scripting something or other:

http://www.amazon.com/exec/obidos/ASIN/1931841578/qid%3D1049947504/sr%3D11-1/ref%3Dsr%5F11%5F1/102-0890133-6456946

You might learn a thing or two. But if you don''t, it''s really big so it''s great for incapacitating home intruders or evening out wobbly tables.
Thanks, I will see about obtianing those books.
[ Six Hour Game Contest | ( Thread | Blog | Wiki | 6hour Bio ) ][ Website | (Blog | Gallery ) ]
scripting languages?

python, ruby, lua



Or maybe boost.spirit
quote:Spirit is an object oriented recursive descent parser generator framework implemented using template meta-programming techniques. Expression templates allow us to approximate the syntax of Extended Backus Normal Form (EBNF) completely in C++. Parser objects are composed through operator overloading and the result is a backtracking LL(inf) parser that is capable of parsing rather ambiguous grammars.

The Spirit framework enables a target grammar to be written exclusively in C++. Inline EBNF grammar specifications can mix freely with other C++ code and, thanks to the generative power of C++ templates, are immediately executable. In retrospect, conventional compiler-compilers or parser-generators have to perform an additional translation step from the source EBNF code to C or C++ code.


[edited by - petewood on April 10, 2003 3:52:23 PM]
How about SMALL? I know for a fact a few commercial games have shipped using this scripting language and is pretty solid. The memory management I found better than all the alternatives given above.

http://www.compuphase.com/small.htm

Check it out.

-JT
I am not so much doing this to build a game with it--and I can think of a couple of my current projects where using a embeded scripting language in the game, would be complete overkill. I am doing this as more of a learning experience. I could probably design one with the amount of C/C++ knowledge I have--but it just would not be as effective as if I were to have some direction. The goal here is to learn atleast the fundamentals of a language, so that I may, some time in the future, make a meaning contribution to the above mentioned languages.

If anything, this mini project''s only goals are tobecome Turing Complete (or whatever the proper term for that is).

It also has loose connections to a certain inside joke in the... I have already said too much.

Thanks again

Wizards Rule #2: The action with the greatest intent, can have the most serious consequences
"You need to know your friends / you need to know / I''ll be waving my hand / watching you drown / watching you scream / quiet or loud / and maybe you just need / a friend as clumbsy as you''ve been / there is no one laughing" Our Lady Peace :: Clumsy
"All warefare is based on deception" Sun Tzu :: Estimates | Calculations | Planning :: Verse 17.
"We will not rest until terror is gone" President Bush, saving the world from the Terrorist Boogieman.
[ Six Hour Game Contest | ( Thread | Blog | Wiki | 6hour Bio ) ][ Website | (Blog | Gallery ) ]
quote:Original post by DakeDesu
If anything, this mini project's only goals are tobecome Turing Complete (or whatever the proper term for that is).

For that, you only need loop (or recursion), branch and memory allocation. Turing completeness is something of a red herring, as it doesn't tell you anything about the usefulness of a language. For example, the C language minus the libraries is merely a Finite State Automata. Another example: Unlambda is Turing complete, but is useless for practical purposes.

If you're just looking to implement some sort of interpreter, you might consider a simplified dialect of Lisp, which is quite straightforward since it has such a simple and consistent syntax. In many other programming languages, the complexity of the interpreter is focused around applying arbitrary grammatical rules to transform conforming syntax into an AST.

For example, given a C++ style infix expression looking like this:
x + y * z;    

The parser needs to generate an AST that looks something like:
     +    /    x   *      /      y   z 

If you then perform a preorder traversal of this AST, printing each node and using parentheses to delimit functions, then you get this:
(+ x (* y z))    

Which is a Lisp expression! So, the parsing process for the infix grammar is simply a transformation from an arbitrary syntax to something that can be directly represented using Lisp s-expressions.

Edit: editing has resulted in my AST being munged. Oh well...


[edited by - SabreMan on April 11, 2003 12:49:24 PM]
quote:Original post by AlexV
Also, I wrote this one book called Game Scripting something or other:

http://www.amazon.com/exec/obidos/ASIN/1931841578/qid%3D1049947504/sr%3D11-1/ref%3Dsr%5F11%5F1/102-0890133-6456946


I have some questions about this book and since the author is in the house this is a magnificent opportunity

1. Your book is called "game" scripting - but can it be used as a general intro to compilers/intepreters as well (i.e. I''m not as interested in the game approach as a more general one).

2. What language do you use in implementation? C++?



-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction.
"We confess our little faults to persuade people that we have no large ones." -Francois de La Rochefoucauld (1613 - 1680). | My blog
quote:Original post by DakeDesu
If anything, this mini project''s only goals are tobecome Turing Complete (or whatever the proper term for that is).

quote:Original post by SabreMan
For that, you only need loop (or recursion), branch and memory allocation. Turing completeness is something of a red herring, as it doesn''t tell you anything about the usefulness of a language.


Hmm, that explains Intercal''s humour even more....

quote:If you''re just looking to implement some sort of interpreter, you might consider a simplified dialect of Lisp, which is quite straightforward since it has such a simple and consistent syntax.


Now that I think about it, the langauge would probably be better suited as a dialect of Forth.

quote:In many other programming languages, the complexity of the interpreter is focused around turning arbitrary grammatical rules into an AST.

[really nice explanation of AST]


I am sorry to have you have to write out that really decent explanation out--I am sure that you must not like writting that over and over in the forums, I know it would drive me nuts.

Thank you. I will keep this in mind.
[ Six Hour Game Contest | ( Thread | Blog | Wiki | 6hour Bio ) ][ Website | (Blog | Gallery ) ]

This topic is closed to new replies.

Advertisement