BOB 2025

Developing DSLs: A Look at Three Practical Strategies with Real-World Examples
2025-03-14 , Talks A
Language: English

Domain-specific languages (DSLs) are languages specialized for a particular domain, and are typically equipped with features that make them well-suited for programming within that domain. This talk explores and compares three common strategies to creating DSLs:

  • Standalone DSLs, which are entirely new languages.
  • DSLs embedded in existing host languages.
  • DSLs that are subsets of existing host languages, which may employ one of two techniques: metaprogramming and compiler plugins.

Each strategy comes with its own benefits and drawbacks, and the optimal choice will vary based on your unique needs. We'll give an in-depth comparison of these approaches with real-world examples, considering the viewpoints of both language developers and language users. An example domain is smart contract languages for the Cardano blockchain, where DSLs employing each of the three strategies can be found. We’ll also draw examples from fields such as flight control systems, signal processing and more.


3-5 take-home ideas:

DSLs are widespread - most programmers have used at least one, usually several. This talk (1) provides direction in DSL development, a task sometimes (if not often) handled by domain experts rather than programming language experts; (2) helps determine which DSL to adopt given multiple alternatives; and (3) clarifies the contrasting considerations in DSL development for surface languages vs. core languages.

I lead the Plutus team at Input Output Global, focused on developing smart contract languages for the Cardano blockchain and the accompanying compilers, interpreters, libraries, and costing tools. All of our work is open source and freely accessible at https://github.com/IntersectMBO/plutus.