Live data from Hacker News

My experience crafting an interpreter with Rust (2021)

ceronman.com

51–53 of 53 posts

Re: My experience crafting an interpreter with Rust (2021)

#51
I like how the author identified that his program was slower than he thought it should be, profiled, and identified some low-hanging fruit. He tried quite a lot of things, some of which panned out and some of which did not. Interpreters and Rust aside, this is a perfect example of software performance work.

Re: My experience crafting an interpreter with Rust (2021)

#52
post #32

Earlier quoted context omitted.

I have a question about the book. I haven't been able to ask anyone else because I don't know anyone else who is working through the book. Is the first half of the book boring or is it just me? I wasn't really expecting the scanner/lexer to be interesting, but the interpreter part as well feels like an absolute slog. I started with a lot of enthusiasm but just couldn't keep going after implementing functions. I downl…

perhaps you had no motivation for writing an interpreter? almost all programming tasks that are of any interest require you to have some special problem to solve. i really don't know how to describe this, but if you have no specific goal, you are not going to do, or learn how to do, anything. why do you deeply, deeply want to learn how to write an interpreter? what problem will writing an interpreter solve for you?

Nothing in particular other than knowledge that I can use across domains. I don't want to know how to write an interpreter per se, but I want to understand the steps from text to machine code.

I think it has already yielded benefits in my better understanding of environments and lexical scoping, grammars + LALR. It has just given me different conceptual tools that I can use to learn new concepts.

A concrete example was that I was playing around with a recursive prompt with ChatGPT the other day trying to figure out if I could get it to write a more specific version of a prompt I had given it and sort of bootstrap its way to a very specialized "train-of-thought". I was thinking about grammars and how recursive prompting is sort of like a meta-grammar. It's just a new way of thinking about things.

Re: My experience crafting an interpreter with Rust (2021)

#53
post #9

I’m curious about the extent to which DOS is a concern for an interpreter like this. I can see it be an issue if you’re exposing a service to external actors, but how big of a concern is it really in this context?

I went down that rabbit hole myself after reading the article. This sums up the situation: https://sudonull.com/post/127497-Non-cryptographic-hash-func...
Post reply on HN