> This included what was probably the most interesting part, writing the tricky recursive code to implement the match statement.
Back in school I found this book[0], "The Implementation of Functional Programming Languages". Flipping through it was very neat because it kinda demystified the nuts and bolts of implementing the "fancier" functional programming features for me.
Chapter 5 is about implementing pattern matching.
You read this kind of stuff and realize how easy things become when you just tackle a problem with the right mindset and abstractions. And this is a book from 1987! We've always had decent answers for a lot of the stuff.
I think it's interesting to flip through if you're a language implementer, though helps to be comfortable with reading some stuff sideways and not understanding every detail.
It is even worse, we had decent answers for some of the stuff back in the 40s, 50s and 60s (e.g. Dijkstra's work on concurrency, before there even were computers to run them on.)
Someone will reply to my comment with Lovelace or Babbage or Pascal :-/
Not super aware of what Djikstra's work on concurrency you're referring to are. I've had to try to implement things from CS research papers directly and have always had a _bit_ of trouble (disclaimer: I'm dumb), and appreciate this book getting down to the implementation details in a bit of a fool-proof way.
Of course this book is a bunch of "research papers" stapled together in some sense but the act of curating is quite nice
rtpg · · focus · HN ↗
Back in school I found this book[0], "The Implementation of Functional Programming Languages". Flipping through it was very neat because it kinda demystified the nuts and bolts of implementing the "fancier" functional programming features for me.
Chapter 5 is about implementing pattern matching.
You read this kind of stuff and realize how easy things become when you just tackle a problem with the right mindset and abstractions. And this is a book from 1987! We've always had decent answers for a lot of the stuff.
I think it's interesting to flip through if you're a language implementer, though helps to be comfortable with reading some stuff sideways and not understanding every detail.
[0] <a href="https://simon.peytonjones.org/assets/pdfs/slpj-book-1987-searchable.pdf" rel="nofollow">https://simon.peytonjones.org/assets/pdfs/slpj-book-1987-sea...
fifticon · · focus · HN ↗
rtpg · · focus · HN ↗
Of course this book is a bunch of "research papers" stapled together in some sense but the act of curating is quite nice