C compiler written in Python

Cameron Laird claird at lairds.com
Thu Jun 3 10:12:11 EDT 2004


In article <mailman.533.1086240823.6949.python-list at python.org>,
Miki Tebeka <miki.tebeka at zoran.com> wrote:
>Hello Tim,
>
>> Doing an independent study with Dave Beazley this quarter, Atul Varma
>> has written a C compiler on his own in Python.  It generates annotated
>> x86 assembly code from arbitrary C files.
>Look out gcc, here we come ;-)
			.
			.
			.
This is *extremely* exciting--at least to me.  I'll try
to express why I see this as so important.

First, many readers probably don't have a full appreci-
ation of gcc's defects.  gcc is a wonderful project,
and its contributors all deserve our appreciation.  It
does *not* meet all needs, though:  its implementation
is difficult, portable only with difficulty, bulky, and
still a poor fit on several architectures.  A compiler
that invites experimentation, cross-compiling, and is
easily installed ... well, my head's spinning with ideas.

'Few immediate tangents:  everyone read Miki's piece on
Python-coded *assemblers* <URL:
http://www.unixreview.com/documents/s=9133/ur0404e/ >?
We all know that Python plays nicely with C in that it's
easy to make successful partnerships between Python- and
C-coded modules; such projects as Pyrex, Critcl, and
Inline:: show the potential for managing these at the 
project level with the higher-level language's power.
Think what it means, now, to deepen that integration, so
that the compiler (or assembler!) itself becomes
scriptable!
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net



More information about the Python-list mailing list