|Writing a C compiler in Java/Jython firstname.lastname@example.org (2001-06-07)|
|Re: Writing a C compiler in Java/Jython email@example.com (2001-06-08)|
|Re: Writing a C compiler in Java/Jython firstname.lastname@example.org (2001-06-10)|
|Re: Writing a C compiler in Java/Jython email@example.com (walter) (2001-06-10)|
|Re: Writing a C compiler in Java/Jython firstname.lastname@example.org (2001-06-14)|
|Date:||10 Jun 2001 22:48:53 -0400|
|Organization:||Excite@Home - The Leader in Broadband http://home.com/faster|
|Posted-Date:||10 Jun 2001 22:48:53 EDT|
In order to successfully compile C, the reality is that by the time
you add up all the lines of code in the headers, etc., you can wind up
with a million lines of code to compile. To do this in a reasonable
time frame means that the implementation language you choose needs to
have a well implemented, highly optimizing compiler.
Frankly, C and C++ will likely be your best choice, as the most
attention has been made by compiler vendors to generate quality code.
Python is fine for writing short programs, but for writing large
programs you need to have it compiled and you need it to be typesafe,
otherwise you spend too much time chasing typo bugs.
The implementation language doesn't need to be garbage collected. You
can just use a mark/release storage allocator, which is extremely fast
and works well compiling C.
For intermediate code that's suitable for optimization, using triples
or quads works well. They also work well for register allocation,
graph analysis, code motion, etc. Using binary trees can be clunky
because it's hard to do code motion with them. Generating stack
machine intermediate code makes optimization *really* hard <g>.
www.digitalmars.com Free C/C++ compilers
Arun Sharma wrote
>I wanted some opinions from people who might have attempted this in
>the past: Writing a C compiler in Java. Also, would using a scripting
>language like python (specifically the jython implementation of the
>language) have any advantages in writing optimization algorithms ?
Return to the
Search the comp.compilers archives again.