By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,909 Members | 2,008 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,909 IT Pros & Developers. It's quick & easy.

Compilers/Interpreters books?

P: n/a
Are there any good books on Interpreter/Compiler construction, using
Python as a defining language out there? Something like Essentials of
Programming Languages 2e ?

I would appreciate some pointers

-- Hrvoje

Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hrvoje Blazevic wrote:
Are there any good books on Interpreter/Compiler construction, using
Python as a defining language out there? Something like Essentials of
Programming Languages 2e ?

I would appreciate some pointers

-- Hrvoje


After 48+ hours without answer, am I to assume that no such books exist,
or that the Python itself is not up to this task?

-- Hrvoje

Jul 18 '05 #2

P: n/a
Hrvoje Blazevic wrote:
Hrvoje Blazevic wrote:
Are there any good books on Interpreter/Compiler construction, using
Python as a defining language out there? Something like Essentials of
Programming Languages 2e ?

I would appreciate some pointers

-- Hrvoje


After 48+ hours without answer, am I to assume that no such books exist,
or that the Python itself is not up to this task?

-- Hrvoje

Neither, but I suspect you'll find more online resources than books
Jul 18 '05 #3

P: n/a
>Hrvoje Blazevic wrote:
Hrvoje Blazevic wrote:
Are there any good books on Interpreter/Compiler construction, using
Python as a defining language out there? Something like Essentials of
Programming Languages 2e ?

I would appreciate some pointers

-- Hrvoje


After 48+ hours without answer, am I to assume that no such books exist,
or that the Python itself is not up to this task?


I'm currently writing a compiler in Python, and have previously
written a code generator in it, so I can verify it is up to the
job.

A good reference for compiler writing is the "Dragon Book", more
formally _Compilers Principles, Techniques and Tools_ by Aho,
Sethi and Ullman. It doesn't give Python code examples, but you
don't need them; once you know the concepts, you can apply them in
any language.

--
"It's easier to find people online who openly support the KKK than
people who openly support the RIAA" -- comment on Wikipedia
(Email: zen19725 at zen dot co dot uk)
Jul 18 '05 #4

P: n/a
Hrvoje Blazevic <hr****@despammed.com> wrote:
Hrvoje Blazevic wrote:
Are there any good books on Interpreter/Compiler construction, using
Python as a defining language out there? Something like Essentials of
Programming Languages 2e ?

I would appreciate some pointers

After 48+ hours without answer, am I to assume that no such books exist,
or that the Python itself is not up to this task?


Hi Hrvoje,

I am curently writing a flowcharting tool (for C) in Python. It is up to the task. There are many books on compiler
construction, some online resources (see the resource on parsing from python.org, there is also a free online book
linked from there). I am not sure if there is a book on compiler construction that addresses the implementation in
Python though. I think it is more important for you to be familiar with the theory behind compilers and the
implementation should then be easier, regardless of the language. Others have already pointed out the basic literature.

Ognen
Jul 18 '05 #5

P: n/a
Ognen Duzlevski <ma****@ukato.freeshell.org> wrote:
: Hrvoje Blazevic <hr****@despammed.com> wrote:
:> Hrvoje Blazevic wrote:
:>> Are there any good books on Interpreter/Compiler construction, using
:>> Python as a defining language out there? Something like Essentials of
:>> Programming Languages 2e ?

: I am not sure if there is a book on compiler construction that addresses the implementation in
: Python though. I think it is more important for you to be familiar with the theory behind compilers and the
: implementation should then be easier, regardless of the language. Others have already pointed out the basic literature.

Agreed; a lot of the concepts of interpreters have little to do with
the defining language. Essentials of Programming Languages makes this
point clear, as the material can be easily translated to another
language like ML. (And at times, it feels like EOPL was originally
written with ML in mind... *grin*)
You may want to look at Structure and Interpretation of Computer
Programs:

http://mitpress.mit.edu/sicp/

I had written a translation of the Scheme interpreter into Python a
long long time ago; I think it still runs, though. *grin* Here's a
link:

http://hkn.eecs.berkeley.edu/~dyoo/python/pyscheme/
Jul 18 '05 #6

P: n/a
Ah! I completely forgot to mention: someone has written a C compiler
in Python:

http://people.cs.uchicago.edu/~varmaa/mini_c/

Atul documents the tools he had used to write the compiler, including
PLY (Python Lex-Yacc).

Hope this helps!
Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.