Chapter 7. Alternative Computational Models

When people talk about the benefits of using DSLs, you often hear them say that they support a more declarative approach to programming. I confess to having a problem with the word “declarative”; it often seems to be used as a very broad brush. In general, however, declarative means “something other than imperative.”

Mainstream programming languages follow the imperative computational model. The imperative model defines computation through a sequence of steps: do this, do that, if (red) do the other. Conditionals and loops vary the steps, and steps can be grouped together into functions. Object-oriented languages add bundling together of data and process, as well as polymorphism—but are still grounded ...

Get Domain Specific Languages now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.