# Create a Programming language

This topic is 4815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey, I have been interested in programming for a little bit now. So, I looked at C++ and am learning that and I am getting kind of far into it. Now, I see lots of new programmers come into this world but they leave fast cause they find a language that is simple to use and everything! Well, I am hoping to make a SIMPLE programming language. I mean simple as in really nothing advanced. Then, when I start desining(sorry, I am not very good at spelling)it I will make some simple stuff. Just to get people a simple language to start out with. Now, I here it is SIMPLE to design a language. Just write it down on a sheet of paper. Then, I here it is HARD to make the language, as you have to create a compiler(I think I herd that.)So, if someone could point me to a tutorial or some possible links that will get me going in the right direction. I am hoping to spend sometime developing it, before I actually start doing the compiler. I want the language to be thoght through very well. So, if someone could point me in the right direction, then that would rock! Thanks, Chad.

##### Share on other sites
Check out bison and flex, which is what I've typically used for this type of thing.

A friend of mine really likes PRECC http://vl.fmnet.info/precc/

Thanks man!

Anyone else?

##### Share on other sites
Boost.Spirit for parsing.

##### Share on other sites
Ok. Here is what I would recommend:

1) Develop simple expression evaluator.
2) Make it have variables, define functions, etc(see my website graphing calc applet)
5) Go from there

##### Share on other sites
Read up on BNF and attribute grammars. It turns out it's somewhat trivial to write a parser if you formalize the language with BNF.

##### Share on other sites
http://mitpress.mit.edu/sicp/full-text/book/book.html

This will teach you how to write DSL's, domain-specific languages, which are easier to write than a whole new programming language.

If that's not what you want, I suggest a language that has minimal syntax: something like Forth or Lisp would appropriate. Their syntaxes are so dead simple that you shouldn't waste too much time writing it.

##### Share on other sites
Look into GCC front ends. You'll have to write a parser and a converter to GCC's internal formats but it'll handle the rest.

##### Share on other sites
Thanks everyone!

I will look into those links and look into some other stuff. Maybe if I like this idea of doing this I will try to spend a while in making my own REAL programming language that even people who know C++ or VB or something along those lines could pick up and enjoy also. But, I will just have to write this SIMPLE language first. I will look into it!

##### Share on other sites
Writing a compiler for a programming language is a large and difficult project. To prepare for the big project, start with something smaller -- like something that solves math expressions.

First, with no variables:
    > (4*2^2-4*2*3)/(2^2-3^2)    1.6
    > z = (4x^2-4xy)/(x^2-y^2)    > x = 2    > y = 3    >     z = 1.6
Also, writing an interpreter for your language rather than a compiler would cut out a lot of work.

1. 1
Rutin
37
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
633346
• Total Posts
3011450
• ### Who's Online (See full list)

There are no registered users currently online

×