sle-rug

SLE course at University of Groningen

View the Project on GitHub cwi-swat/sle-rug

Software Language Engineering

Software Language Engineering (SLE) is concerned with the principled techniques and concepts for the construction of software languages. Software languages come in many shapes and sizes, including programming languages, modeling languages, data format languages, specification languages etc. In this course you will get acquainted with the basic techniques and concepts of language engineering, and acquire the basic skills to define the syntax and semantics of software languages, as well as know the relevant tools and techniques for implementing various kinds of language processors. The course consists of a series of lectures based on the book on SLE by Ralf Lämmel. During the course you will develop a simple domain-specific language (DSL) using the metaprogramming language Rascal, exercising both foundational and practical aspects of SLE. The final exam will test individual knowledge regarding the key concepts of SLE.

General information

Contact: Tijs van der Storm storm@cwi.nl

This page: https://cwi-swat.github.io/sle-rug/

Syllabus

Book: Software Languages: Syntax, Semantics, and Metaprogramming, by Ralf Lämmel. The book is for sale here: Springer, Amazon FREE E-book: https://rug.on.worldcat.org/oclc/1036771828.

Detailed schedule: rooster.rug.nl

Lab

If you haven’t done so, install VS Code, and install the Rascal VS Code plugin from the extension pane. Documentation is here: Rascal Docs. Fork the sle-rug repository, add the folder to your VS Code workspace, and check out the provided modules in src for detailed instructions for the exercises from week 2 on.

QL

The lab assignment is based on the Language Workbench Challenge 2013. The goal of the assignment is to build a DSL for questionnaires, called QL. QL allows you to define simple forms with conditions and computed values.

Here is some more detail:

Here’s a simple questionnaire in QL from the domain of tax filing:

form taxOfficeExample { 
  "Did you sell a house in 2010?"
    hasSoldHouse: boolean
  "Did you buy a house in 2010?"
    hasBoughtHouse: boolean
  "Did you enter a loan?"
    hasMaintLoan: boolean
    
  if (hasSoldHouse) {
    "What was the selling price?"
      sellingPrice: integer
    "Private debts for the sold house:"
      privateDebt: integer
    "Value residue:"
      valueResidue: integer = 
        (sellingPrice - privateDebt)
  }
  
}