Re: Writing a compiler

=?ISO-8859-1?Q?J=FCrgen_Kahrs?= <Juergen.Kahrs@vr-web.de>
Thu, 23 Oct 2008 20:53:03 +0200

          From comp.compilers

Related articles
Writing a compiler andresjriofrio@gmail.com (andresj) (2008-10-20)
Re: Writing a compiler DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-10-23)
Re: Writing a compiler ademakov@gmail.com (Aleksey Demakov) (2008-10-23)
Re: Writing a compiler torbenm@pc-003.diku.dk (2008-10-23)
Re: Writing a compiler Juergen.Kahrs@vr-web.de (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2008-10-23)
Re: Writing a compiler m.collado@lml.ls.fi.upm.es (Manuel Collado) (2008-10-24)
Re: Writing a compiler Ibeam2000@gmail.com (Nick) (2008-10-26)
Re: Writing a compiler rajaram.officemails@gmail.com (RR) (2008-10-26)
Re: Writing a compiler andresjriofrio@gmail.com (andresj) (2008-10-29)
Re: Writing a compiler kamalpr@hp.com (kamal) (2008-10-29)
Re: Writing a compiler tony@my.net (Tony) (2008-10-31)
[10 later articles]
| List of all articles for this month |

From: =?ISO-8859-1?Q?J=FCrgen_Kahrs?= <Juergen.Kahrs@vr-web.de>
Newsgroups: comp.compilers
Date: Thu, 23 Oct 2008 20:53:03 +0200
Organization: Compilers Central
References: 08-10-037
Keywords: design
Posted-Date: 23 Oct 2008 18:06:01 EDT

andresj wrote:


> Hello, I am designing a programming language that will run natively.
> That is to say, it will run like C, without a need of an interpreter
> nor a standard library (well, there will be, but I want to be able to
> write an operating system, too.)
>
> The language parsing (converting a=b into <assignment><variable
> name="a"/><variable name="b"/></assignment>---which is not necessarily
> correct, anyways) I will skip for now; I will write directly in XML
> and use a XML parser to get a tree of my program.


This sounds strange. You say you are designing a language, but you
will skip syntax definitiona and language parsing for the moment ?


> * I need help in finding an appropiate way of structuring my XML. Any
> ideas/links?


There have been several attempts to use XML data as an intermediate
representation of source code. Use Google with "xml intermediate
language parser" and you will find sources like these:


    http://www.idealliance.org/papers/xml2001/papers/html/03-05-04.html
    http://portal.acm.org/citation.cfm?doid=1026487.1008001
    http://www.sable.mcgill.ca/jil/docs/jil10.pdf


> The next part is where I need more help in: how to convert this tree
> into assembly language.
>
> * Is there any documentation on this part of writing a compiler?


My impression is that all attempts at using XML data as intermediate
representation were mostly academic. If you find anything useful on
the Internet that is more than a toy, please post it here. Writing a
code generator for such an intermediate representation should be an
interesting lesson in XML processing.


> * Any other articles/ideas on writing compilers or designing
> programming languages are welcome. :)


Compiler writing and language design are well established disciplines
for some decades now.


    http://en.wikipedia.org/wiki/Compiler#Compiler_design
    http://en.wikipedia.org/wiki/Programming_language#History


There are many excellent text books at Amazon.com.



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.