dsl-course / mps-textbook-beginners

Programming with JetBrains MPS - Textbook for Beginners
21 stars 2 forks source link

Programming with JetBrains MPS — Textbook for Beginners

This document contains an outline of a textbook on JetBrains Meta Programming System (JetBrains MPS) being written by Mikhail Barash. The purpose of this document is to have a discussion on the content structure of the textbook with MPS community members.

The textbook is meant for those without any prior experience on JetBrains MPS or language engineering. The author has some experience in teaching courses on MPS, and this book is planned as an embodiment of the methodological approaches used in different teaching settings.

The structural unit of the book is a double-page spread, rather than a page. Each spread is a finished piece of information — it has self-contained material on a particular topic. Some topics span over several spreads, and in such cases each of the spreads is devoted to a single subtopic.

The textbook is divided into three parts:

This choice and order of the parts is explained by a desire to avoid burdening the reader with language engineering terminology (from our experience, even "AST" scares off beginners.) We start with known terminology – classes, interfaces, enumerations – and slowly revise key notions and ideas using "appropriate" terminology. Moreover, the choice of the parts reflects typical patterns for building a software language.

Here are some of the highlights of the content of the textbook.

Below we list the spreads of the book.

Spread # Topic
0 What is MPS?
1—2 MPS as a Tool for Textual User Interfaces
3—6 Object-Oriented Programming in MPS
7 Intentions and Quickfixes
8—10 Generating Text Output with TextGen
11 Generating XML Output with Generator
12—13 Generating Java Code with Generator
14—16 Projectional Editing: Pros and Cons
17—18 Tabular and Graphical projections
19 MPS as a Modelling Tool
20—21 Looking at Code Through MPS Prism
22—24 Entities Example
25—26 Scoping Rules and Constraints
27—29 Generating Java Code with Generator
30—31 Generating JavaScript Code
32 Generating VBA Code
33—34 Checking Domain Code: Type Systems
35 Checking Domain Code: Data-Flow Analysis
36 Evolution of Languages
37—39 MPS as a Tool for Extending Existing Languages Java/baseLanguage
40 MPS in Practice

When Will the Textbook Be Ready?

Rough estimate is Q2–Q3 2020.

It takes a significant amount of time not only to prepare the content of a spread, but also to layout it in a proper and engaging way. Inspired by this, this and this, we try to use encyclopedia-style layout (only layout — not content), for example, with boxes for extra material, and so on.

The book will be published electronically and will be open-source: all spreads will be published in Adobe Illustrator format (layers preserved etc.) so that they could be (re)used for creating teaching materials.