Hacker News new | past | comments | ask | show | jobs | submit login

Actually, I disagree.

The _by far_ easiest way is to use the host language itself.

Using _any_ other language, e.g. yaml, forces you to do a lot of things that you get for free when using the host language, including syntax, type-checking/linting, build-system if you need one and especially all the tooling that comes with it for free (e.g. autocomplete in IDEs).

In fact, there is almost no benefit at all of using yaml _for DSLs_.

(And yes, there is widely-available syntaxhighlighting for yaml and others, but that doesn't over anything specific for the DSL, or otherwise you will have to customize it)




Host language is rarely ever declarative. Declarative languages are often necessary because they don’t leave any escape hatches that tempt you into writing incorrect code. Build system dependency graphs one common example. It’s also needed to pass data between different systems without recompiling and to constrain the usage boundaries, especially around security.

Imagine how absurd it would be if mongodb queries were written in the host language C++ instead of json.

For in-house stuff agree. There is no point to make excessive config layers if only developers will touch it anyway.


> For in-house stuff agree. There is no point to make excessive config layers if only developers will touch it anyway.

Yeah, I'm specifically talking about in-house DSLs or those that are only used by/from specific users. That doesn't have to be developers, but they should be using the host language as well - and in that case, an imperative host language can still make it able to use a declarative DSL. (in the most basic way for instance: generate a datastructure that essentially describes a json/yaml or whatever)

For non-inhouse DSL, I agree that it is usually worthwhile to make them standalone.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: