Arrowgrams
Overview
Arrowgrams is a diagram transpiler.
A diagram is drawn using Draw.io then,
- transpiled into a JSON graph
- run as an app.
Arrowgrams diagrams are box-and-arrow diagrams that use a small subset of SVG. The diagrams are exported to SVG format.
An example diagram can be found in
helloworld.
This essay is intended to document the rewrite of the type transpiler using the SCN Workbench. I skip (elide) the details of the Arrowgrams system.
The type transpiler is used for building the Arrowgrams runtime.
I will drill down into the runtime (only) in this essay:
Layer 1
The runtime consists of two portions
- code that was written manually
- code that was generated automatically.
ESA means “encapsulated software assets”, i.e. software components.
An ESA is either
- a leaf node consisting of code (in some language)
- a recursive graph of ESA components.
In the current version of Arrowgrams, ESA leaves are written in CL (Common Lisp) and recursive graphs are saved as JSON files.
Layer 2
The automatically generated code portion of the runtime is transpiled using
- A specification of the runtime, esa.dasl
- A specification of the types used within the runtime exprtypes.dsl
This note drills down onto (2) exprtypes.dsl and shows how to replace it using the SCN workbench
Layer 3
The exprtypes transpiler is built using
- A type specification
- A pipeline of 4 passes of code (written in PASM)
- A tree walker.
Types
The type system used by the transpiler is written as a specification exprtypes.dsl.
The type specification produces two files
The JSON file is used to initialized the runtime system, while the lisp file is used as part of the code.
ASC Example
An alternate version of the type transpiler is found in exprtypeslisp.html.
The type specification (aka a type SCN, aka a type DSL) is discussed elsewhere.