adventofcode

Happy Advent 2020! Please put answers in the pinned threads or create one if it does not exist yet. | https://github.com/adventofcode-clojurians/adventofcode-clojurians | Join the private leaderboard with code 217019-4a55b8eb
bhauman 2018-01-19T14:21:20.000535Z

I recently wrote a regexp to tokeninze clojure code it runs in under a single millis to parse a large amount of text. Regexps are freaking fast.

borkdude 2018-01-19T15:08:52.000115Z

@bhauman yes, that’s what my handwritten parser does (well in multiple steps, but it could be optimized into a single regex maybe). It’s by far the fastest.

borkdude 2018-01-19T15:10:30.000571Z

but regexes only go so far, context free grammars are more powerful (nested parens for example), so sometimes it’s very convenient to use something like Instaparse

bhauman 2018-01-19T16:31:26.000671Z

@borkdude agreed 🙂