# maniospas/smoll architecture

> Architecture diagram of the GitHub repository maniospas/smoll, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maniospas/smoll
- Repository: https://github.com/maniospas/smoll

## Overview

Smoll is a small compiled language: users write `.s` programs, compile and run them with the `smoll` executable, and can use its standard library or VS Code language extension. The sampled compiler source is a partial excerpt from a single large Python file, so the compiler stages below are conceptual responsibilities rather than inspected modules. The README documents C integration and the compilation workflow; exact wiring to a native toolchain is not established by the excerpts.

Main entry points: [`smoll.py`](https://github.com/maniospas/smoll/blob/main/smoll.py) (Compiler), [`lsp/src/server.ts`](https://github.com/maniospas/smoll/blob/main/lsp/src/server.ts) (Language Server), [`std/extern.s`](https://github.com/maniospas/smoll/blob/main/std/extern.s) (Platform Adapters), [`std/extern/web.h`](https://github.com/maniospas/smoll/blob/main/std/extern/web.h) (Web Adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_language["Language Compiler"]
  node_source["Smoll Source"]
  node_compiler["Compiler<br/>[smoll.py]"]
  node_type_safety["Type &amp; Safety Analysis<br/>[smoll.py]"]
  node_lowering["Code Generation<br/>[smoll.py]"]
  node_interpreter["Interpreter<br/>[smoll.py]"]
  node_program["Compiled Program"]
end

subgraph group_stdlib["Standard Library"]
  node_stdlib_core["Core Utilities<br/>[core.s]"]
  node_stdlib_io["I/O &amp; Networking<br/>[io.s]"]
  node_stdlib_science["Scientific Tools<br/>[sci.s]"]
  node_stdlib_graphics["Graphics<br/>[graphics.s]"]
end

subgraph group_editor["Editor Support"]
  node_extension["VS Code Extension<br/>[extension.ts]"]
  node_server["Language Server<br/>[server.ts]"]
end

subgraph group_interop["Runtime Integration"]
  node_platform["Platform Adapters<br/>[extern.s]"]
  node_web_adapter["Web Adapter<br/>[web.h]"]
end

node_author(("Program Author"))
node_vscode(("VS Code User"))
node_native["Native Platform APIs"]
node_c_api["C Libraries"]

node_author -->|"writes"| node_source
node_source -->|"compiles"| node_compiler
node_compiler -->|"analyzes"| node_type_safety
node_compiler -->|"generates code"| node_lowering
node_compiler -->|"can interpret"| node_interpreter
node_lowering -->|"produces"| node_program
node_program -->|"uses"| node_stdlib_core
node_program -->|"uses"| node_stdlib_io
node_program -->|"uses"| node_stdlib_science
node_program -->|"uses"| node_stdlib_graphics
node_vscode -->|"edits Smoll"| node_extension
node_extension -->|"starts &amp; notifies"| node_server
node_server -->|"runs compiler"| node_server
node_platform -->|"wraps APIs"| node_native
node_web_adapter -->|"implements APIs"| node_native
node_platform -->|"integrates"| node_c_api
node_web_adapter -->|"integrates"| node_c_api

click node_compiler "https://github.com/maniospas/smoll/blob/main/smoll.py"
click node_type_safety "https://github.com/maniospas/smoll/blob/main/smoll.py"
click node_lowering "https://github.com/maniospas/smoll/blob/main/smoll.py"
click node_interpreter "https://github.com/maniospas/smoll/blob/main/smoll.py"
click node_stdlib_core "https://github.com/maniospas/smoll/blob/main/std/core.s"
click node_stdlib_io "https://github.com/maniospas/smoll/blob/main/std/io.s"
click node_stdlib_science "https://github.com/maniospas/smoll/blob/main/std/sci.s"
click node_stdlib_graphics "https://github.com/maniospas/smoll/blob/main/std/graphics.s"
click node_extension "https://github.com/maniospas/smoll/blob/main/lsp/src/extension.ts"
click node_server "https://github.com/maniospas/smoll/blob/main/lsp/src/server.ts"
click node_platform "https://github.com/maniospas/smoll/blob/main/std/extern.s"
click node_web_adapter "https://github.com/maniospas/smoll/blob/main/std/extern/web.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_source,node_compiler,node_type_safety,node_lowering,node_interpreter,node_program,node_vscode toneBlue
class node_stdlib_core,node_stdlib_io,node_stdlib_science,node_stdlib_graphics toneAmber
class node_extension,node_server,node_native toneMint
class node_platform,node_web_adapter toneRose
class node_author,node_c_api toneIndigo
```

## Components

### Language Compiler

- **Smoll Source**
- [Compiler](https://github.com/maniospas/smoll/blob/main/smoll.py): `smoll.py`
- [Type & Safety Analysis](https://github.com/maniospas/smoll/blob/main/smoll.py): `smoll.py`
- [Code Generation](https://github.com/maniospas/smoll/blob/main/smoll.py): `smoll.py`
- [Interpreter](https://github.com/maniospas/smoll/blob/main/smoll.py): `smoll.py`
- **Compiled Program**

### Standard Library

- [Core Utilities](https://github.com/maniospas/smoll/blob/main/std/core.s): `std/core.s`
- [I/O & Networking](https://github.com/maniospas/smoll/blob/main/std/io.s): `std/io.s`
- [Scientific Tools](https://github.com/maniospas/smoll/blob/main/std/sci.s): `std/sci.s`
- [Graphics](https://github.com/maniospas/smoll/blob/main/std/graphics.s): `std/graphics.s`

### Editor Support

- [VS Code Extension](https://github.com/maniospas/smoll/blob/main/lsp/src/extension.ts): `lsp/src/extension.ts`
- [Language Server](https://github.com/maniospas/smoll/blob/main/lsp/src/server.ts): `lsp/src/server.ts`

### Runtime Integration

- [Platform Adapters](https://github.com/maniospas/smoll/blob/main/std/extern.s): `std/extern.s`
- [Web Adapter](https://github.com/maniospas/smoll/blob/main/std/extern/web.h): `std/extern/web.h`

### Other components

- **Program Author**
- **VS Code User**
- **Native Platform APIs**
- **C Libraries**

## Connections

- Program Author → Smoll Source: writes
- Smoll Source → Compiler: compiles
- Compiler → Type & Safety Analysis: analyzes
- Compiler → Code Generation: generates code
- Compiler → Interpreter: can interpret
- Code Generation → Compiled Program: produces
- Compiled Program → Core Utilities: uses
- Compiled Program → I/O & Networking: uses
- Compiled Program → Scientific Tools: uses
- Compiled Program → Graphics: uses
- VS Code User → VS Code Extension: edits Smoll
- VS Code Extension → Language Server: starts & notifies
- Language Server → Language Server: runs compiler
- Platform Adapters → Native Platform APIs: wraps APIs
- Web Adapter → Native Platform APIs: implements APIs
- Platform Adapters → C Libraries: integrates
- Web Adapter → C Libraries: integrates
