Expand description
Vidya — programming reference library and queryable corpus
Vidya (Sanskrit: विद्या — knowledge, learning) provides a curated, tested, multi-language programming reference. Every concept includes best practices, instructional documentation, and reference implementations in multiple languages — all verified by CI.
§Architecture
Vidya has two layers:
-
Content directory (
content/) — Markdown docs and source files. No compilation needed. Humans can read it directly. AI models can train on it. The files ARE the corpus. -
Rust crate (this) — Queryable interface over the content. Types, search, comparison, and validation.
cargo docgenerates a browsable programming reference. MCP tools make it queryable by agents.
§Modules
concept— Core types:Concept,Topic,Example,BestPracticelanguage— Supported languages and their metadataregistry— In-memory concept registry, loaded from content directoryloader— Content directory loader (TOML → Registry)search— Full-text and tag-based search across conceptscompare— Side-by-side cross-language comparisonvalidate— Compile/run verification of exampleserror— Error types
§Example
use vidya::{Language, Registry};
let registry = Registry::new();
// Look up string handling in Rust
if let Some(concept) = registry.get("strings") {
println!("{}", concept.description);
if let Some(example) = concept.example(Language::Rust) {
println!("{}", example.code);
}
}Re-exports§
pub use concept::BestPractice;pub use concept::Concept;pub use concept::Example;pub use concept::Gotcha;pub use concept::PerformanceNote;pub use concept::Topic;pub use error::Result;pub use error::VidyaError;pub use language::Language;pub use registry::Registry;pub use compare::Comparison;pub use search::SearchQuery;pub use search::SearchResult;pub use validate::ValidationResult;
Modules§
- compare
- Side-by-side cross-language comparison.
- concept
- Core types for programming concepts.
- error
- Error types for vidya.
- language
- Supported programming languages and their metadata.
- loader
- Content loader — reads
content/directory into a populatedRegistry. - registry
- In-memory concept registry.
- search
- Full-text and tag-based search across concepts.
- validate
- Example validation — compile/run verification.