GitHub repository for open source material related to a BSc course at Chalmers and GU.
The main course homepage is in the Canvas LMS: (https://chalmers.instructure.com/courses/8975)
where AT = @chalmers.se
This repository is mainly the home of the DSLsofMath "book" (lecture notes).
Lecture notes + references therein cover the course but there is no printed course textbook.
Comments and contributions are always welcome – especially in the form of pull requests.
The main references are listed below.
The course presents classical mathematical topics from a computing science perspective: giving specifications of the concepts introduced, paying attention to syntax and types, and ultimately constructing DSLs of some mathematical areas mentioned below.
Learning outcomes as in the course syllabus.
The course is elective for both computer science and mathematics students at both Chalmers and GU.
The latest PDF snapshot of the full lecture notes can be found in L/snapshots.
Chapter 1–8 of the Lecture Notes end with weekly exercises for weeks 1–8.
In L/RecEx.md you will find a list of recommended exercises for each chapter of the lecture notes.
In order to do some of the exercises, you may need/want to have access to the DSLs introduced during the lectures and in the lecture notes.
To do this, first make sure you have installed
stack. Next, download this
tarball and extract it in a desired location (on
Linux and Mac, you can do this by running
tar -zxf DSLsofMath-x.x.x.x.tar.gz in the terminal. In Windows, you might have to use a tool like
If you are downloading the tar file from the CLI, download and extract using the following:
$ curl -OL https://github.com/DSLsofMath/DSLsofMath/raw/master/L/DSLsofMath-x.x.x.x.tar.gz $ tar -xzf DSLsofMath-x.x.x.x.tar.gz
Now go into the extracted folder
DSLsofMath-x.x.x.x/ and run
stack init. You can now interact with
the code from the lectures by typing
stack ghci, which puts you in GHCi with all
DSLs loaded. You can also place your own Haskell files inside this folder and import the DSLs you
want by typing the following at the start of your file:
where X is the chapter that contains the code you want to use. You should be able to load your own Haskell files in normal GHCi.
On the Linux remote machines you have a number of options to get stack to work.
Regardless of how you do it the goal is to have a local stack executable in the directory
One way to do this is to follow these steps:
stack upgrade, optionally download the right executable from the stack website.
export PATH="/chalmers/home/<<<Your CID here>>>/.local/bin/:$PATH"to your
/chalmers/home/<<<Your CID here>>>/.local/bin/stack
DSLsofMath course evaluation student representatives 2019: TBD
Some important references:
Functional Programming for Domain-Specific Languages, Jeremy Gibbons. In Central European Functional Programming School 2015, LNCS 8606, 2015. URL
This is currently the standard reference to DSLs for the functional programmer.
Folding Domain-Specific Languages: Deep and Shallow Embeddings, Jeremy Gibbons and Nicolas Wu, ICFP 2014. URL
Available at the same link: a highly recommended short version and the two videos of Jeremy presenting the most important ideas of DSLs in a very accessible way.
Programming Languages, Mike Spivey. Lecture notes of a course given at the CS Department in Oxford. Useful material for understanding the design and implementation of embedded DSLs. URL
Domain-Specific Languages, Martin Fowler, 2011. URL
The view from the object-oriented programming perspective.
Communicating Mathematics: Useful Ideas from Computer Science, Charles Wells, American Mathematical Monthly, May 1995. URL
This article was one of the main triggers of this course.
The Language of First-Order Logic, 3rd Edition, Jon Barwise and John Etchemendy, 1993. Out of print, but you can get it for one penny from Amazon UK. A vast improvement over its successors (as Tony Hoare said about Algol 60).
Mathematics: Form and Function, Saunders Mac Lane, Springer 1986. An overview of the relationships between the many mathematical domains. Entertaining, challenging, rewarding. Fulltext from the library
Functional Differential Geometry, Gerald Jay Sussman and Jack Wisdom, 2013, MIT. A book about using programming as a means of understanding differential geometry. Similar in spirit to the course, but more advanced and very different in form. An earlier version appeared as an AIM report.