News for hackers. Stuff that matters.
Re:Compiling to Assembly from Scratch: the book, released by leapis on Sunday September 27, 2020 @04:44PM (#24610007)
Fantastic book, and one that's much needed in the landscape of compiler learning today. Many modern compiler books (such as Torczon & Cooper's "Engineering a Compiler") take the approach of showing low-level, linear IRs rather than actual assembly- a perfectly valid approach, to be sure, but one that leaves something to be desired. While compilers are interesting, I don't learn about them because I think I'll ever write a real one- I learn about them because I want to understand more about a tool at the core of my workflow. This book won't be the be-all end-all of understanding compilation to asm, especially on x86 machines, but it taught me much that my university compilers courses and the Dragon book could not. I was a little hesitant when I saw the book was written with Typescript in mind, but after reading an earlier draft I tend to agree with the author's assessment that it works well with the material, and isn't too hard to pick up with some limited javascript experience.
Re:Compiling to Assembly from Scratch: the book, released by halst on Sunday September 27, 2020 @05:15PM (#24610179)
Yeah, and picking a language was the hardest decision for the book. I wrote the compiler prototype for it in OCaml, but using it for the book would have narrowed its audience unnecessarily. In the end, I'm very happy with picking TypeScript: it allowed to discuss the matters of static and dynamic typing within the same language. Using Python with mypy would be another option, but then, since I wanted the source language to be a subset of the implementation language, I would have to explain parsing whitespace-sensitive code, which is tricky.
Re:Compiling to Assembly from Scratch: the book, released by halst on Sunday September 27, 2020 @05:00PM (#24610095)
Thank you for such a favorable comparison with the classics!
Re:Compiling to Assembly from Scratch: the book, released by beefok on Sunday September 27, 2020 @04:38PM (#24609966)
Woo! Congratulations! I have really been enjoying integrating/applying what I have been learning in this book. I don't have anything to show, but it's been great to play with. Thank you for your tireless efforts, Vlad! :)
Re:Compiling to Assembly from Scratch: the book, released by halst on Sunday September 27, 2020 @04:50PM (#24610043)
Thanks for your early support and going through the draft! I'm glad you've been enjoying it!
Re:Compiling to Assembly from Scratch: the book, released by mtnrbq65 on Sunday September 27, 2020 @05:25PM (#24610252)
Great book, and very approachable compared to my university texts, but hey that was 30+ years ago ;)
Re:Compiling to Assembly from Scratch: the book, released by lpil on Monday September 28, 2020 @06:38AM (#24615186)
I've just picked this up and Street reading the first chapter I'm very excited to read the rest! It's unusually easy to follow for a book on this subject.
Re:Compiling to Assembly from Scratch: the book, released by mukadr on Monday September 28, 2020 @11:06AM (#24617415)
Congratulations Vladimir! It is a great introduction to compilation. I like the fact that it teaches parsing combinators instead of the traditional lex/yacc tools. It is a great book to be used during a college course.
Re:Compiling to Assembly from Scratch: the book, released by DylanSp on Sunday September 27, 2020 @05:25PM (#24610250)
Congrats on the release! I'm working on a language myself, planning on having an ARM backend, and this book is going to be very helpful implementing that.
Re:Compiling to Assembly from Scratch: the book, released by pjmlp on Monday September 28, 2020 @01:18AM (#24613218)
Great idea as book, instead to following the traditional ones with bytecodes or plain old C.

A very nice introduction into modern alternatives specially for younger generations.