Skip to content

Commit 25c9bda

Browse files
authored
Update README.md
1 parent 3127d19 commit 25c9bda

File tree

1 file changed

+8
-92
lines changed

1 file changed

+8
-92
lines changed

spectec/README.md

Lines changed: 8 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -94,42 +94,6 @@ Larger examples can be found in the [`spec`](spec) subdirectory.
9494

9595
Documentation can be found in the [`doc`](doc) subdirectory.
9696

97-
Regarding the use of the language:
98-
99-
* [Source Language](doc/Language.md)
100-
* [Latex Backend](doc/Latex.md)
101-
102-
Regarding the internal representations usable by backends:
103-
104-
* [External Language](doc/EL.md)
105-
* [Internal Language](doc/IL.md)
106-
107-
108-
## Status
109-
110-
The implementation defines two AST representations:
111-
112-
* an external language (EL), suitable for backends generating latex,
113-
* an internal language (IL), suitable for backends generating programs.
114-
115-
Currently, the implementation consists of merely the frontend, which performs:
116-
117-
* parsing,
118-
* multiplicity checking,
119-
* recursion analysis,
120-
* type checking for the EL,
121-
* elaboration from EL into IL,
122-
* splicing expressions and definitions into files.
123-
124-
Lowering from EL into IL infers additional information and makes it explicit in the representation:
125-
126-
* resolve notational overloading and mixfix applications,
127-
* resolve overloading of variant constructors and annotate them with their type,
128-
* insert injections from variant subtypes into supertypes,
129-
* insert injections from singletons into options/lists,
130-
* insert binders and types for local variables in rules and functions,
131-
* mark recursion groups and group definitions with rules, ordering everything by dependency.
132-
13397

13498
## Building
13599

@@ -177,73 +141,25 @@ To generate a specification document in Latex or Sphinx (to be built into pdf or
177141
```
178142

179143

180-
## Running Latex Backend
144+
### Building the Spec
181145

182-
The tool can splice Latex formulas generated from, or expressed in terms of, the DSL into files. For example, invoking
146+
The core spec document in this repo is build using SpecTec by default. To build:
183147
```
184-
watsup <source-files ...> -p <patch-files ...>
185-
```
186-
where `source-files` are the DSL files, and `patch-files` is a set of files to process (Latex, Sphinx, or other text formats), will splice Latex formulas or displaystyle definitions into the latter files.
187-
188-
Consider a Latex file like the following:
189-
```
190-
[...]
191-
\subsection*{Syntax}
192-
193-
@@@{syntax: numtype vectype reftype valtype resulttype}
194-
195-
@@@{syntax: instr expr}
196-
197-
198-
\subsection*{Typing @@{relation: Instr_ok}}
199-
200-
An instruction sequence @@{:instr*} is well-typed with an instruction type @@{:t_1* -> t_2*} according to the following rules:
201-
202-
@@@{rule: InstrSeq_ok/empty InstrSeq_ok/seq}
203-
204-
@@@{rule: InstrSeq_ok/weak InstrSeq_ok/frame}
205-
[...]
148+
$ cd ../document/core
149+
$ make main
206150
```
207-
The places to splice in formulas are indicated by _anchors_. For Latex, the two possible anchors are currently `@@` or `@@@`, which expand to `$...$` and `$$...$$`, respectively (for Sphinx, replace the anchor tokens with `$` and `$$`).
208-
209-
There are two forms of splices:
210-
211-
1. _expression splice_ (`@@{: exp }`): simply renders a DSL expression,
212-
2. _definition splice_ (`@@{sort: id id ...}`): inserts the named definitions or rules of the indicated sort `sort` as defined in the DSL sources.
213151

214-
See the [documentation](doc/Latex.md) for more details.
215152

153+
### Example
216154

217-
## Running Sphinx Backend (WIP)
155+
A smaller, self-contained example for a SpecTec specification, a small document with splices, and a suitable Makefile can be found in the [example](doc/example/) directory.
218156

219-
The full pdf/html document generation via Sphinx currently resides in the [`al`](https://github.com/Wasm-DSL/spectec/tree/al) branch.
220-
221-
To build both pdf and html specification document,
222-
```
223-
$ git checkout al
224-
$ make
225-
$ cd test-prose
226-
$ make all
227-
```
228-
229-
It splices Latex formulas and typesetted prose into the template `rst` document at `test-prose/doc`.
230-
Then, Sphinx builds the `rst` files into desired formats such as pdf or html.
231157

232-
233-
## Running Interpreter Backend (WIP)
158+
### Running Interpreter Backend
234159

235160
The interpreter backend can be found in the [`al`](https://github.com/Wasm-DSL/spectec/tree/al) branch at the moment.
236161

237162
To run a wast file,
238163
```
239-
$ git checkout al
240-
$ make
241-
$ ./watsup spec/* --interpreter test-interpreter/sample.wast
242-
```
243-
244-
You may also run all wast files in the directory.
245-
```
246-
$ git checkout al
247-
$ make
248-
$ ./watsup spec/* --interpreter ../test/core
164+
watsup spec/* --interpreter test-interpreter/sample.wast
249165
```

0 commit comments

Comments
 (0)