Design Language
The Nonzero Sum Design Language is a way for engineers to design software with a high degree of resilience and reusability. Inspired by UML, OpenAPI, and other declarative language-agnostic systems for describing software systems, Design Language is intended to be a simple and intuitive way to document software.
The real power of Design Language comes when it is paired with tools for code generation. When thoughtfully and pragmatically applied, code generation is very useful, and its power can be seen in action with communication frameworks like gRPC or Open API. Design Language opens up the entire software stack to this level of generality and reuse.
Tools
designlanguage is a Go comandline application which generates code for designs written in the Design Language. Currently the application targets Go source code, but in the future other languages will be supported. There is also an article introducing it.
Core language elements
- Component: A computational object, which may be composed of other components.
- Interface: The "surface" of a component, by which it interacts with other components.
- Attribute: The named part of an interface designating a sub-component of the component.
- Method: A means by which a component computes. A function from some entity to some entity.
- Entity: A component with no methods, and whose attributes are all entities.
- Representation: An encoding of an entity.
Example
For example here's a partial design for the Nonzero Sum console application. With suitable code generation, this design could be rendered into an application skeleton in a number of programming languages, as well as aspects like network distribution of components and authentication.
User
Console
* Version String
* CommandHandlers []CommandHandler
CommandHandler
* Description String
* Interpet: Command String -> Response String
Browser
* GetElement: ID String -> Element