CS 693/793-1C Special Topics in Domain Specific Languages

 

Spring 2004

 

Session

Instructor

Office hours

Monday, Wednesday, Friday: 10.10 -11.00 am

 

Room: CH 430

Marjan Mernik

Office: CH 122

Phone: (205) 934-8606

Email: marjan.mernik@uni-mb.si

By appointment

 

COURSE DESCRIPTION

 

Programming languages are a programmer's most basic tools. A language is suitable for a programming problem if it makes the programmer productive, and if it allows the programmer to write highly scalable, generic, readable and maintainable code. There are various ways to classify or to group programming languages. One can, for example, focus on the programming paradigm in such a classification (imperative vs. functional vs. logic vs. object-oriented). One can also consider 2GLs, 3GLs, 4GLs, or very high-level languages. We want to emphasize the division of programming languages into general-purpose and domain-specific languages. With general-purpose languages, one can address large classes of problems e.g., scientific computing, business processing, symbolic processing while a domain-specific language (DSL) facilitates the solution of problems in a particular domain. To this end, a DSL provides built-in abstractions and notations specific to the domain of concern. DSLs are usually small, more declarative than imperative, and more attractive than GPLs for a variety of applications because of easier programming, systematic reuse and easier verification. DSLs have been used in various domains and these applications have clearly illustrated the advantages of DSLs over GPLs in areas such as productivity, reliability, maintenability and flexibility. However, the cost for DSL design, development and maintenance has to be taken into account. Without an appropriate methodology and tools this costs can be higher than savings obtained by the later use of DSL. This course introduces students to appropriate methodologies and tools needed to support the development of DSLs.

The general topics of the course will be:

-          An introduction to the history of DSLs (including examples of some widely used DSLs)

-          Phases in the development of DSLs (analysis, design, implementation)

-          Domain Analysis Methodologies (e.g. FODA – Feature-Oriented Domain Analysis)

-          Language design issues

-          DSLs implementation approaches (compiler/interpreter, preprocessing, embedded, extensible compiler/interpreter)

-          Language development toolkits (ASF+SDF, LISA, metafront, etc.)

-          Incremental language development

-          DSL design patterns

-          Domain-Specific Visual Languages

 

PREREQUISITES

Programming languages, compilers

 

TEXTBOOK

There is no formal textbook for this course. The course web site will contain a list of required readings, as well as other related papers/books.

 

TENTATIVE SCHEDULE

 

Week 1 

Course Introduction

Programming Languages, various classifications

(imperative vs. declarative, GPLs vs. DSLs, ...)

History of DSLs

Week 2

Phases in the development of DSLs

Domain Analysis Methodologies (FODA)

Week 3

Language Design Issues (informal vs. formal)

Week 4

DSLs implementation approaches

(compiler/interpreter, preprocessing)

Week 5

DSLs implementation approaches

(embedding, extensible compiler/interpreter)

Week 6

Language development toolkits (LISA)

Week 7

Language development toolkits (ASF+SDF)

Week 8

Language development toolkits (metafront)

Week 9

Incremental Language Development

Week 10

DSL design patterns

Week 11

DSL design patterns

Week 12

Spring break

Week 13

Domain-Specific Visual Languages

Week 14

DSL examples 

Week 15

DSL examples

Week 16

DSL examples

 

 

LECTURES

 

- Lecture 01       (ppt) (Introduction, GPL definitions and classifications, DSL definitions)

- Lecture 02       (ppt) (GPL concepts – values, storage, bindings)

- Lecture 03-04 (ppt) (GPL concepts – abstraction, encapsulation, type systems, sequencers; DSL concepts)

- Lecture 05-06 (ppt) (Domain Analysis, FODA)

- Lecture 07-08 (ppt) (GPL design issues, DSL design issues)

- Lecture 09       (ppt) (DSL implementation approaches, compiler/interpreter approach – lexical analysis)

- Lecture 10-13 (ppt) (compiler/interpreter approach – syntax analysis, attribute grammars)

- Lecture 14-16 (ppt) (preprocessing approach – macro processing)

- Lecture 17-18 (ppt) (preprocessing approach – template meta-programming, expression templates)

- Lecture 19       (ppt) (preprocessing approach – source-to-source transformation, lexical processing)

