I swear I've seen this cover before... is this a new release or an updated edition of an older book?
Writing a C Compiler: Build a Real Programming Language from Scratch
11–20 of 159 posts
Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#12I swear I've seen this cover before... is this a new release or an updated edition of an older book?
Book is not yet published but in early access since a couple of years Was featured here a couple of times. Unfortunately the timing of the release is quite unfortunate with regards to the summer holidays. Will take a look at it next year
According to the top post's link, it was released in July 2024.
Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#13I swear I've seen this cover before... is this a new release or an updated edition of an older book?
Book is not yet published but in early access since a couple of years Was featured here a couple of times. Unfortunately the timing of the release is quite unfortunate with regards to the summer holidays. Will take a look at it next year
Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#14Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#15[0] actually from the readme in the github repo[1] it seems to be a C subset, not all of C
Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#16So what's different about writing a compiler in 2024 than say 10, 20, or 30 years ago? When I started writing compilers in the 80's and 90's lex/flex and yacc/bison were popular. ANTLR came out but I never had a chance to use it. Everything after lexing and parsing was always hand rolled.
Today most languages are front-ends for LLVM IR, but LLVM is very slow and takes a long time to optimize. Many new languages target x86/arm directly with their own weakly optimized backends, and output an LLVM IR for "release builds".
Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#17https://onlinebooks.library.upenn.edu/webbin/book/lookupid?k...
Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#18So what's different about writing a compiler in 2024 than say 10, 20, or 30 years ago? When I started writing compilers in the 80's and 90's lex/flex and yacc/bison were popular. ANTLR came out but I never had a chance to use it. Everything after lexing and parsing was always hand rolled.
Parser-generators were always academic projects that had little relevance to making real-world programming languages -- where parsing is very easy to write, and necessarily benefits from doing it (ie., you can get better error handling/etc.). Today most languages are front-ends for LLVM IR, but LLVM is very slow and takes a long time to optimize. Many new languages target x86/arm directly with their own weakly optimi…
Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#19So what's different about writing a compiler in 2024 than say 10, 20, or 30 years ago? When I started writing compilers in the 80's and 90's lex/flex and yacc/bison were popular. ANTLR came out but I never had a chance to use it. Everything after lexing and parsing was always hand rolled.
Parser-generators were always academic projects that had little relevance to making real-world programming languages -- where parsing is very easy to write, and necessarily benefits from doing it (ie., you can get better error handling/etc.). Today most languages are front-ends for LLVM IR, but LLVM is very slow and takes a long time to optimize. Many new languages target x86/arm directly with their own weakly optimi…
Now-a-days, the difference between "big compiler optimized" and "little compiler not optimized" can be quite dramatic; but, is probably no more than 4x — certainly within range of the distinction between "systems programming language" and "high tuned JITted scripting language". I think most people are perfectly fine with the performance of highly-tuned scripting languages. The result is that all of the overhead of "big compiler" is just ... immaterial; overhead. This is especially true for the case of extremely well-tuned code, where the algorithm and — last resort — assembly, will easily beat out the best optimizer by at least an order-of-magnitude, or more.
Re: Writing a C Compiler: Build a Real Programming Language from Scratch
#20Weird that this is about building a C compiler[0] in OCaml . I expected the implementation language to also be C both for consistency but also because i'm willing to bet that there are more people who can read C than OCaml. [0] actually from the readme in the github repo[1] it seems to be a C subset, not all of C [1] https://github.com/nlsandler/nqcc2