How do I make my own programming language?

Started by
11 comments, last by doynax 18 years, 8 months ago
I know that's a very big question to ask, but does anyone know of some websites or books that would give you at least the basics of writing your own language/compiler?
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
Advertisement
bump... boards are really busy today.
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
If your interested you can follow this website I have put up for specifications for a new language. CodeBASIC . Also looking for input and feedback, so your more than welcome to post questions.

-------------Become part of developing the specifications of a new language. Visit CodeBASIC.org
Check out flex (fast lexical analyser) and bison (parser generator).
Depends on what exactly you mean.

Making a programming language is easy. Just sit down with a piece of paper, and write a few rules down for the language. Then that's a (probably very ambiguous, and not very useful) language specification.

If you want to write a compiler or interpreter for the language, it's a lot more complex. ;)
But then it's basically the same as writing those for an existing language.
Here's a good start: Let's build a compiler!
Sorry, should have posted a helpful link:


Compiler Construction using Flex and Bison
http://cs.wwc.edu/~aabyan/464/Book/

I would say that this is not for the faint of heart.
You may also want to check out the dragon book at your local university's library.
The "Dragon Book" is very good. It's actual name is "Compilers: Principles, Techniques, and Tools", by Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman. It may be a bit dated in some areas, but it's still the canonical reference book for anyone wanting to create a compiler (or interpreter).
I'm currently taking translators (which is basically introduction to writing compilers). And it is certainly not for the faint of heart, but it is a fantastic thing to understand. Knowing things like parse trees and syntax directed translation help you think like your compiler, and you can more readily understand why things are implemented the way they are in todays languages. I agree with the previous posts suggesting Flex/Bison (some times refered to as lex/yacc which were very similar beasts from way back when). The standard as far as books on compilers is concerned is still "Compilers: Principles, Tools, and Techniques" by Alfred V Aho, Et. Al. (ISBN 0201100886), although it was written in 1986. Best of luck in your studies.

This topic is closed to new replies.

Advertisement