Which do you prefer?: DSL or a well-designed Library?

jrop

Jonathan Apodaca

Posted on April 2, 2019

Which do you prefer?: DSL or a well-designed Library?

Lately, I am preferring libraries over DSLs more and more. As I have ventured into learning Rust, it seems that all too many Crate authors abuse the (otherwise awesome) macro-system to create their own DSL. If more library-developers spent their time on designing a well-put-together API, then I would have the benefit of everything else my IDE supports:

  • Syntax I am familiar with: nothing else to learn besides the API surface
  • Autocomplete for discovery! (instead of switching between a Docs page and my text-editor)
  • Inline documentation, if methods were documented
  • etc.

The epitome of this philosophy would be RethinkDB's query language, which is actually an API, and not its own query language!

What do you all prefer?

💖 💪 🙅 🚩
jrop
Jonathan Apodaca

Posted on April 2, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related