Hacker News new | ask | show | jobs
by FeepingCreature 185 days ago
Nah. Source: have done it without formal language theory. You can do most things by printf debugging and kludging.

(Left-recursion? Use a while loop! Mutable state is a pathway to many abilities functional programmers consider unnatural.)

2 comments

You can definitely write parsers and lexers knowing just enough to be dangerous.

I remember being in the PHP culture where people wrote regex-based hacks instead of the character-at-a-time or token-at-a-time state machines or state machine + a stack kind of things which would be too slow in a language like that.

The less you know the faster you get in trouble when things get tough.

My statement was specific to recursive descent parsing.
But recursive descent parsing is implemented with functions operating on parser state. The whole point of it is that it's very easy to write a parser because the abstraction exactly matches to function calling in programming languages. So you can do the whole range of pl primitives too.