instaparse

If you're not trampolining your parser, why bother getting up in the morning?
sova-soars-the-sora 2018-05-31T15:37:48.000091Z

hey @aengelberg, how does instaparse work? i was looking at the source and it looks like it makes multiple passes until it's successfully consumed the whole input string, correct? and if a parse doesn't work, an "error node is embedded in the tree" so it knows not to try that parse again?

aengelberg 2018-05-31T16:27:49.000811Z

@sova this talk explains the internals pretty well https://www.youtube.com/watch?v=b2AUW6psVcE

sova-soars-the-sora 2018-05-31T16:28:44.000569Z

oh nice. thank you! i was very curious because it's very powerful and very fast and i don't remember things being so fast in compilers class 😄

aengelberg 2018-05-31T16:29:21.000482Z

glad to hear it's fast! Although what makes Instaparse really unique is that it works well with left-recursive and ambiguous grammars

aengelberg 2018-05-31T16:29:52.000086Z

something like

S = 'a' | S 'a'
usually doesn't work in normal parsers

sova-soars-the-sora 2018-05-31T16:30:21.000109Z

leftwards-building strings... I see that is cool

sova-soars-the-sora 2018-05-31T16:34:40.000694Z

I want to do some language processing stuff -- eventually reduce articles people write to synopses and relevant tags. i feel like that's very possible but i gotta think a bit more on the approach. like checking words against a dictionary to try and focus on nouns and verbs

sova-soars-the-sora 2018-05-31T16:55:49.000542Z

aha, now i know why the file is called .gll 😄

sova-soars-the-sora 2018-05-31T17:21:26.000569Z

"send me all your old magazine subscriptions before any new ones" is a good way to explain how it works briefly.

👍 1