Creating a Scripting Language

Started by
7 comments, last by masterconjurer 21 years, 10 months ago
How hard would it be to make my own scripting language compiler program thingy in Visual Basic? Is there a website or tutorial I could look at to figure out how to do it?
Advertisement
u could make a VERY slow scripting language in VB, and i really doubt a Compiler is Possible seeing VB is kinda a scripting language as it iz.

Learn C++ man, whey smoother, its pretty easy to get into, just dont give up at pointers and ur gonna be sweet =)
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
Is there anywhere that I can go to get information on creating a Scripting Language in C++ or any other Programming Language?
http://www.gamedev.net/reference/articles/article1633.asp

There are also several other articles that deal with scripting in the "Articles and Resources" section on this website. Check them out.
quote:Original post by: silvermace
and i really doubt a Compiler is Possible seeing VB is kinda a scripting language as it iz


You can write a compiler in any language you like, all you''re doing is converting one type of file into another (i.e. source code in machine language). There''s no reason why you couldn''t write a C++ compiler in COBOL, for example. The code your program compiles won''t be any slower, because the generated code has nothing whatsoever to do with the language the compiler was written in.


codeka.com - Just click it.
I am playing around with scripting some AI behaviour and other stuff in a 3d world. The bulk of the program is written in C++ but uses lua for the scripted components.

Lua is designed to be embedded, is easy to use, and will probably be a hell of a lot more fun than writing your own.
Thanks sQuid! I''ll check into that link you posted.
If you want to implement your own scripting engine, then go to the tutorials section on flipcode.com, and there is a whole series (8 part''s i think) that shows you the steps needed to implement one. If its ok to use third party libraries, then you can go with lua etc. If you are working on a university project and have to do everything on your own (like in my case), then those tutorials will be helpfull.
I didn''t check out the links provided by the other posters here, but personally I like the tools Lex (or Flex) and Yacc (or Bison). You use those tools to define the syntax of your language and to control the parsing. These tools generate C code that you can include in whatever project you need it in.

Besides the C++ compiler itself, I''d say these tools have been the most useful to me in my work as a SW engineer! Every programmer should know how to use them! Besides creating your own language, they are very useful whenever structured files need to be parsed for whatever purpose.

This topic is closed to new replies.

Advertisement