Docs rewrite

This commit is contained in:
2026-07-03 10:23:45 +02:00
parent 6cda69044a
commit ec857525b4
23 changed files with 1084 additions and 1134 deletions
+48
View File
@@ -0,0 +1,48 @@
---
title: Compiler Architecture
description: High-level pipeline overview of the Mist compiler and crate organization.
icon: Building2
---
### Pipeline Overview
The Mist compiler operates in distinct phases:
```
Source (.mist)
│
▼
┌─────────────┐
│ Lexer │ (pest PEG grammar)
│ & Parser │
└─────────────┘
│ AST
▼
┌─────────────┐
│ Semantics │ (field init checking)
└─────────────┘
│
▼
┌─────────────┐
│ Codegen │ (AST → Rust source)
└─────────────┘
│ .rs + .map.json
▼
┌─────────────┐
│ cargo │ (Rust compilation)
└─────────────┘
│
▼
Binary / Library
```
### Crate Organization
The compiler is written in Rust and Mist itself, organized into four main crates:
| Crate | Language | Role |
|-------|----------|------|
| **mist-parser** | Rust | PEG parsing via pest, AST construction, semantic checks, position mapping |
| **mist-codegen** | Rust | AST → Rust source code generation |
| **mist-analyzer** | Rust | Language server bridging mist-editor ↔ rust-analyzer |
| **mist-api** | Mist | Orchestrates transpilation, module tree building, cargo invocation, error remapping |