Ive 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.
You could choose a DSL to match exactly the domain you're dealing with. Programmers can be comfortable with a general purpose language and applying it in many situations. Your non-programmers may benefit from a language that is directly relevant to them. It can also be easier for them to understand if keywords and concepts match their expertise.
Ultimately I would look at it this way: a DSL (like any programming language) is a set of lexical tokens and idioms that you can use to explain how to do something. Implicit within that set of tokens is a set of idioms.
A good example are reporting languages (eg Natural). That's because reports have common idioms like groups, breaking conditions and so on. Anyone who has done that in a general purpose language would tell you that it can be really tedious to do things like break conditions but it's certainly possible.
So the question you should be asking is this: are there any common idioms that would be tedious, difficult or extremely verbose to express in a general purpose language? You should also be asking: is there a particular subset of functionality that you are most interested in that would benefit by making it a language concept? This could be things like vectors and matrices for linear algebra (with the appropriate operations) or the same for integral/differnetial calculus or differential equations.
What you'd really like to have in the end with a DSL is where, say, a 500 line program could be express as 50-100 lines of your DSL and this applies for most "expected" algorithms. I guess it's a little like normalization in data modelling where the goal is to remove repeating groups. Writing the same 10-20 lines of code with a little variation suggests a common idiom.
As for a library of functions, that is a more limited view of the same thing (ultimately) except that a library of function is merely a package of different behaviours. That ssumes you define a library of functions as just that and don't instead include complex object hierarchies, closures and so on. If you do then the line between a "library of functions" and a DSL is blurred.
You have to weigh the degree to which you can provide a cleaner notation against the fact that nobody will start out knowing the notation you use. In theory, you might be able to follow the notation this group uses in general so well that it's "intuitively obvious" -- but unless they're different from most physicists, that probably won't work well. Many use things like Greek and/or Hebrew characters that aren't present on a typical keyboard.If you do use a DSL, are you prepared not only to implement it, but spend a good part of your life maintaining it? Do you have the resources to go beyond the language proper, and provide the kind of infrastructure for it to become a useful development tool? If it's going to be used for real development, it'll probably need a debugger. You might also want to consider either a new IDE (if it's really different) or tailoring an existing product to work (e.g. create a specialized mode for emacs or a plug-in for Eclipse).If you do invent a DSL, how likely is it that people will really use it? If there's already something thoroughly entrenched, displacing it will probably be quite difficult. Creating a new language that fills a vacuum is a lot easier than replacing something that's already in use. On the other hand, if there really is a vacuum, this may indicate that there's just not much market -- your audience may not be particularly interested in becoming software developers.
The mission of the Harvard Library is to advance scholarship and teaching by committing itself to the creation, application, preservation, and dissemination of knowledge. The use and reuse of digitized content for research, teaching, learning, and creative activities supports that mission. Digitized content enhances access for students and faculty to collections in Harvard's archives and libraries, and it provides a way for the Harvard Library to share its intellectual wealth with the rest of the world. In order to foster creative reuse of digitized content, Harvard Library allows free use of openly available digital reproductions of items from its collections that are not under copyright, except where other rights or restrictions apply.
Harvard Library asserts no copyright over digital reproductions of works in its collections which are in the public domain, where those digital reproductions are made openly available on Harvard Library websites. To the extent that some jurisdictions grant an additional copyright in digital reproductions of such works, Harvard Library relinquishes that copyright. When digital reproductions of public domain works are made openly available on its websites, Harvard Library does not charge for permission to use those reproductions, and it does not grant or deny permission to publish or otherwise distribute them. As a matter of good scholarly practice, Harvard Library requests that patrons using Library-provided reproductions provide appropriate citation to the source of reproductions. This policy is subject to the explanation and exclusions below.
Public domain; levels of copyright. Under this policy, the underlying work that has been digitized must be in the public domain in the United States. The same is true of any secondary representation of the underlying work that is sufficiently original to be protected by U.S. copyright law. Thus, for example, a digital reproduction of an in-copyright photograph of a public domain sculpture is not covered by this policy. Nor is a digital reproduction of a two-dimensional work (such as a page of a book) that is protected by copyright. Under this policy, Harvard Library is committing not to assert copyright in certain digital reproductions, but is not relinquishing any copyright it may hold in works or secondary representations that have been digitized. Some works that are in the public domain in the U.S. may remain in copyright in other countries. In that case, while Harvard Library will not assert foreign copyrights in the digital reproduction of such a work when the conditions of this policy are met, it is not relinquishing any foreign copyright it may hold in the underlying work or any secondary representation, and the user of the digital reproduction is responsible for obtaining any permission that is needed (whether from Harvard or a third party) to use the digital reproduction in other countries.
Public domain determination: When possible, Harvard Library will provide information on the copyright status of works that have been digitized and are made openly available. The nature of historical collections, however, is such that copyright or other information about restrictions may be difficult or even impossible to determine. The absence of explicit information on copyright is no guarantee, therefore, that a work is in the public domain either in the U.S. or abroad. Nor can Harvard Library guarantee the accuracy of any information about copyright status that it does provide. The Library makes no express or implied warranty to others who wish to use digital reproductions of items found in its collections. Users are solely responsible for making independent legal assessments of an item's status in the arena in which it is to be used.
Non-copyright restrictions: Some uses of public domain works may be restricted by trademark, privacy, publicity rights, donor requirements, or other such rights or restrictions. It is the user's sole responsibility to consider the possibility that such rights or restrictions may be involved and to secure any needed permissions.
Service fees: There may be costs associated with fulfilling requests for new digitization or for the provision of digital files that are not openly available (for example, high-resolution versions of web-accessible material). Fees for such reproduction and distribution services are set by the responsible library unit.
Openly available: This policy applies to publicly accessible digital reproductions found on Harvard Library web sites that, without restrictions, allow free downloads of digital images of public domain works. Any content that requires a user to log-in, authenticate, pay money, or agree to license terms, or that otherwise is subject to or accompanied by restrictions on access or use, is not considered openly available.
Exceptions: The Vice President for the Harvard Library may make exceptions to this policy in particular cases where the Vice President, or her or his delegate, determines on balance that the aims of the Harvard Library would be better served by such an exception.
Information on use: Formal requests for permissions to publish have traditionally served the purpose of providing a means for acquiring information about image use. Harvard Library may implement systems to identify and track the use of images made openly available under this policy.
Citation and credit: Harvard Library requests as a matter of good scholarly practice that appropriate citations be provided to the source of digital reproductions that are used in any media. Source libraries and archives often provide preferred forms of attribution, citation, or credit in the metadata for a digital reproduction.
Fair Use: Under this policy, digitized reproductions of public domain works may be used for any purpose without first seeking permission from Harvard Library. Reproductions of many other works in the collections are also available from the Harvard Library in varying formats. Harvard Library supports fair use of its digitized reproductions that are not subject to this policy when all applicable legal criteria are met.
3a8082e126