instaparse

If you're not trampolining your parser, why bother getting up in the morning?
aengelberg 2019-10-30T05:41:54.012900Z

@d4hines the idea has been tossed around a couple times, but the only implementation I'm aware of is my experiment https://github.com/aengelberg/instagenerate which isn't super useable in practice.

aengelberg 2019-10-30T05:46:26.016200Z

My usage of core.logic was primarily motivated by a challenge to reverse-engineer output parse trees or fill in partial outputs. But if the main goal is to simply generate random inputs to a grammar (which most people really want), I think the implementation could be a lot cleaner, and leverage test.check.

aengelberg 2019-10-30T05:47:20.016900Z

The hardest part I think would be coming up with a good solution to lookahead and negative lookahead, while guaranteeing terminable generation...

2019-10-30T13:45:34.022400Z

I'm a noob when it comes to this stuff. Do you need lookahead for an EBNF grammar?

aengelberg 2019-11-01T15:29:40.024900Z

I don’t think so, it’s just a nice feature that sometimes people take advantage of

2019-10-30T12:49:03.019500Z

That's really cool!

2019-10-30T13:03:13.020700Z

Maybe this project is relevant https://github.com/cs-au-dk/dk.brics.automaton ? We used it to generate data, also from regexps

2019-10-30T14:27:37.023600Z

When I wrote a generator for regexes I intentionally didn't try to support lookaheadbehinds

2019-10-30T14:28:12.024300Z

But it seems like something you could support with the same caveats as such-that

2019-10-30T14:28:33.024800Z

(And have it fail the same way, rather than infinite loop)