liveBook · Manning

External dsl

As explained in Functional Design and Architecture: Examples in Haskell

An external domain-specific language is a domain-specific language defined independently of a host programming language and processed by its own tooling.

An external domain-specific language defines domain artifacts outside application code, using separate text files and dedicated parsing and translation services. Engineers can describe hardware devices without coupling blueprints to the runtime’s hidden implementation protocols. section 3.3.1

Hardware blueprints

In a spaceship control system, engineers write external HDL files describing engines, fuel tanks, solar panels, and their sensors. The control software loads these declarations, translates them into HDL, and instantiates them in the runtime. A blueprint remains stateless, so multiple similar devices can be created from one description. section 3.3.1

The design separates domain descriptions from execution:

  • External definitions live in separate files, potentially edited in a custom IDE. section 3.3.1
  • Parsing and translation convert those definitions into the embedded HDL and its runtime. section 3.3.1
  • Stateless declarations act as templates or blueprints rather than devices themselves. section 3.3.1
  • The runtime can provide simplified representations for tests and hidden protocol-backed representations for production. section 3.3.1
Figure 3.14 Design of the hardware subsystem

Use the hardware subsystem design to trace external descriptions through translation into runtime device representations. section 3.3.1

How Functional Design and Architecture: Examples in Haskell covers it

How deep it goes
Defines separate files, parsing, translation, stateless declarations, and test-versus-production runtime representations without detailing parser implementation.
Examples
Uses spaceship hardware descriptions for engines, fuel tanks, solar panels, sensors, and reusable device blueprints.
What you can do after
Operate/configure hardware networks by writing external declarations that tooling translates into executable HDL runtime structures.
How it connects
Connects external DSLs to embedded DSLs, parsing, translation, runtime representations, templates, and software design complexity.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Functional Design and Architecture: Examples in Haskell. The section links point to the parts of the book it draws on.