| Crates.io | mon-core |
| lib.rs | mon-core |
| version | 0.0.3 |
| created_at | 2025-11-15 18:16:25.718891+00 |
| updated_at | 2025-11-23 01:09:29.459328+00 |
| description | A robust parser and validator for the Mycel Object Notation (MON) language, designed for fast, efficient, and human-friendly configuration. |
| homepage | https://github.com/Mycel-Lang/mon |
| repository | https://github.com/Mycel-Lang/mon-core |
| max_upload_size | |
| id | 1934636 |
| size | 359,155 |
mon-core is the reference Rust implementation of the MON (Mycel Object Notation) language — a human-focused configuration and data format designed to be readable, safe, and predictable.
This crate provides the parser, analyzer, validator, and core data model used by MON-based tooling, servers, CLIs, and compilers.
for more information please look at out website: www.mycel-lang.org
MON aims to replace overly rigid formats (JSON) and overly permissive ones (YAML) with a syntax that stays readable without giving up safety or predictability.
mon-core implements:
#struct, #enum, and validated bindingsIf you want to embed MON into your Rust application or build tooling around the language, this is the crate.
on / off as well as true / false&name, *name)...*anchor for structured overrides#struct, #enum, and :: for validationimport { A, B } from "./file.mon"import { ServerSettings } from "./schemas.mon"
{
&base: {
host: "localhost",
port: 8080,
},
User: #struct {
id(Number),
name(String),
roles([String...]),
},
admin :: User = {
id: 1,
name: "Alice",
roles: ["admin", "editor"],
},
dev: {
...*base,
port: 9001,
debug: on,
},
}
Add to Cargo.toml:
[dependencies]
mon-core = "0.1"
Parse and analyze:
use mon_core::analyze;
fn main() {
let text = r#"
settings: {
name: "Example",
enabled: on,
}
"#;
match analyze(text, "config.mon") {
Ok(result) => {
println!("JSON:\n{}", result.to_json().unwrap());
}
Err(err) => {
eprintln!("MON error:\n{err}");
}
}
}
MON is designed to fail loudly and helpfully.
Example error (format depends on your terminal capabilities):
error[E0012]: expected Number, got String
--> config.mon:7:12
|
6 | age: "twenty",
| ^^^ expected a Number here
Errors include:
Build:
cargo build
Test:
cargo test --all-features
Checks:
cargo check
The project follows standard Rust layout.
Documentation lives in docs/. Any language or spec changes must be reflected there.
Licensed under the MIT license.
See LICENSE for details.
for more information please look at out website: www.mycel-lang.org
Made with ❤️