Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Introduction to Compilers and Language Design

    Introduction to Compilers and Language Design

    Douglas Thain · 2019

    Computer Science
    Open LibraryAmazon
    Stats for nerds
    4recommend
    5mentions
    5people
    2019–2026years
    80% recommend20% neutral

    Mentions per year

    20192020202120222023202420252026

    What Hacker News says

    1. terminalbraidOct 2024
      Structure and Interpretation of Computer Programs is a classic book to start and where many started.

      https://mitp-content-server.mit.edu/books/content/sectbyfn/b...

      Video lectures around the course as well

      https://ocw.mit.edu/courses/6-001-structure-and-interpretati...

      MIT keeps a lot of course materials available online. I like to go through syllabi for text ideas for example.

      https://people.csail.mit.edu/feser/pld-s23/

      https://ocw.mit.edu/courses/6-035-computer-language-engineer...

      Let's Build a Compiler

      https://compilers.iecc.com/crenshaw/

      Introduction to Compilers and Language Design

      https://www3.nd.edu/~dthain/compilerbook/

      Dragon book is where I started, but it's getting long in the tooth. Still a classic

      https://www.amazon.com/Compilers-Principles-Techniques-Tools...

      thread
    2. _f5ahJan 2024
      Here's my take[1] on it. In essence,

      # Learning Resources

      ## Theory

      Take a look at these two books:

      - Crafting Interpreters[2]. Compilers and interpreters have a lot in common and the book is exceptionally beginner-friendly. Basically, this is the perfect one to get started with.

      - Introduction to Compilers and Language Design[3]. Doesn’t assume any preexisting compilers knowledge, and teaches all the basics necessary to build a compiler using a hands-down approach. The examples are in C.

      Ignore the classics textbooks like the Dragon Book or "Modern Compiler Implementation" for the time. You can always come back to them later if you want to.

      ## Source code

      Explore the sources of

      - 8cc[4]. A compiler for the C programming language. It's intended to support all C11 language features while keeping the code as small and simple as possible.

      - chibicc[5]. The successor of 8cc from the same author.

      If you want a bit of background on these two compilers, check out the author's blog post "How I wrote a self-hosting C compiler in 40 days"[6]. Personally, I find it to be quite a fascinating read.

      # Input language

      Don’t try to come up with your own language just yet. Go with an existing educational language instead, and focus on learning about compilers. ChocoPy[7] is specifically designed for classroom use in compiler courses and by extension is great for a hobby compiler project.

      # Target language

      Many educational compilers emit MIPS assembly. Although it's possible to run it using an emulator, running a native executable produced by your own compiler feels much more rewarding. So I'd suggest your compiler emits x86-64 assembly.

      For educational purposes, I'd avoid targeting languages such as LLVM IR or C. Emitting assembly helps understand many important concepts better:

      - Managing a function's stack frame

      - Calling conventions

      - Finding the memory address of an identifier

      - Converting expressions into assembly

      - And so on and so forth.

      [1]: https://mykolam.net/posts/toy-compiler-of-scala-subset/2-loo...

      [2]: https://craftinginterpreters.com/contents.html

      [3]: https://www3.nd.edu/~dthain/compilerbook/

      [4]: https://github.com/rui314/8cc

      [5]: https://github.com/rui314/chibicc

      [6]: https://www.sigbus.info/how-i-wrote-a-self-hosting-c-compile...

      [7]: https://chocopy.org/

      thread
    3. bhrgunathaSep 2019
      University Of Washington CSEP501: Compiler Construction http://courses.cs.washington.edu/courses/csep501/

      Keith Schwartz Stanford Compiler course CS143 http://www.keithschwarz.com/cs143/

      Stanford's Engineering Compiler course on Lagunita https://lagunita.stanford.edu/courses/Engineering/Compilers/...

      Matt Might's courses are self educational blueprints http://matt.might.net/teaching/compilers/

      Book Introduction to Compilers and Language Design https://www3.nd.edu/~dthain/compilerbook/

      I'm not a fan of uncurated link dumps, however: Awesome compilers link aggregation on Github https://github.com/aalhour/awesome-compilers

      thread
    4. nedimmSep 2019
      Check this free book:

      Introduction to Compilers and Language Design by Douglas Thain

      http://compilerbook.org/

      thread
    5. dangJul 2026
      Related:

      Introduction to Compilers and Language Design (2021) - https://news.ycombinator.com/item?id=31388741 - May 2022 (68 comments)

      Introduction to Compilers and Language Design - https://news.ycombinator.com/item?id=19728749 - April 2019 (1 comment)

      thread

    Related

    Cover of Compilers, principles, techniques, and tools
    2007–2026

    Compilers, principles, techniques, and tools

    Alfred V. Aho
    195 recommend · 958
    Cover of The C Programming Language
    2007–2026

    The C Programming Language

    Brian W. Kernighan
    246 recommend · 604
    Cover of Compiler construction
    2008–2026

    Compiler construction

    Niklaus Wirth
    30 recommend · 81
    Cover of Engineering a compiler
    2007–2026

    Engineering a compiler

    Keith D. Cooper
    39 recommend · 91
    Cover of Advanced compiler design and implementation
    2008–2025

    Advanced compiler design and implementation

    Steven S. Muchnick
    13 recommend · 25
    Cover of Introduction to Compiler Design
    2018–2026

    Introduction to Compiler Design

    Torben Ægidius Mogensen
    1 recommend · 4
    Cover of Modern compiler implementation in ML
    2009–2024

    Modern compiler implementation in ML

    Andrew W. Appel
    24 recommend · 68
    Cover of Modern Compiler Design
    2009–2016

    Modern Compiler Design

    David Galles
    1 recommend · 2