Re: Making your own programming language

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Visually Seen #" <albert.xtheunknown0@xxxxxxxxx> wrote in message
news:1123636375.346879.199480@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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.



.



Relevant Pages

  • Re: Is this a compiler error?
    ... we have no guarantee that the code is even valid Fortran at all. ... Those words don't even appear in the Fortran standard. ... |> meant in the context of a programming language. ... |> impractical for a compiler to do. ...
    (comp.lang.fortran)
  • Re: Dealing with ad hominem attacks in comp.programming
    ... Surely you use variables with impicit dimensions? ... It also determines whether you can use the programming language as is or need fiddles. ... If you have to live with existing ones, either use their notation or do a preprocessing stage to allow the use of your own. ... values in the machine and relying on the compiler to do units analysis. ...
    (comp.programming)
  • Re: Is this a compiler error?
    ... we have no guarantee that the code is even valid Fortran at all. ... Those words don't even appear in the Fortran standard. ... meant in the context of a programming language. ... impractical for a compiler to do. ...
    (comp.lang.fortran)
  • Re: How do we manage large code sets in PHP?
    ... A professional large project programming language? ... You start to use compiled PHP ... Source PHP compiler. ...
    (comp.lang.php)
  • Seed7 Release 2010-06-20
    ... In the Seed7 programming language new statements and operators ... - The compiler was improved to support the option -te ... "big_rtl.c" were improved to avoid memory leaks in out of memory ... Seed7 - The extensible programming language: ...
    (comp.compilers)