Does anyone know of a good resoucce for creating a statically typed language with stuff like parametric polymorphism and basic type inference?
People have asked me to write something like this many times and one of the main reasons I haven't is because it's so open-ended. With Crafting Interpreters, I felt like there was a reasonably small self-contained language I could come up with that covered almost all of the concepts I wanted to teach: variable scope, functions, closures, classes and dynamic dispatch, control flow, etc. With type systems, there are a…
Crafting Interpreters
171–180 of 193 posts
Re: Crafting Interpreters
#172Author 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.
Hi Bob, I haven’t completed the book yet, but I wanted to note I appreciate you making it available for free online. I do my best to support authors like you (I have the book in print, PDF, and Kindle editions) and encourage others to do the same. Thank you!
Putting the book online is one of those things that turned out to be a real non-zero-sum proposition. It draws a lot of people into the book and gives them the ability to check it out before they buy it, which has certainly increased total sales and made me more money.
But, also, for those who can't easily afford it, it ensures they still have access to it, which is good for them.
Kind of an honor system market segmentation.
Re: Crafting Interpreters
#173Author 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.
Would you be interested by translations? I can do it in French and Esperanto. And by the way, thank you very much for the original version.
I'm guessing no publisher will show up wanting to do an Esperanto translation. :)
I'd like to say "yes", but I also have to worry about sending a confusing signal to other people who might think I'm giving a blanket yes to translations.
I really do appreciate the offer, though.
Re: Crafting Interpreters
#174Author 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.
Hi, loved your previous work on languages (Magpie, etc.). Any update on the statically typed language you were working on? Is it still in progress? The syntax for dealing with Sum types was pretty ingenious. Thanks for both the books, cheers.
I spent a lot of time trying to figure out how I wanted to handle generics and heterogeneous data in a way that felt simple enough for me to design and implement it. I think I have something more or less figured out. It's about a 50/50 blend of Go interfaces and Rust traits.
I have a prototype implementation in progress but haven't had much time to work on it. I broke my ankle a couple of months ago and while I've had plenty of time being stuck on the couch, I just haven't had the brainpower to work on it.
I haven't given up on it, though.
Re: Crafting Interpreters
#175Author 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.
That book is an absolute treasure and you should be proud. At a personal level, this book contained so much that I had always wanted to know, from how hashmaps work, to how to compile in a single pass. And I connected with your note on getting into writing languages partly due to a feeling of being less-than programmers who could create their own language. One thing I wanted to share: I found a small design change to…
Yes, that sounds like it would work fine to me. The only downside to keep in mind is that you will periods of time where you need to allocate more memory and have to do that first and then only free up memory in a GC after that allocation takes place. If you're very memory constrained or you need to allocate a lot, that could potentially be a problem.
But if I'm totally honest, I'm not sure how big of a problem that is in practice. One of the really annoying things about garbage collectors is how little literature there is on real-world collection strategies. You can find plenty of papers on collection algorithms, but it's hard to find material on when a GC should run.
Re: Crafting Interpreters
#176Earlier quoted context omitted.
That book is an absolute treasure and you should be proud. At a personal level, this book contained so much that I had always wanted to know, from how hashmaps work, to how to compile in a single pass. And I connected with your note on getting into writing languages partly due to a feeling of being less-than programmers who could create their own language. One thing I wanted to share: I found a small design change to…
This is a really really cool idea. Thank you for writing this up. Yes, that sounds like it would work fine to me. The only downside to keep in mind is that you will periods of time where you need to allocate more memory and have to do that first and then only free up memory in a GC after that allocation takes place. If you're very memory constrained or you need to allocate a lot, that could potentially be a problem.…
Have you ever contacted the authors of The Garbage Collection Handbook[1]? It seems like they intend that book to have the most breadth of knowledge about GC, and if there's anybody out there who has studied when to collect they might know who.
Re: Crafting Interpreters
#177Earlier quoted context omitted.
Thank you for writing the book! I'm currently almost done with the first part (doing it in Haskell because why not) and every chapter I encounter situations where my "clever hack" turns out not to be so clever in the light of later requirements. It's been great fun so far. Have you considered writing up a follow-up book doing (say) a compiler or a JIT or something for Lox? PS: the lexical analygator is the best and h…
[flagged]
Re: Crafting Interpreters
#178Earlier quoted context omitted.
This is a really really cool idea. Thank you for writing this up. Yes, that sounds like it would work fine to me. The only downside to keep in mind is that you will periods of time where you need to allocate more memory and have to do that first and then only free up memory in a GC after that allocation takes place. If you're very memory constrained or you need to allocate a lot, that could potentially be a problem.…
Yeah, "When to schedule?" is a really good question. Have you ever contacted the authors of The Garbage Collection Handbook [1]? It seems like they intend that book to have the most breadth of knowledge about GC, and if there's anybody out there who has studied when to collect they might know who. [1] https://gchandbook.org/index.html
Re: Crafting Interpreters
#179Re: Crafting Interpreters
#180Earlier quoted context omitted.
Yeah, "When to schedule?" is a really good question. Have you ever contacted the authors of The Garbage Collection Handbook [1]? It seems like they intend that book to have the most breadth of knowledge about GC, and if there's anybody out there who has studied when to collect they might know who. [1] https://gchandbook.org/index.html
I haven't. That's a good idea. I'm pretty good at tracking down resources, but really bad at actually contacting humans.
Incidentally, that book might contain information on when to GC; I haven't actually finished it yet.