Live data from Hacker News

Crafting Interpreters

craftinginterpreters.com

41–50 of 193 posts

Re: Crafting Interpreters

#41

I 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.

For what it's worth, these days you could use an LLM to turn each code snippet into many other languages. Or just focus on his words and use the snippets like generic code and figure out how to do it in whatever language of choice. You don't need to "learn java" to become conversant or read it as pseudocode.

That's great advice. Thank you!

Re: Crafting Interpreters

#42

I 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.

I’m glad it used Java. I wound up rewriting the code in Python and it really helped me understand the concepts a lot better.

Re: Crafting Interpreters

#44

Mad respect to those with that kind of dedication, and everyone working to keep all the dev infrastructure going, but I'm super glad my "I want to make a language" phase was just a passing interest! That's just a crazy amount of work!

It doesn't have to be a crazy amount of work, see Lisp-in-Lisp in the original SCIP book or a lambda calculus interpreter in Haskell (fits on a screen).

Re: Crafting Interpreters

#45

I 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.

When Java gets pattern matching, it will become a more reasonable choice to write an interpreter in.

It’s had pattern matching since 16, it’s been expanded since with some syntactic sugar and more recently the introduction of sum types and exhaustiveness to go along with pattern matching.

Re: Crafting Interpreters

#48

Mad respect to those with that kind of dedication, and everyone working to keep all the dev infrastructure going, but I'm super glad my "I want to make a language" phase was just a passing interest! That's just a crazy amount of work!

It doesn't have to be a crazy amount of work, see Lisp-in-Lisp in the original SCIP book or a lambda calculus interpreter in Haskell (fits on a screen).

Actually doing anything beyond weekend project complexity with that sort of thing is pretty hard though.

I guess if you have a lot of fairly small ideas with a lot of novelty, I could see the appeal of a new language to express them in.

Re: Crafting Interpreters

#49

Mad respect to those with that kind of dedication, and everyone working to keep all the dev infrastructure going, but I'm super glad my "I want to make a language" phase was just a passing interest! That's just a crazy amount of work!

It doesn't have to be a crazy amount of work, see Lisp-in-Lisp in the original SCIP book or a lambda calculus interpreter in Haskell (fits on a screen).

L-in-L interpreters assume that you already have symbols implemented, memory management implemented, reader and printer implemented, ...

You could spend considerably more time implementing a Lisp dialect's math library than the interpreter. There are a lot of combinations.

Where are the objects, hash tables, exception handling, ...

Of course you can get some of these things from a host language, but someone had to make them.

Post reply on HN