Sterling is a system for specifying extensible languages built by independently-developed modules. Modules may introduce syntactic categories and constructors for them, as well as judgments and inference rules defining them. Extensions to a module can add new constructors to existing syntactic categories and new rules defining existing judgments, as well as introducing its own syntactic categories and judgments. The normal arrangement of modules is a single host language module with extensions adding to it. A composed language may be built from any number of modules by combining the separate specifications.
When extensions introduce judgments over syntactic categories given by modules on which they build, they cannot introduce rules directly for syntax constructors given by other extensions because the other extensions are unknown to the extension introducing the judgment. Sterling handles this by having the extension introducing a relation define a default rule that will be instantiated for constructors from other extensions in the language composition. This rule may use a projection, defined by the extension introducing a constructor, to define the new relation; this is similar to forwarding in attribute grammars.
For more information on our view of extensible languages, see this document.
There are two ways to get Sterling:
./install
.
build
script, then the install
script. Building will
require installing
the Silver attribute
grammar system first. Sterling can also be built from
the downloaded tarball.
Sterling has been tested only on Linux, but may run on Mac OS or on the Windows Subsystem for Linux (WSL) if Abella can be installed. No operating systems have been tested to be ruled out.
While Sterling is designed to permit a number of uses, its primary use, and the one for which it is currently best engineered, is as a specification language for proving properties of extensible languages using Extensibella. Extensibella reasons about extensible languages such that proofs of properties, even those introduced by extensions, written in the context of individual modules guarantee the properties hold for any composed language as well.
Sterling is implemented in Silver, a system for writing extensible languages using attribute grammars. The name "Sterling" is a play on "Silver", as in sterling silver. Sterling silver is also why the logo is a silver spoon.