The best part of the blind AI hatred is you can call literally anything AI slop without presenting evidence and the anti-slop loyalists will hate it without any evidence.
I do value both correct high quality AI usage and non-AI works, would be nice if we could have a bar for the AI stuff that makes sense instead of dismissing peoples work blindly.
I guarantee half the folk commenting āai slopā on peopleās projects are folk who never read peopleās code even before AI. Now they get to dismiss it without providing any specifics and feel superior.
Took Dr. Thain's compilers class in college! It was the best. He's an excellent instructor, and the course project made me build a working C-style compiler step by step. I think the sample project here is pretty much the project we did; highly recommend following through the entire thing!
Sometimes I see people who design languages and build compilers, and I find them truly amazing. I once tried making a language myself because I was curious, but it was so difficult that I just settled for a simple C backend. The people contributing to LLVM probably know everything down to assembly generation.
they're truly incredible.
>The people contributing to LLVM probably know everything down to assembly generation. they're truly incredible.
Not really. I was webdev who then switched into compilers job with LLVM being foundation
LLVM itself is huge, it is not trivial to be familiar with every it's areas/mechanisms, but writing not-complex passes, bug fixing, regression fixing does not require some fancy knowledge
Assembly generation is actually pretty simple, it's optimizing everything that's difficult. Writing an assembler is a great way to get acquainted with compiler construction, because you don't need to think about optimization and types and the other features that make high level languages complicated aren't needed.
I actually started my first compiler my allowing (only) inline assembler first, and then starting to wrap higher level constructs around it.
It adds a little bit of complexity (you need to be very clear on how you handle registers) but it worked surprisingly well, and it makes it easy to built up the complexity step by step.
It also meant I could bootstrap the compiler itself with just an assembler.
Sadly I lost the source decades ago.
(Making assembler an integral construct of a higher-level language is also not a unique approach - there's Randall Hyde's High-Level Assembly[1] and others.)
Honestly whipping up a lexer/parser and a REPL is one of my favorite ways to learn a new language. You can cover a lot of ground in a "real" language by just doing the frontend implementation of your own made-up language grammar and a little eval loop and its great for learning/teaching because you don't get bogged down in trying to solve some actual problem.
Which is to say: no shame in just settling for that simple C backend!
Compilers teaching materials often skip practical concerns. This resource covers the fundamentals well ā would be helpful to see more on optimization passes and code generation trade-offs.
https://news.ycombinator.com/threads?id=swordlucky666 - Sort of embarrassing that anyone vouched for this comment. Reading their history, they copy/paste the same comment or use an autogenerator (probably not an LLM, that'd produce better results) to generate comments like this one.
> The discussion on Spanish traders set the standa raises interesting points. In practical applications, the key challenge is balancing performance with maintainability. Would be valuable to see more concrete examples of trade-offs. [emphasis added]
They glob out part of the submission title (and took too much and cut off in the middle of a word) generating a delightful nonsense descriptor (the italicized bit). The title being:
> Spanish traders set the standard for GnuCash database design
> Sort of embarrassing that anyone vouched for this comment
I'm the one who vouched it. I don't check commenters' history before doing it. Maybe I should. My LLM-detector is apparently broken (especially on short posts). At face value I saw nothing wrong with it, so I vouched it.
Love such topics and articles in midst of AI topics/noise.
The best part of the blind AI hatred is you can call literally anything AI slop without presenting evidence and the anti-slop loyalists will hate it without any evidence.
I do value both correct high quality AI usage and non-AI works, would be nice if we could have a bar for the AI stuff that makes sense instead of dismissing peoples work blindly.
I guarantee half the folk commenting āai slopā on peopleās projects are folk who never read peopleās code even before AI. Now they get to dismiss it without providing any specifics and feel superior.
Took Dr. Thain's compilers class in college! It was the best. He's an excellent instructor, and the course project made me build a working C-style compiler step by step. I think the sample project here is pretty much the project we did; highly recommend following through the entire thing!
Just scannning the table of contents and I don't see any of the major topics of language design. It seems to be more like just "intro to compilers"
What books would you recommend for programming language design? What are the missing topics?
This looks like an undergrad-level walkthrough through key topics of how a language works. Say, python or ruby, or simpler pascal compilers.
Both compilers and language design are as old as this industry, and have too much knowledge for a single course.
This one is ok, better than most similar courses based on, say, the dragon book.
it wanders within a tight circle around C and its idiosyncrasies.
Probably by design.
> This book offers a one semester introduction [...] enabling the reader to build a simple compiler that accepts a *C-like language*
Then it is really not about language design... I would rather recommend https://www.plai.org/
Sometimes I see people who design languages and build compilers, and I find them truly amazing. I once tried making a language myself because I was curious, but it was so difficult that I just settled for a simple C backend. The people contributing to LLVM probably know everything down to assembly generation. they're truly incredible.
>The people contributing to LLVM probably know everything down to assembly generation. they're truly incredible.
Not really. I was webdev who then switched into compilers job with LLVM being foundation
LLVM itself is huge, it is not trivial to be familiar with every it's areas/mechanisms, but writing not-complex passes, bug fixing, regression fixing does not require some fancy knowledge
Assembly generation is actually pretty simple, it's optimizing everything that's difficult. Writing an assembler is a great way to get acquainted with compiler construction, because you don't need to think about optimization and types and the other features that make high level languages complicated aren't needed.
I actually started my first compiler my allowing (only) inline assembler first, and then starting to wrap higher level constructs around it.
It adds a little bit of complexity (you need to be very clear on how you handle registers) but it worked surprisingly well, and it makes it easy to built up the complexity step by step.
It also meant I could bootstrap the compiler itself with just an assembler.
Sadly I lost the source decades ago.
(Making assembler an integral construct of a higher-level language is also not a unique approach - there's Randall Hyde's High-Level Assembly[1] and others.)
[1] https://en.wikipedia.org/wiki/High_Level_Assembly
I keep saying 'someday...' and never actually doing it because of making a living, but this time I think I should try a few small examples
Honestly whipping up a lexer/parser and a REPL is one of my favorite ways to learn a new language. You can cover a lot of ground in a "real" language by just doing the frontend implementation of your own made-up language grammar and a little eval loop and its great for learning/teaching because you don't get bogged down in trying to solve some actual problem.
Which is to say: no shame in just settling for that simple C backend!
Good read. Impressive how ot sharpens past knowledge with great examples.
Compilers teaching materials often skip practical concerns. This resource covers the fundamentals well ā would be helpful to see more on optimization passes and code generation trade-offs.
https://news.ycombinator.com/threads?id=swordlucky666 - Sort of embarrassing that anyone vouched for this comment. Reading their history, they copy/paste the same comment or use an autogenerator (probably not an LLM, that'd produce better results) to generate comments like this one.
Here's a comical one:
https://news.ycombinator.com/item?id=48445529
> The discussion on Spanish traders set the standa raises interesting points. In practical applications, the key challenge is balancing performance with maintainability. Would be valuable to see more concrete examples of trade-offs. [emphasis added]
They glob out part of the submission title (and took too much and cut off in the middle of a word) generating a delightful nonsense descriptor (the italicized bit). The title being:
> Spanish traders set the standard for GnuCash database design
> Sort of embarrassing that anyone vouched for this comment
I'm the one who vouched it. I don't check commenters' history before doing it. Maybe I should. My LLM-detector is apparently broken (especially on short posts). At face value I saw nothing wrong with it, so I vouched it.
Hence why it's an "introduction" :)