Re: Good practical language and OS agnostic text?

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Wed, 18 Apr 2012 20:29:18 +0000 (UTC)

          From comp.compilers

Related articles
Good practical language and OS agnostic text? compilers@is-not-my.name (2012-04-17)
Re: Good practical language and OS agnostic text? redbrain@gcc.gnu.org (Philip Herron) (2012-04-18)
Re: Good practical language and OS agnostic text? cr88192@hotmail.com (BGB) (2012-04-18)
Re: Good practical language and OS agnostic text? alain@dpt-info.u-strasbg.fr (Alain Ketterlin) (2012-04-18)
Re: Good practical language and OS agnostic text? derek@knosof.co.uk (Derek M. Jones) (2012-04-18)
Re: Good practical language and OS agnostic text? compilers@is-not-my.name (2012-04-18)
Re: Good practical language and OS agnostic text? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2012-04-18)
Re: Good practical language and OS agnostic text? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2012-04-18)
Re: Good practical language and OS agnostic text? usenet@rwaltman.com (Roberto Waltman) (2012-04-18)
Re: Good practical language and OS agnostic text? usenet@bitblocks.com (Bakul Shah) (2012-04-18)
Re: Good practical language and OS agnostic text? cr88192@hotmail.com (BGB) (2012-04-19)
Re: Good practical language and OS agnostic text? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2012-04-19)
Re: Good practical language and OS agnostic text? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2012-04-19)
[37 later articles]
| List of all articles for this month |
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Wed, 18 Apr 2012 20:29:18 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 12-04-019
Keywords: books
Posted-Date: 18 Apr 2012 16:48:16 EDT

compilers@is-not-my.name wrote:


> Guys, I'm having a bear of a time finding a good practical language
> and OS agnostic text on writing a compiler. I'm weak in math and not
> interested in the theoretical details. I want to understand the hows
> and whys of compiler writing. Everything I've found is either
> gobbledygook equations or "let's use C/C++/Java on UNIX" or things
> that are so trivial and focused they don't explain general cases and
> can't be extended to anything useful.


My favorite understandable compiler book is the LCC book:


http://www.amazon.com/Retargetable-Compiler-Design-Implementation/dp/0805316701


You might be right that all books are one (or more) of those three,
but then you should choose from among those.


I don't know of many trivial compiler books, but, yes there are a
number that are more theoretical than I like.


C is a nice, simple language in which to describe compiler design, and
also not so bad a language in which to write compilers. Given that,
it isn't a bad start toward writing one for another language, and/or
written in another language, unless you don't know C.


Both C and Java are fairly simple, and reasonably similar, with much
of the complication moved to the library. That means a complete
compiler can be described relatively simply, covering all the
important ideas. Once you learn those, you will be ready to go on to
other languages (both for compiling and writing the compiler in).


You don't say what language you are interested in. There are some
complications to writing Fortran compilers not covered in most books.
Both Fortran and PL/I don't have reserved words, which requires
special handling by the compiler. Fixed form Fortran ignores blanks,
which requires a special lexical analysis technique, but most of
compiler theory is in parsing, which is reasonably language
independent.


It seems to me natural that a pseudo-code description will be more
theoretical, and harder to understand, than one using a well-known
high-level language.


-- glen


Post a followup to this message

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