Bubbles_glow

≡ Literary Systems ≡

 
Corner_fold
  • Citation
  • Extension
  • Response
  • Comment
 
Flowchart_grey_24

Domain-Specific Languages

One of the most promising developments in programming today is the increasing use of domain-specific languages. DSLs are mini-languages designed for a particular problem, with all of their conventions and idioms created to make it easy to talk about the task at hand. They often originate as thought-experiments: Imagine that you had a language that was perfectly suited to describe the ideas that you are trying to get across. What would that language look like? How would its semantics work? At this point, the compromises begin. You take your dream language and try to map it onto a set of literary forms in an existing language, making it real, and, if it happens to be code, making it run.

With programming, what this often entails is treating the DSL code as a kind of data, analyzing it, and using it to generate the larger bodies of functional code that actually perform the work. All of the boilerplate syntax and setup is abstracted into the language, and suddenly you can speak fluently and constructively about the ideas. With traditional literature, DSLs are often developed of the course of immersive novels. At each turn of the page, the author builds up a back-story, psychological profiles of the characters, motifs, metaphors and symbolism, patterns of speech, forms that she can then call upon later with fluency.

Domain-specific languages also help authors write about new areas of experience. Often the language that one has ready-to-hand is misleading under changed circumstances. If you shift the isomorphisms that map from language onto the real world, without changing that language, then your intended meaning will often fall off the mark, still tinted by the habitual understanding of the words. In non-Euclidean geometry, for example, because the underlying axioms have changed, a "line" is not a line. At least, not any sort of line that we would recognize as such. A DSL can be an escape from getting trapped in the old isomorphisms.