- Lecture 20       (ppt) (embedding approach)

- Lecture 21-22 (ppt) (extensible compiler/interpreter approach)

- Lecture 23       (ppt) (XML-based approach)

- Lecture 24       (ppt) (hybrid approach)

- Lecture 25       (ppt) (resume of implementation approaches)

- Lecture 26-29 (ppt) (Language development toolkits – LISA)

- Lecture 30-31 (ppt) (Language development toolkits – ASF+SDF)

- Lecture 32       (ppt) (Language development toolkits – JTS)

- Lecture 33       (ppt) (Language development toolkits – metafront)

- Lecture 34       (ppt) (Language development toolkits – Intentional Programming)

                                     (Language development toolkits – Stratego, TXL)  See Program Transformation Seminar

- Lecture 35-37 (ppt) (DSL patterns)

- Lecture 38-40 (ppt) (Domain-Specific Visual Languages)

- Lecture 41-44 (ppt) (DSLs examples)

 

 

REQUIRED READINGS

 

L. Cardelli, R. Davies. Service Combinators for Web Computing. Proceedings of the 1st Conference on Domain-Specific Languages, 1997.

 

A. van Deursen, P. Klint. Domain-Specific Language Design Requires Feature Description, CIT Journal of Computing and Information Technology, Special Issue on Domain-Specific Languages, Part II, Eds. R. Laemmel, M. Mernik, Vol. 10, No. 1, pages 1-17, 2002.

 

D. Wile. Lessons Learned from Real DSL Experiments. HICSS-36, 2003.

 

J. Paakki. Attribute grammar paradigms - a high-level methodology in language implementation. ACM Computing Surveys, Vol. 27, No. 2, pages 196-255, 1995. (1st chapter)

 

J. Bentley. Little Languages. Communications of the ACM, Vol. 29, No. 8, pages 711-721, 1986.

 

A. van Deursen, P. Klint, J. Visser. Domain-Specific Languages: An Annotated Bibliography. ACM SIGPLAN Notices, 35(6):26-36, 2000.

 

P. Hudak. Modular Domain Specific Languages and Tools. Proceedings Fifth International Conference on Software Reuse, pages 134 – 142, 1998.

 

C. Consel, R. Marlet. Architecturing software using a methodology for language development . Proceedings of the 10th International Symposium on Programming Language Implementation and Logic Programming, pages 170-194, 1998.

 

S. Chiba. A Metaobject Protocol for C++. Conference on Object Oriented Programming Systems Languages and Applications, pages 285-299, 1995.

 

Y. Smaragdakis, D. Batory. Application Generators. A survey article in the Encyclopedia of Electrical and Electronics Engineering.

 

M. Mernik, M. Lenič, E. Avdičaušević, V. Žumer. Multiple attribute grammar inheritance. Informatica, 2000, Vol. 24, No. 3, pp. 319-328.

 

M. van den Brand, J. Heering, P. Klint, P. Olivier. Compiling Language Definitions: The ASF+SDF Compiler. ACM Transactions on Programming Languages and Systems, Vol. 24, No. 4, pages 334-368, 2002.

 

D. Batory, B. Lofaso, Y. Smaragdakis. JTS: Tools for implementing domain-specific languages. Proceedings of Fifth International Conference on Software Reuse, 1998.

 

C. Brabrand, M. Schwartzbach, M. Vanggaard. The metafront System: Extensible Parsing and Transformation, Electronic Notes in Theoretical Computer Science 82, No. 3, 2003.

 

O. De Moor. Intentional Programming. Invited talk at British Computer Society, 2001.

 

D. Spinellis. Notable design patterns for domain-specific languages. The Journal of Systems and Software, 56:2001, pp. 91-99.

 

M. Mernik, J. Heering, T. Sloane. When and how to develop domain-specific languages. CWI Technical Report, SEN-E0309, 2003.

 

 

OPTIONAL READINGS

 

S. Thibault. Domain-Specific Languages. Conception, Implementation and Application, Ph.D. Thesis, 1998.

 

K. Czarnecki, U. Eisenecker. Generative Programming: Methods, Tools, and Applications. Addison-Wesley, 2000.

 

