by coryrc · 4y ago · 0 comments
I think the magic is in getting the interpreter to work, and depending on the personality, that might be what's motivating.
I bought the dragon book long ago. I got about halfway through and it was still on parsing! What a waste. That's not a problem for s-expressions.
That makes me think you might've forgotten what it's like to be a beginner. Imagine teaching a high school student and that every other word you're using doesn't make complete sense to them yet.
Let's put things in perspective: the parser bit of putting together your own lisp is by far the easiest task of all.
Complaining that parsing lisp is hard to a beginner but everything else is accessible makes no sense at all. I mean, a parser for s-expressions requires what? Five or six terminal tokens and three or four non-terminal tokens? That's less than 50loc.
If you're not undertaking this to learn how to write a Lisp, which includes writing a parser, what's the point? Get this tribe 3 shit out of here...
one major difference is that you don't have to write the parser at all the other way
It's trivial to anyone.
Furthermore, there are already s-expression parsers out there.
Suggesting JSON is simply poor, ill-thought out advice.