"Visually Seen #" <al*****************@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hey everybody,
I want to create my own programming language, using C#. Could anyone
give me some tips, advice on this goal?
Let's say that in my programming language uses the keyword, integer
instead of int.
Only one piece of advice worth taking: Start small.
I would recommend finding a compiler for a langauge that you like and
modifying it to add some of the features you want in your new language, one
at a time. Mono's C# compiler is a good option for modifying C#, although I
find it a little messy structurally attimes. Working with an existing
compiler will give you a good hobbiest base in compiler theory and will get
you working much faster than taking a course will. Play with a few, get a
feel for what real people do.
Once you've done that, try building a langauge on your own that does the
simple things: assignments, basic arithmetic, comparisons, and slowly add
onto that foundation classes, methods, and whatever other advanced features
you want.
Through trial and error combined with the existing compilers you played
with, you will likely start to find things that work and start to understand
how your grand idea would work inside of a compiler and you can start to
build it. You will likely rewrite more than once, but as you learn what you
are doing that will hurt less and less as you go on.
The most valuable tool you will find is a parser generator, I recommend
starting with GOLD Parser Builder[1] once you start building grammars from
scratch, as it has some very nice tools you can use to visually debug the
grammar and figure your ideas out, but I find it a little over complicated
in general practice.
The mono compiler uses a Yacc port called Jay, and one I always liked was
Coco/R[2]. However if you just do a search for something like "C# parser
generator" you will find loads of options.
Good luck on your langauge.