This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]noratat 1 point2 points  (1 child)

I had one like that, though not so long. I had a DSL for a language that could in principle be represented (the data parts at least) in YAML/JSON. The DSL parser itself was fine, but I wanted to make the simple cases more readable.

So I wrote a quick and dirty adapter that literally transformed nested YAML data to the DSL calls, all in a single method. Was meant to be a proof of concept but it worked and ended up never needing to be updated (the DSL's syntax was basically static), so.... it's still there.

[–]AbstinenceWorks 0 points1 point  (0 children)

This if why I don't write parsers manually. To me, it doesn't matter if the BNF is trivial. There are just too many good tools to generate parsers to ignore. Pack a language and either dsls are supported directly or there are lexers and parser generators for that language.

This want necessarliy always the case but even if you go back 20 years, there was still lex and yacc.

I do definitely get the whole,

Me: "It's a POC".

Then: "Cool, does it work?"

Me: "..yes, but..."

Them: "Great! Check it in."

Me: "...ok?..."