J. Neighbors. Draco: A Method for Engineering Reusable Software Systems.  Chapter 12 of Software Reusability, pages 295 - 319, Addison-Wesley, 1989.

 

K. Dybvig, R. Hieb, C. Bruggeman. Syntactic abstraction in Scheme. Lisp and Symbolic Computations, Vol. 5, No. 4, pages 295-326, 1992.

 

C. Brabrand, M. Schwartzbach. Growing Languages with Metamorphic Syntax Macros. ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, 2002.

 

T. Veldhuizen. Using C++ template metaprograms. C++ Report, Vol. 7, No. 4, pages 36-43, May 1995.

 

T. Veldhuizen. Expression Templates. C++ Report, Vol. 7, No. 5, pages 26-31, June 1995.

 

A. Langer, K. Kreft. C++ Expression Templates. C/C++ Users Journal, March 2003.

 

L. Cardelli, F. Matthes, M. Abadi. Extensible syntax with lexical scoping. Technical Report, 1994.

 

C. Elliott. Functional Images. Submitted for publications in Journal of Functional Programming.

 

G. Gupta, E. Pontelli. A Horn Logic Denotational Framework for Specification, Implementation, and Verification of Domain Specific Languages. Technical Report, NMSU, 1999.

 

G. Kiczales, A. Paepcke. Open Implementations and Metaobject Protocols. Tutorial.

 

H. Kawashima, K. Gondow. Experience with ANSI C Markup Language for a Cross-Referencer. Hawaii International Conference on System Sciences, HICSS'03.

 

C. Elliott, S. Finne, O. de Moor. Compiling Embedded Languages. Semantics, Applications and Implementation of Program Generation workshop,   SAIG’2000.

 

J. Clements, M. Felleisen, R. Findler, M. Flatt, S. Krishnamurthi. Fostering Little Languages. Dr. Dobb’s Journal, March 2004.

 

M. Felleisen, R. Findler, M. Flatt, S. Krishnamurthi. Building Little Languages With Macros. Dr. Dobb’s Journal, April 2004.

 

M. Mernik, M. Lenič, E. Avdičaušević, V. Žumer. The Template and Multiple Inheritance Approach into Attribute Grammars. International Conference on Computer Languages ICCL98, Chicago, USA, pp. 102 - 110, 1998.

 

M. Mernik, V. Žumer. Incremental Programming Language Development, accepted for publication, Computer Languages, Systems and Structures, 2004.

 

E. Van Wyk, O. de Moor, K. Backhouse, P. Kwiatkowski. Forwarding in Attribute Grammars for Modular Language Design, Proceedings of the 11th International Conference on Compiler Construction, pages 128 – 142, 2002.

 

M. Burnett. Visual Programming. Encyclopedia of Electrical and Electronics Engineering, 1999.

 

R. Esser, J. Janneck. A Framework for Defining Domain-Specific Visual Languages. 1st Workshop on Domain Specific Visual Languages.

 

G. Costagliola, V. Deufemia, F. Ferrucci, C. Gravino. Exploiting XPG for Visual Languages: Definition, Analysis and Development. Electronic Notes in Theoretical Computer Science, Vol. 82, No. 3, LDTA’03, 2003.

 

S. Mauw, W. Wiersma, T. Willemse. Language-Driven System Design. HICSS-35, 2002.

 

R. A. van Engelen. ATMOL: A Domain-Specific Language for Atmospheric Modeling. CIT Journal of Computing and Information Technology, Special Issue on Domain-Specific Languages, Part I, Eds. R. Laemmel, M. Mernik, Vol. 9, No. 4, pages 289-303, 2001.

 

 

HOMEWORKS

 

1st homework (identifying DSL concepts) due January 30

2nd homework (construct and describe feature diagram) due February 4

3rd homework (attribute grammars) due February 23

4th homework (design your own DSL) due March 15

Bonus points  (LISA tool) due April 5

 

 

USEFUL LINKS

 

http://c2.com/cgi/wiki?DomainSpecificLanguage

http://compose.labri.fr/documentation/dsl/

http://lambda.weblogs.com/newsItems/viewDepartment$DSL

http://www.csee.wvu.edu/~menzies/pl/dsl101.html

http://www.cs.yale.edu/homes/hudak-paul/hudak-dir/dsl/