Earlier quoted context omitted.
>really helped me internalize the concepts, and they are useful all over the place, not just in compilers. Which are some of those places? Parsing data formats could be one, I guess.
IMO compilers make you a lot more mature in recursive algorithms and trees, and then after that much more conscious about what exactly the code you write resolves to in terms of that languages semantics. Learning how closures work(variable capture and having to traverse the scope stack to find bound variables) is also a positive.
Crafting Interpreters
151–160 of 193 posts
Re: Crafting Interpreters
#152Earlier quoted context omitted.
As the author of a POSIX standard utility, I would advise you to only reach for such utilities when portability is the most important thing. POSIX utilities are not great. Lex and Yacc included.
Are POSIX utilities even portable? They tend to have poor windows support. And they also tend to target C, which has a high ceiling for portability, but also a high bar for making things portable (whereas more modern languages are often just portable by default). My take on POSIX utilities would be only to use them on Linux platforms where they effectively form a "native" part of the platform.
Does Windows claim POSIX compatibility these days? I didn't think so? I remember NT's old POSIX subsystem, but is that even a thing anymore?
> My take on POSIX utilities would be only to use them on Linux platforms
I mean, only use them on POSIX-compliant systems. Linux is just one of them.
At the risk of sounding childishly derisive, when someone is talking about "portability", I think they're generally not bothering to include Windows in the mix, as Windows doesn't really share all that much of a common denominator with much else.
Re: Crafting Interpreters
#153I really wish this book used something other than Java. Nothing against Java - just that I don't know it and don't feel excited about learning it.
Lots of people have done implementations in other languages: https://github.com/munificent/craftinginterpreters/wiki/Lox-... I did the first half in Clojure (in order to teach myself Clojure), worked just fine. I had to do a bit of translation but it's really not a lot.
I did the Torsten Ball books in Kotlin rather than Go and learned a lot
Re: Crafting Interpreters
#154Earlier quoted context omitted.
Do you have any thoughts about how to read some of the next step books like Engineering a Compiler/Dragon Book? I don't normally read large technical books end to end so I'm curious how others approach it. I am going through Crafting Interpreters right now and I like how it has well defined checkpoints that help me know that I can move on when I understand the current material. I skimmed Engineering a Compiler and it…
I think everyone has to pick a strategy for consuming material that works best for their brain. For me, when I read textbooks, I tend to read them front to back. Only a fraction of it sticks on the first read through, but I accept that. I've tried to go really slow and do all of the exercises to make it all stick, but I usually just run out of steam and give up. I'd rather just get through the whole thing. Then, in t…
Re: Crafting Interpreters
#155I know this book has been praised before on HN, but I've been personally a bit disappointed. It's suitable for someone with no very little knowledge on the topic, but it doesn't really cover any advanced topic.
I trust that you're correct, but I'm glad that this is the case. There are books designed to be introductory, and there are books that serve as reference for advanced topics and state-of-the-art techniques. The first type can often serve as an enabler for the second type.
Re: Crafting Interpreters
#156Currently free while the module is in beta. I spent today working through all of the lexer exercises in Rust (I'm currently learning it), and had a lot of fun.
Re: Crafting Interpreters
#157Earlier quoted context omitted.
Oh, I love C. [1] But yes, unforgiving. And a lot of magic, with special variables, macros, and functions that you must know. And unclear scoping. [1]: https://gavinhoward.com/2023/02/why-i-use-c-when-i-believe-i...
OT, but: I remember reading that post of yours a year or so ago! It was so bizarre to me, but also really fun. I feel like you are among what is probably a very small group of people who could write something security-sensitive in C, and I would feel comfortable using it. (I am still less than thrilled that I have to rely on OpenSSL, regardless of the process improvements its developer team has made in more recent ye…
> I feel like you are among what is probably a very small group of people who could write something security-sensitive in C, and I would feel comfortable using it.
This is probably the most complimentary thing anyone has ever said to me. Thank you! I hope I can live up to that.
Re: Crafting Interpreters
#158Author here. Seeing all of the positive comments about my book is really warming my heart. I appreciate everyone and I'm glad so many people have enjoyed the book. I put a ton of time and love into it and it's gratifying to see it had the effect I'd hoped for.
Re: Crafting Interpreters
#159Earlier quoted context omitted.
IMO compilers make you a lot more mature in recursive algorithms and trees, and then after that much more conscious about what exactly the code you write resolves to in terms of that languages semantics. Learning how closures work(variable capture and having to traverse the scope stack to find bound variables) is also a positive.
Makes sense, thanks.
Re: Crafting Interpreters
#160Author here. Seeing all of the positive comments about my book is really warming my heart. I appreciate everyone and I'm glad so many people have enjoyed the book. I put a ton of time and love into it and it's gratifying to see it had the effect I'd hoped for.