Survey DSL
H. Conrad Cunningham
16 April 2022
Browser Advisory: The HTML version of this textbook requires a browser that supports the display of MathML. A good choice as of April 2022 is a recent version of Firefox from Mozilla.
I developed the Survey DSL case study for my paper “A Little Language for Surveys: Constructing an Internal DSL in Ruby” [3].
H. Conrad Cunningham, “A Little Language for Surveys: Constructing an Internal DSL in Ruby,” In Proceedings of the ACM SouthEast Conference, Auburn, Alabama, USA, pp. 282–287, March, 2008.
My Powerpoint presentation from ACMSE 2008 is at this link.
Note: I subsequently wrote an improved version of the paper’s introduction.
I developed this DSL (my first larger DSL from scratch) originally as an example in my Fall 2006 special topics class (Engr 692) on Ruby and Software Development. I expanded it in late 2007 and early 2008 for the ACMSE 2008 paper [3]. I used the Ruby programming language [8,9].
2022 Note: This program should be tested with the current Ruby implementation and updated appropriately.
This case study develops an internal domain-specific language (DSL) for describing simple surveys consisting of sequences of questions with each question having a sequence of possible responses. The development of this DSL and program was inspired by an example in Jon Bentley’s Programming Pearls column on “Little Languages” [1]. In addition, the language and its implementation were influenced by Fowler [4,5,6 (draft)], Freeze [7], Buck [2], and other sources.
I developed this DSL (my first larger internal DSL from scratch) originally as an example in my Fall 2006 special topics class (Engr 692) on Ruby and Software Development. I expanded it in late 2007 and early 2008 for the ACMSE 2008 paper [3].
I retired from the full-time faculty in May 2019. As one of my post-retirement projects, I am continuing work on possible textbooks based on the course materials I had developed during my three decades as a faculty member. In January 2022, I began refining the existing content, integrating separately developed materials together, reformatting the documents, constructing a unified bibliography (e.g., using citeproc), and improving my build workflow and use of Pandoc. I adapted this index page from a portion of my Spring 2018 course notes.
I maintain this chapter as text in Pandoc’s dialect of Markdown using embedded LaTeX markup for the mathematical formulas and then translate the document to HTML, PDF, and other forms as needed.