views:

172

answers:

4

Remember, this is using python. Well, I was fiddling around with an app I made called Pyline, today. It is a command line-like interface, with some cool features. However, I had an idea while making it: Since its like a "OS", wont it have its own language?

Well, I have seen some articles online on how to make a interpreter, and parser, and compiler, but it wasn't really readable for me. All I saw was a crapload of code. I am one of those guys who need comments or a readme or SOME form or communication towards the user without the code itself, so I think that Stack Overflow would be great for a teenager like me. Can I get some help?

+6  A: 

You need some grounding first in order to actually create a programming language. I strongly suggest picking up a copy of Programming Language Pragmatics, which is quite readable (much more so than the Dragon book) and suitable for self study.

Once you are ready to start messing with parsers, ANTLR is the "gold" standard for parser generators in terms of usability (though flex+bison/yacc are quite capable).

Yann Ramin
+1  A: 

Like theatrus, I'd suggest starting with a good book on the subject. I can definitely recommend Language Implementation Patterns by Terence Parr (the man behind ANTLR, a common parser generator).

nikie
I wouldn't recommend *Language Implementation Patterns* to someone new to the subject.
Bart Kiers
+1  A: 

I just came by Xtext, a language development framework. Perhaps that's something you might want to take a look at.

Considering Python you might find it instructive to implement a version of Logo. If you want, you can skip the parsing/lexing stage for now and come up with a object oriented version first to get you going if your OOP skills are up to it. Later on you can hook it up with some graphics library to actually draw something.

In addition to Logo you might want to check out L-systems. See particularly The Algorithmic Beauty of Plants for inspiration.

bebraw
+1 for ABP. Term rewritting is easy to pick up
Yann Ramin