This may be subjective, I don't know: I have this problem, which I'm kind of equating to the "what language for this project?" question, since I can't seem to solve it.
I've been commisioned to write a book about a certain domain (let's say a very specific branch of physics) for a very technically savvy community, but who are not programmers. It is a book on this subset of algorithms that they use day in day out.
For this, given my audience, I've been toying with the idea of defining a DSL, instead of making them learn language X, and discuss the algorithms in this light, instead of in a given language or in pseudo-code.
The question is, then: what are some indications that what you need is a DSL rather than a library of functions to be called from a well-established, general-purpose language?
Thanks.
EDIT: Suggestions so far in favor of DSL:
- Shield from general-purpose language complexity.
- Make "programmer" more productive in his/her domain.
- Make language concepts highly intuitive for newbies in programming. (Just thought of this now)
You can use a DSL to decouple a set of related operations from the calling language.
If you want to shield your users from the complexity of the general-purpose language (or restrict their access to that language because they could abuse it), design a DSL.
But if you want the operations to be used in a manner integrated with the calling language, then use a library of functions (or other operators).
I would think that the purpose of a DSL was to abstract away details and enable a programmer (or implementor) to be productive by keeping their head in the domain, so to speak.
If you want to explain the details of a collection of algorithms, I would stick with one of the usual suspects (C++?).
An important consideration is whether your audience already use a single language predominately. If so, the choice has been made for you!
Another thing you might want to consider, is that by choosing a popular mainstream language, your book is applicable to a wider audience, without first having to 'learn' a DSL.