• Compiler Design in C (1990) the book

    From Mr. Man-wai Chang@3:633/10 to All on Mon Jul 20 22:50:55 2026

    Is it a standard textbook in computer science
    courses among US universities?

    Comments? ;)

    Compiler Design in C : Holub, Allen I.: Amazon.com.au: Books <https://www.amazon.com.au/Compiler-Design-Allen-I-Holub/dp/0131551515>

    Compiler design in C : Holub, Allen I : Free Download, Borrow, and
    Streaming : Internet Archive
    Publication date: 1990
    <https://archive.org/details/compilerdesignin0000holu>

    compilerDesignInC.pdf <https://holub.com/goodies/compiler/compilerDesignInC.pdf>



    --

    @~@ Simplicity is Beauty! Remain silent! Drink, Blink, Stretch!
    / v \ May the Force and farces be with you! Live long and prosper!!
    /( _ )\ https://sites.google.com/site/changmw/
    ^ ^ https://github.com/changmw/changmw
    The game is afoot... Meow...


    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Mon Jul 20 17:37:41 2026
    On 20/07/2026 16:50, Mr. Man-wai Chang wrote:

    Is it a standard textbook in computer science
    courses among US universities?

    Comments? ;)

    Please do not post advert links, or links to possibly copyright
    violating content. Everyone here is perfectly capable of using a web
    search. If a book is still in print, it is unlikely that you can
    legally download a copy for free. There are exceptions, and a link to
    an author's or publisher's website where they make this clear and
    provide a valid source of the book is not unreasonable.



    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Mon Jul 20 16:06:35 2026
    In article <113lfc5$19buk$2@dont-email.me>,
    David Brown <david.brown@hesbynett.no> wrote:
    On 20/07/2026 16:50, Mr. Man-wai Chang wrote:

    Is it a standard textbook in computer science
    courses among US universities?

    Comments? ;)

    Please do not post advert links, or links to possibly copyright
    violating content. Everyone here is perfectly capable of using a web >search. If a book is still in print, it is unlikely that you can
    legally download a copy for free. There are exceptions, and a link to
    an author's or publisher's website where they make this clear and
    provide a valid source of the book is not unreasonable.

    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C. It's mostly regurgitation of the Dragon book
    with C syntax.

    - Dan C.


    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Mr. Man-wai Chang@3:633/10 to All on Tue Jul 21 00:44:46 2026
    On 7/21/2026 12:06 AM, Dan Cross wrote:

    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C. It's mostly regurgitation of the Dragon book
    with C syntax.


    So I was very lucky that the project
    never quite take off. Thanks. :)

    --

    @~@ Simplicity is Beauty! Remain silent! Drink, Blink, Stretch!
    / v \ May the Force and farces be with you! Live long and prosper!!
    /( _ )\ https://sites.google.com/site/changmw/
    ^ ^ https://github.com/changmw/changmw
    The game is afoot... Meow...

    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Mon Jul 20 18:46:50 2026
    On 2026-07-20 18:06, Dan Cross wrote:

    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C. It's mostly regurgitation of the Dragon book
    with C syntax.

    Is this, quasi en passant, meant as a critique of the books of the
    authors of the "Dragon Book" as well?

    I'm asking because the authors (specifically Aho, Hopcroft, Sethi,
    Ullman) and their books had been authoritative during the 70's/80's
    in that area.

    Janis


    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From bart@3:633/10 to All on Mon Jul 20 19:30:19 2026
    On 20/07/2026 17:46, Janis Papanagnou wrote:
    On 2026-07-20 18:06, Dan Cross wrote:

    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C.ÿ It's mostly regurgitation of the Dragon book
    with C syntax.

    Is this, quasi en passant, meant as a critique of the books of the
    authors of the "Dragon Book" as well?

    I'm asking because the authors (specifically Aho, Hopcroft, Sethi,
    Ullman) and their books had been authoritative during the 70's/80's
    in that area.

    I wouldn't recommend the Dragon Book to anyone unless they are
    particularly interesting in the theory behind lexing and parsing. 1000
    pages and 500 pages of that seem to be spent on what is usually
    considered the simplest part of a compiler.

    There are newer and more practical works around.

    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Mr. Man-wai Chang@3:633/10 to All on Tue Jul 21 02:36:46 2026
    On 7/21/2026 12:06 AM, Dan Cross wrote:


    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C. It's mostly regurgitation of the Dragon book
    with C syntax.

    Compilers: Principles, Techniques, and Tools - Wikipedia <https://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools>

    Amazon.com : Compilers: Principles, Techniques, and Tools <https://www.amazon.com/s?k=Compilers%3A+Principles%2C+Techniques%2C+and+Tools>

    books/Compilers Principles Techniques and Tools (2nd Edition) .pdf at
    master ú qshadun/books ú GitHub <https://github.com/qshadun/books/blob/master/Compilers%20Principles%20Techniques%20and%20Tools%20(2nd%20Edition)%20.pdf>

    --

    @~@ Simplicity is Beauty! Remain silent! Drink, Blink, Stretch!
    / v \ May the Force and farces be with you! Live long and prosper!!
    /( _ )\ https://sites.google.com/site/changmw/
    ^ ^ https://github.com/changmw/changmw
    The game is afoot... Meow...

    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Mr. Man-wai Chang@3:633/10 to All on Tue Jul 21 02:37:48 2026

    Does it make sense to write your own
    C compiler? For what purposes?

    On 7/21/2026 2:30 AM, bart wrote:
    On 20/07/2026 17:46, Janis Papanagnou wrote:
    On 2026-07-20 18:06, Dan Cross wrote:

    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C.ÿ It's mostly regurgitation of the Dragon book
    with C syntax.

    Is this, quasi en passant, meant as a critique of the books of the
    authors of the "Dragon Book" as well?

    I'm asking because the authors (specifically Aho, Hopcroft, Sethi,
    Ullman) and their books had been authoritative during the 70's/80's
    in that area.

    I wouldn't recommend the Dragon Book to anyone unless they are
    particularly interesting in the theory behind lexing and parsing. 1000
    pages and 500 pages of that seem to be spent on what is usually
    considered the simplest part of a compiler.

    There are newer and more practical works around.


    --

    @~@ Simplicity is Beauty! Remain silent! Drink, Blink, Stretch!
    / v \ May the Force and farces be with you! Live long and prosper!!
    /( _ )\ https://sites.google.com/site/changmw/
    ^ ^ https://github.com/changmw/changmw
    The game is afoot... Meow...

    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Jul 20 22:41:51 2026
    On Mon, 20 Jul 2026 19:30:19 +0100, bart wrote:

    I wouldn't recommend the Dragon Book to anyone unless they are
    particularly interesting in the theory behind lexing and parsing.
    1000 pages and 500 pages of that seem to be spent on what is usually considered the simplest part of a compiler.

    There continue to be quite a few interesting developments in those
    lines. For example, these new PEG things with their ?packrat? parsers.

    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Tue Jul 21 12:15:14 2026
    In article <113ljdq$qnef$1@dont-email.me>,
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    On 2026-07-20 18:06, Dan Cross wrote:

    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C. It's mostly regurgitation of the Dragon book
    with C syntax.

    Is this, quasi en passant, meant as a critique of the books of the
    authors of the "Dragon Book" as well?

    No, it's specifically about Holub's treatment. The Dragon book
    is much better, in my opinion, though showing its age.

    I'm asking because the authors (specifically Aho, Hopcroft, Sethi,
    Ullman) and their books had been authoritative during the 70's/80's
    in that area.

    For parsing and so on, I would argue they still mostly are. If
    you want to understand how regular expressions actually work,
    and you've outgrown things like Russ Cox's pages, you can do a
    lot worse than to read the dragon book.

    However, my friends who work on compilers tell me that the main
    areas of interest have moved on, and the Dragon book does not
    give a lot of treatment to code generation, modern optimization
    techniques, abstractions that allow parts of a compiler to be
    reused (e.g., in tooling) and so on.

    I'm not sure there is a great book for these; John Levine would
    know much better than I, but some friends who work on compilers
    say that "Engineering a Compiler" by Cooper and Torczon is
    better in those areas. I still have a soft spot for Appel's,
    "Modern Compiler Implementation in ML"; itself a bit dated now,
    I'm afraid, but in some senses a better treatment since the
    implementation language allows a higher level of abstraction, so
    less minutia to track while trying to concentrate on the
    material.

    - Dan C.

    (Disclaimer: I took compilers from Aho; one of the few Computer
    Science courses I took. And )

    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Tue Jul 21 14:42:13 2026
    On 2026-07-21 14:15, Dan Cross wrote:
    In article <113ljdq$qnef$1@dont-email.me>,
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    On 2026-07-20 18:06, Dan Cross wrote:

    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C. It's mostly regurgitation of the Dragon book
    with C syntax.

    Is this, quasi en passant, meant as a critique of the books of the
    authors of the "Dragon Book" as well?

    No, it's specifically about Holub's treatment.

    Ah, okay.

    The Dragon book
    is much better, in my opinion, though showing its age.

    I just know a couple of their yet earlier books.[*]


    I'm asking because the authors (specifically Aho, Hopcroft, Sethi,
    Ullman) and their books had been authoritative during the 70's/80's
    in that area.

    For parsing and so on, I would argue they still mostly are. If
    you want to understand how regular expressions actually work,
    and you've outgrown things like Russ Cox's pages, you can do a
    lot worse than to read the dragon book.

    (Actually I'm just peripherally interested in the details of
    compiler constructions; in my professional life these topics
    didn't matter at all.)


    However, my friends who work on compilers tell me that the main
    areas of interest have moved on, and the Dragon book does not
    give a lot of treatment to code generation, modern optimization
    techniques, abstractions that allow parts of a compiler to be
    reused (e.g., in tooling) and so on.

    Yeah. It would have been surprising if the world didn't evolve.


    I'm not sure there is a great book for these; John Levine would
    know much better than I, but some friends who work on compilers
    say that "Engineering a Compiler" by Cooper and Torczon is
    better in those areas. I still have a soft spot for Appel's,
    "Modern Compiler Implementation in ML"; itself a bit dated now,
    I'm afraid, but in some senses a better treatment since the
    implementation language allows a higher level of abstraction, so
    less minutia to track while trying to concentrate on the
    material.

    Thanks for your insights.


    - Dan C.

    (Disclaimer: I took compilers from Aho; one of the few Computer
    Science courses I took. And )

    The person who taught us about compilers was horrible! So I was
    really glad to have access to the books of the authors mentioned
    above.

    Janis

    [*] Back then they told us that there was a group of authors who
    just copied parts of every book to publish new ones. (Not that
    this would be bad per se.) But I think it was these authors.
    I wouldn't be surprised if they extended on their earlier work
    to create the Dragon book (but I'm just speculating).


    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Tue Jul 21 15:29:12 2026
    In article <113npf5$qnef$2@dont-email.me>,
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    [snip]
    (Disclaimer: I took compilers from Aho; one of the few Computer
    Science courses I took. And )
    [snip]

    [*] Back then they told us that there was a group of authors who
    just copied parts of every book to publish new ones. (Not that
    this would be bad per se.) But I think it was these authors.
    I wouldn't be surprised if they extended on their earlier work
    to create the Dragon book (but I'm just speculating).

    That's a bit of a simplification, but largely true: Aho, Ullman,
    et al have written several books on data structures, algorithms,
    compilers, and so on, all of which cover overlapping material.
    Of course, much of that is because there's inherently a lot of
    overlap between those topics; the difference is in
    specialization, and in that sense, they are rather different.

    To bring it back to C, consider that the Dragon book was written
    on Unix, using Unix tools, all of which were written in C, and
    Aho also contributed much of the early Unix software in C, such
    as `egrep`, which extended `grep` by compiling regexp's to a DFA
    (instead of Thompson's NFA construction) and extended the
    earlier tool's regular expression syntax. A few years later,
    Andrew Hume wrote a lovely paper about speeding up `egrep`.

    - Dan C.


    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From BGB@3:633/10 to All on Wed Jul 22 15:29:57 2026
    On 7/20/2026 1:37 PM, Mr. Man-wai Chang wrote:

    Does it make sense to write your own
    C compiler? For what purposes?


    Targeting a target for which there are no other C compilers...
    Wanting a C compiler that isn't a behemoth.
    ...


    But, yeah, if your goal is to just write code on a normal PC, no reason
    to use your own.

    Just join the crowd, and use one of-typically:
    MSVC / Visual Studio: Native Windows
    GCC or Clang: Linux or similar.



    Dunno about modern MacOS land, apparently there people use Apple's tools
    and (unlike pretty much everyone else at this point) they charge
    subscription fees to have access to a compiler.

    IIRC, they keep other compilers out of their ecosystem partly by also requiring a digital signature on binaries so that they can be run (so
    like a FOSS compiler would not generate binaries that carry Apple's
    digital signatures; then with like a "developer signature" for binaries
    that could be run on the developer's machine, and also app-signing for distribution to other machines, ...).

    But, yeah, ...


    Not personally sure why anyone would choose this.
    Well, vs MS which is almost actively trying to drive people off their
    platform over to Linux or similar.

    Where, ideally, the main things they would need to do to keep people
    around being: keep old stuff working; and not screwing up the OS... Now
    they keep breaking stuff and screwing stuff up.

    Inertia will only last so long, and if they drive everyone to just
    running Linux or similar, this is presumably not an ideal situation for
    them.



    As for parsing:
    I usually just go with recursive descent.
    There are seemingly few good reasons to not just go with a recursive
    descent parser.

    Typically the major long-standing pain areas IME tend to be with code-generation stuff (unless you can tolerate "dead slow" then it is a
    lot easier).

    Would personally rather see more smaller and more specialized compilers
    (with at least semi-consistent interfaces) than the "forge one compiler
    to rule them all" approach that both GCC and Clang seem to be trying to
    take.


    Though, this does still leave C++ support as a problem area, as many
    codebases do actually use C++, and it is much harder to support than
    plain C (or other superficially similar languages, like C#).

    And, sadly, Cfront is little more than a relic...


    But, then again, the world of C++ has also partly become one of bloated
    build times and bloated binaries. Despite the limitations of what
    software one can compile, it maybe isn't too huge of a loss...

    Well, partly it is also a consequence of C++ land attracting a lot of developers with no regards for efficiency, often thinking that "good"
    coding practice is to chase after whatever are the newest language
    features (or, like, that the purpose of newer versions of the language
    are just to endlessly pile on new features...).

    To some extent, C has had a higher resistance to this sort of thing.



    On 7/21/2026 2:30 AM, bart wrote:
    On 20/07/2026 17:46, Janis Papanagnou wrote:
    On 2026-07-20 18:06, Dan Cross wrote:

    Holub publishes that book on his web site, but he's an idiot,
    and I would not use that as any of a reference for writing a
    compiler, a reference for a C, or a reference for writing a C
    compiler in C.ÿ It's mostly regurgitation of the Dragon book
    with C syntax.

    Is this, quasi en passant, meant as a critique of the books of the
    authors of the "Dragon Book" as well?

    I'm asking because the authors (specifically Aho, Hopcroft, Sethi,
    Ullman) and their books had been authoritative during the 70's/80's
    in that area.

    I wouldn't recommend the Dragon Book to anyone unless they are
    particularly interesting in the theory behind lexing and parsing. 1000
    pages and 500 pages of that seem to be spent on what is usually
    considered the simplest part of a compiler.

    There are newer and more practical works around.




    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Wed Jul 22 22:23:21 2026
    BGB <cr88192@gmail.com> writes:

    Dunno about modern MacOS land, apparently there people use Apple's tools
    and (unlike pretty much everyone else at this point) they charge >subscription fees to have access to a compiler.

    The Apple developer tool suite is free.

    https://en.wikipedia.org/wiki/Xcode


    IIRC, they keep other compilers out of their ecosystem partly by also

    GCC is available for MacOS. Install homebrew, then 'brew install gcc'.

    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From BGB@3:633/10 to All on Wed Jul 22 18:07:59 2026
    On 7/22/2026 5:23 PM, Scott Lurndal wrote:
    BGB <cr88192@gmail.com> writes:

    Dunno about modern MacOS land, apparently there people use Apple's tools
    and (unlike pretty much everyone else at this point) they charge
    subscription fees to have access to a compiler.

    The Apple developer tool suite is free.

    https://en.wikipedia.org/wiki/Xcode


    Other stuff I had read before said Xcode was only available via paying a licensing fee, with the OS otherwise locked down...

    Unlike, say, Windows or Linux...



    IIRC, they keep other compilers out of their ecosystem partly by also

    GCC is available for MacOS. Install homebrew, then 'brew install gcc'.

    OK.

    I don't actually have a Mac (nor the willingness to dump that much money
    on a computer), only stuff I had heard second-hand.



    My main PC is built using a CPU that is nearly a decade old at this
    point... Has 112GB of RAM, but fairly slow. Partly because the RAM kit
    was sold claiming speeds well in excess of what the RAM can actually run
    at reliably (and 112GB because it turns out the MOBO goes wonky and
    boot-loops before claiming 4GB, if you try putting in 128GB...).


    A lot of the other computers I had bought recently had mostly been
    things like refurbished Dell OptiPlex computers and similar (and they
    were, for a brief moment, fairly cheap...).

    So, not likely really in the market Macs are sold to...



    --- PyGate Linux v1.5.18
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)