docs: reorganize into en/ru and add English translation

This commit is contained in:
Glint Dev
2026-07-24 22:04:29 +03:00
parent 938f05f59d
commit 35f92435a3
20 changed files with 4651 additions and 0 deletions

47
docs/en/README.md Normal file
View File

@@ -0,0 +1,47 @@
# Glint Runtime — Documentation
Backend for executing compiled bytecode (.glbc) of the Glint UI framework. Loads bytecode, interprets VDOM, applies CSS-like styles, executes Rhai scripts, and renders the result via Iced (native GPU-accelerated GUI).
## Project Structure
- `src/main.rs` — entry point, CLI parsing
- `src/lib.rs` — public API of the crate
- `src/app.rs` — GlintApp: Iced application, update/view
- `src/cli.rs` — CLI commands compile/run
- `src/renderer.rs` — Iced widgets: Element → iced::Element conversion
- `src/perf.rs` — PerfScope: performance measurement by phases
- `src/interpreter/mod.rs` — Interpreter: bytecode loading, VDOM eval
- `src/interpreter/types.rs` — Element, VNode, FlatVDom, Value, InternedStr, Document
- `src/interpreter/style.rs` — StyleSheet, StyleRule, StyleIndex, StyleCache, ComputedStyle
- `src/interpreter/reactive.rs` — ReactiveTracker: dependency graph
- `src/interpreter/rhei.rs` — RheiContext: Rhai script integration
- `src/interpreter/reader.rs` — Reader: .glbc bytecode reading
- `src/interpreter/opcodes.rs` — OP_* bytecode constants
## Related Repositories
- `glt` (compiler .gltm/.glts → .glbc)
## Key Concepts
- **Document** — loaded .glbc file: Element tree, style sheet, variables
- **Element** — VDOM node: type_name, properties, children, computed_style, element_id, content_hash
- **VDOM** — virtual tree, result of bytecode interpretation
- **StyleSheet** — style sheet with indexed lookup and computed style cache
- **ReactiveTracker** — tracks element → variable dependencies, dirty_set
- **RheiContext** — compiles and executes Rhai scripts, caches AST
- **ComputedStyle** — result of applying CSS rules: ~40 fields (color, padding, font-size, etc.)
## Optimization Phases
See [ARCHITECTURE-IMPROVEMENT-PLAN.md](../ARCHITECTURE-IMPROVEMENT-PLAN.md).
**Implemented:** phases 38, 10, 9.19.2 (content_hash, stable Iced widget IDs).
**Remaining:**
| Phase | Description | Estimated Speedup |
|-------|-------------|-------------------|
| 0 | Profiling (bench, flamegraph) | — |
| 1 | Typed Values in styles instead of HashMap<String, String> | 23× |
| 2 | String interning for hot paths | 1.52× |
| 9.3 | Iced widget cache by content_hash | 1.52× (render) |