04.4 Corelib layout
Standard library packages, corelib identity, and where Beskid ships the std.
Corelib layout
Application code is yours. Corelib is the shared floor: collections, contracts, options, the stuff you should not rewrite per repo.
Identity
Section titled “Identity”Package identity is corelib (legacy standard_library paths may still be accepted by tooling). Sources live in the compiler corelib submodule / beskid_corelib/ tree with beskid_corelib/Project.proj at the separated workspace root (BESKID_CORELIB_ROOT).
Beskid standard library implementation stays Beskid source, not a side Rust crate pretending to be std.
Tooling materialization
Section titled “Tooling materialization”CLI ensures bundled corelib is available on launch; override with BESKID_CORELIB_SOURCE when hacking std. beskid dev build corelib materializes embedded templates for offline/bootstrap scenarios.
Layout mental model
Section titled “Layout mental model”Corelib splits into interlinked workspace packages, not one monolithic IO.bd dumping ground:
- Primitive types and contracts in the foundation package under
Core(includingOption<T>) - Runtime syscall-backed I/O under runtime packages; higher console work in dedicated packages (see platform core library domain)
flowchart TD accTitle: Corelib layout accDescr: Your application depends on corelib packages, which split into foundation packages, higher-level console packages and syscall-backed runtime packages. APP[Your App] --> CL[corelib packages] CL --> CT["Foundation: Option, Query"] CL --> CO[Higher-level console packages] CL --> RT["Runtime packages: syscall-backed I/O"] CO --> RT RT --> CT
Text equivalent: Your application depends on corelib packages: foundation (such as Option<T>), higher-level console packages, and runtime packages with syscall-backed I/O. The console packages build on the runtime packages, and the runtime packages build on foundation.
Docs and api.json
Section titled “Docs and api.json”Compiler doc emission can place api.json and markdown under .beskid/docs/. Registry and pckg treat structured API JSON as the primary contract. You consume std docs like any package docs, not a separate mythological website.