Ruby SIG: How to design a Domain Specific Language (DSL)
by David Pollak
How to design a Domain Specific Language (DSL)" by David Pollak
"Domain Specific Languages allow a domain expert to describe computational behavior using high level semantics and simple syntax. Designing a DSL requires learning the "words" used in the domain, choosing appropriate expressive tools, and "crawling into the head" of domain experts. David will describe a framework for developing DSLs such that they achieve the goals of being expressive, maintainable, and powerful."
Domain Specific Languages allow a Domain Expert to describe computational behavior using high level semantics and simple syntax. DSLs reduce coding time, coding complexity, and defects because they allow domain experts to use business terms to tell the computer what to do. Additionally, systems developed using DSLs are more maintainable because the original business intent is preserved in the code.
Successful general purpose DSLs include Excel, SQL, and HTML. Ruby provides the ability to quickly create new DSLs or enhance existing DSLs to meet the needs of various constituents in a development project. Ruby?s built-in meta-programming facilities allow for the creation of DSLs that use Ruby?s syntax while having higher level semantics. Ruby?s XML processing tools combined with Ruby?s dynamic class creation allow the creation of DSLs with XML-based syntax that can be presented to Domain Experts with a graphical front-end.
David will describe a framework for developing DSLs which includes:
- Identifying the constituents in a development project;
- Determining the costs and benefits of a DSL for a particular constituency vs. hand-coding functionality for that constituency based on interviews and specs;
- Identifying the ?thought leader? in a given constituency and interviewing him or her to determine the semantics of the domain;
- Determining syntax of the DSL;
- Mocking up the DSL and ?test driving? it with the thought leader;
- Finding appropriate integration points for the DSL into the application;
- Defining the process by with the Domain Experts will update code in the DSL (e.g., they have a web page where they can change tax calculation rules vs. they make a change to particular Ruby files as part of a development/staging/production cycle.); and
- Iterate over the semantics, syntax, and process to fully integrate Domain Experts into the development process.
About the Presenter
David has been developing commercial software for 28 years. He founded Athena Design and wrote Mesa, the first real-time spreadsheet. David wrote Integer, the first online, collaborative spreadsheet. Since 2000, David has been developing domain specific languages for security and general web development. David lives in San Francisco with his wife, twin toddlers, dog, two cats, but no partridges or pear trees.
1600 Amphitheatre Parkway
Mountain View, CA 94043
6:30 PM Registration and Networking
7:00 PM -8:40 PM Presentations
$15 at the door for non-SDForum members
No charge for SDForum members
No registration required
More on the Ruby SIG....