docs(design): add larger source example

This commit is contained in:
multisn8 2024-01-09 11:58:42 +01:00
parent c84a9c54fe
commit b2dd31b287
Signed by: multisamplednight
GPG key ID: C81EF9B053977241
3 changed files with 22 additions and 3 deletions

View file

@ -66,6 +66,7 @@
#let stages-overview = canvas({
nodes(
[Source],
[AST],
[Graph IR],
[Runtime],
)

View file

@ -25,9 +25,14 @@
clusters.insert(1, "\u{FEFF}")
clusters.join()
}
// TODO: could make this just look over headings in section "Execution stages" tbh
// even though it looks like this could be automated with a `query`,
// this'd require wrapping the whole document in a show rule
// at which point `query` doesn't find anything anymore
#let terms = (
"source",
"ast",
"abstract syntax tree",
"Abstract Syntax Tree",
"graph IR",
"runtime",
@ -86,7 +91,15 @@
#graphics.stages-overview
== Source
== Source <source>
```iowo
open base.png >|
open stencil.png >|
mask
|> (invert | show)
|> show
```
Functional and pipeline-based.
However, in contrast to classic shell commands,
@ -180,6 +193,10 @@ Done with any of `--` or `//`.
- Outputs of streamers are spliced into the contained list.
- In effect, they are automatically flattened.
== Abstract Syntax Tree
Essentially just the source lexed and parsed.
== Graph IR
=== Optimizer

View file

@ -38,7 +38,8 @@
)
show raw.where(block: false): box.with(
fill: luma(95%),
outset: 0.25em,
outset: (y: 0.25em),
inset: (x: 0.15em),
radius: 0.25em,
)