liveBook · Manning

Software language

As explained in Building User-Friendly DSLs

An artificial language defined precisely through software, with a formal meaning, notation, and tools for writing and processing it.

A software language is an artificial language defined precisely through software. It has formal meaning, a clear notation or syntax, and tools that let users write and process it. Its notation may resemble natural language, but it avoids ambiguity. section 1.1

Software languages share these properties:

  • Use a precise definition, usually expressed through a grammar. section 1.1
  • Give written prose a precise meaning through explicit notation or syntax. section 1.1
  • Provide software tools for writing and processing language artifacts. section 1.1
  • Include programming and modeling languages, while also leaving room for domain-specific languages and other kinds. section 1.1

Car-rental business rules

A car-rental business can express pricing knowledge as rules such as applying a 10% holiday surcharge, a 5% weekly discount, or a $10-per-day environmental fee. A language tool can process these precise statements into working software. section 1.1

Table 1.1 Natural language expressing car rental business knowledge
If the rental period contains a national holiday, then a surcharge rate of 10% is applied to the rental price for that holiday.
If the length of the rental period exceeds a whole week, then a discount rate of 5% is applied to the per-day rate.
If the car is a genuine gas guzzler, then an additional environmental fee of $10/day is applied.

Browse representative natural-language statements for car-rental pricing rules. section 1.1

How Building User-Friendly DSLs covers it

How deep it goes
Defines grammar, meaning, notation, and tools, while deferring the criteria that make a language domain-specific.
Examples
Uses car-rental pricing rules for holidays, weekly rentals, and fuel consumption as concrete business-language examples.
What you can do after
Build domain-specific language tools that let business experts specify knowledge and translate it into working software.
How it connects
Connects formal languages with grammar, syntax, programming languages, modeling languages, and domain-specific languages.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.