Skip to content

Comment on DSL processing in Scala

Comments

You should check out the Parser package in the scala standard lib. I maintain a few DSLs using this and it's an absolute dream.

https://wiki.scala-lang.org/display/SW/Parser+Combinators--G...

Code looks solid otherwise...at least where I work the style would be to favor functional idioms over for loops but I think that's just personal preference.

That has been removed from the Scala standard lib and is now distributed separately. I am unsure how well it will be maintained by the community. As the other commenter said, parboiled2 is a good choice using macros and it is lightning fast. A lighter weight, runtime choice that was released recently is fastparse[0].

0 - https://github.com/lihaoyi/fastparse

Oh wow very good to know. We're just now looking to get to 2.11(very large codebase, upgrades are hard) so will definitely need to keep this in mind.

The Parboiled2 framework is often used for building parsers.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.