See Also edit
- programming by exception
- one way to end up with a DSL
- little language
Reading edit
- Using a hierarchy of Domain Specific Languages in complex software systems design, V.S. Lugovsky, 2004-09-09
Tcl DSL's edit
- fileutil::multip::op
- a DSL for performing operations on groups of files
- TDL
- A DSL for XML
- Gregor: A DSL for building semester calendars
- Solving the advection-diffusion equation
- see below
- A DSL to generate XSD files
- Automates the larges part of creating an XSD.
Description edit
A domain-specific language is a programming language designed explicitly to express activities in a certain domain, and either incidentally or purposefully limits itself to those expressions directly relevant to that domain.Some examples:- Text processing: awk, sed, m4
- Document preparation: LaTeX, roff
- Development of domain-specific languages: Tcl
- Page description: PostScript
- Software development: make, Lex, Yacc
- Mathematics: MATLAB, Scilab
- systems-level bit-twiddling: C
- interacting with command-line programs: Expect
- composing structured text: STX, TIP format, wikit's page formatting language
- pattern matching: regexp, fumagic
- everything that seems to fall outside Tcl syntax: all of the Tcl little languages
- (not usually thought of as a language) network protocols for performing the network interaction specified by the protocol, so SMTP for example, can be considered a DSL for defining a mail exchange. If Java can use XML, we can use SMTP.
- (also not usually thought of as a language) Undo Lists - programs which implement an undo function must do so by maintaining an ordered list of functions to apply to reverse a given operation - these have linguistic structure.
AM 2006-03-03: I consider the script in Solving the advection-diffusion equation an example of a domain-specific language:
- The script defines some convenient commands to get the description of the physical-mathematical problem into the solver's data structures
- It uses the control structures offered by Tcl to steer the computation and produce output.
CMcC 2006-09-13: Tcl is eminently suitable as a target for compilation of DSLs, in that it has a very regular/minimal syntax and a rich and extensible semantics. Tcl's syntax supports trees (as lists of lists) and lexically colouring elements with semantics (by using [] instead of {} to delineate sub-tree nodes.) It is therefore possible, and quite often effective, to transform (compile) a DSL into Tcl, then evaluate the product.This is how I implement STX ... parsing the input text into functional units, basically duples (function and text-or-subexpression) and then lexically converting these into invocations of tcl-supplied semantics.