API vs. DSLs
The discussion of what is the difference between an (internal) DSL and an API comes up over and over again.
So, what is it that distinguishes a DSL from a (really well designed) API? Is it method chaining ("fluent APIs")? Is it the fact that the API/DSL is readable by a domain expert?
In my view, the two important differences are:(1) domain-specific syntax:
the syntax does not look like a 3GL program. It might be a completeley different syntax in an external DSL or syntax "tweaks" in an internal DSL that make it look sufficiently different than typical host language code(2) domain-specific validation:
if something's wrong in your "DSL program" I want error messages on the same level of abstraction as the program (which is: domain-specific) as opposed to strange compiler or runtime errors (because you somehow misused a weird host language feature)
I am not sure these two points are good enough to distinguish things. What do you think?