Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> A DSL would have a nice BNF-like syntax and abstract any implementation details away.

Use powerful enough language.

https://en.wikibooks.org/wiki/Common_Lisp/External_libraries...

Here, you can pretty much write out your BNF directly and get a parser out of it.



That's exactly the approach I'm preaching. I've built entire layers of languages above Lisp using this kind of eDSLs: https://github.com/combinatorylogic/mbase

So, yes, as long as you have a sufficiently powerful meta-language, eDSL is almost always better than a library. But yet, if your language is not powerful at all, DSLs (standalone) are still better then the libraries, they're just a bit more complicated to implement.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: