Expand description
Module system — loading, caching, dependency resolution, hot-reload.
§Architecture
PackageManager
└─ ModuleRegistry
├─ Module (Unloaded / Loading / Loaded / Error)
└─ StringMapLoader / FileLoader
Namespace — hierarchical name lookup
HotReloadWatcher — timestamp-based change detectionStructs§
- HotReload
Watcher - Tracks file modification timestamps and detects changes.
Uses a
HashMap<String, u64>for timestamps (simulated or real). - Module
- A compiled and (optionally) executed script module.
- Module
Id - FNV-1a hash of a module path.
- Module
Registry - Maintains the full module graph with circular-dependency detection.
- Namespace
- Hierarchical name lookup. E.g.
math.sin→ table field. - Package
Manager - Tries multiple search paths and file suffixes when loading modules.
- String
MapLoader - Loads modules from an in-memory map of
path -> source.
Enums§
Traits§
- Module
Loader - Pluggable backend for loading module source code.