Language Reference
Abridged Core Edition
Myceta Language Reference
Myceta's source language is statically typed, expression-oriented, and graph-native. Named node declarations
and their dependencies define a deterministic execution DAG with tracked provenance and explicit outcome states.
1. Naming & Lexical Conventions
| Construct | Convention | Examples |
|---|---|---|
| Builtin value & container types | lowercase | i64, f64, bool, text, array<T>, vector<T>, matrix<T>, optional<T> |
| User types, traits & union cases | PascalCase | LinearMaterial, Semigroup, Ok, Err |
| Modules & physical dimensions | PascalCase | Myceta.Core.Ops, Myceta.Numerics.Linear, Length, Time |
| Functions, methods & record fields | camelCase | solveLu, elasticModulus, isOk |
| Graph nodes & scenarios | PascalCase | Origin, Deflection, HeavyWinter |
| Compiler directives | lowercase.dotted | trait.hkt, units.strict, numeric.lossy_cast_policy |
2. Auto-Imported Prelude
Every .myc module implicitly brings the core prelude traits and types into scope without boilerplate imports:
- Comparison & Identity:
Myceta.Core.Cmp(Eq,Ord,PartialOrd,Ordering),Myceta.Core.Hash(Hash),Myceta.Core.Clone(Clone,Copy). - Formatting & Conversion:
Myceta.Core.Fmt(Debug,Display),Myceta.Core.Default(Default),Myceta.Core.Convert(From,Into,TryFrom,TryInto). - Arithmetic & Containers:
Myceta.Core.Ops(Add,Sub,Mul,Div,Neg,Zero,One,Num,Float),Myceta.Core.Result(Result<T, E>),Myceta.Core.Option(optional<T>:some(v),none), andMyceta.Iter.*.
3. Traits, Derivation & Higher-Kinded Composition
trait Describable {
fn summary(self: Self) -> text
}
type SectionProfile = { designation: text; depthMm: f64 } derive(Eq, Clone, Debug)
impl Describable for SectionProfile {
fn summary(self: Self) -> text = self.designation
}
Standard algebraic hierarchies live in Myceta.Core.Algebra (Semigroup → Monoid → Group;
Semiring → Ring → Field), and opt-in higher-kinded traits (directives { trait.hkt = on })
live in Myceta.Core.Effects (Functor → Applicative → Monad, Foldable, Traversable).