%%{init: {'theme': 'base', 'themeVariables': {'fontSize': '20px', 'edgeLabelBackground': 'transparent'}, 'flowchart': {'rankSpacing': 20, 'nodeSpacing': 20, 'padding': 0}}}%%
graph LR
SRC["*.spy source"]
MOD["Untyped AST<br/>+ symtable<br/>+ modules"]
RED["Typed AST<br/>(Redshifted)"]
C["C source (.c)"]
OUT1(["output"])
OUT2(["output"])
NAT["native exe"]
WASI["WASI exe"]
EM["Emscripten"]
OUT3(["output"])
SRC -->|parse<br/>+ scope analysis<br/>+ import| MOD
MOD -->|redshift<br/>+ type checking| RED
MOD -->|interp.| OUT1
RED -->|interp.| OUT2
RED -->|cwrite| C
C -->|cc| NAT
C -->|cc| WASI
C -->|cc| EM
NAT --> OUT3
WASI --> OUT3
EM --> OUT3
classDef output fill:#1D9E75,stroke:#0F6E56,color:#E1F5EE
classDef exe fill:#BA7517,stroke:#854F0B,color:#FAEEDA
classDef src fill:#534AB7,stroke:#3C3489,color:#EEEDFE
classDef ast fill:#185FA5,stroke:#0C447C,color:#E6F1FB
classDef c fill:#993556,stroke:#72243E,color:#FBEAF0
class OUT1,OUT2,OUT3 output
class NAT,WASI,EM exe
class SRC src
class MOD,RED ast
class C c


