Readit News logoReadit News
trealira · a year ago
The post is from 2022.

However, looking at the table of contents [0], she seems to spend a lot of the book on types and pointers. That's cool, since the compiler books that I've seen don't cover languages with pointers and pointer arithmetic (and the analyses that come with that), or representations of types.

[0]: https://nostarch.com/writing-c-compiler

cellularmitosis · a year ago
Just so others in this thread are clear: this post is from 2022, but her book just started shipping last week (mine should be arriving today)
cyberpunk · a year ago
Bah, still says August 20 in Europe. Oh well, something to do over the Christmas holidays ;)

Deleted Comment

Deleted Comment

jimsimmons · a year ago
Advertising it as Writing a C Compiler is misleading. This is no where near C's speed. It's just an implementation of a C like language. And honestly there are better books or tutorials for something like that.

C's selling point is performance and portability and this book covers neither

MaxBarraclough · a year ago
> This is no where near C's speed. It's just an implementation of a C like language.

I don't understand this criticism. It seems reasonable for the end-result compiler to support only a 'significant subset of C', rather than total compliance with the standard. It also seems reasonable for the performance of its generated code to be nowhere near that of the major optimising C compilers.

How could it possibly be otherwise? A serious modern C compiler is the result of millions of dollars of specialised software engineering.

> C's selling point is performance and portability and this book covers neither

I've not read the book, but it apparently does cover optimisation.

Raminj95 · a year ago
Please can you suggest those better resources as this is something I’m trying to learn
sneed_chucker · a year ago
Consider taking a look at chibicc and simply working forward through the commits:

https://github.com/rui314/chibicc

> Each commit of this project corresponds to a section of the book. For this purpose, not only the final state of the project but each commit was carefully written with readability in mind. Readers should be able to learn how a C language feature can be implemented just by reading one or a few commits of this project.