Skip to content
/ ccl-rs Public

A Rust implementation of CCL (Categorical Configuration Language)

License

Notifications You must be signed in to change notification settings

hon-gyu/ccl-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ccl-rs

A Rust implementation of Categorical Configuration Language - a minimal configuration language where configs form a monoid under concatenation, parse/pretty-print operations are monoid homomorphisms (enabling provably correct parallel parsing), and together form an isomorphism (enabling lossless round-trips).

Property Definition In CCL Terms Implication
Associativity
(Semigroup)
prop-test
(a ⊕ b) ⊕ c = a ⊕ (b ⊕ c) (default + user) + project = default + (user + project) Composing multiple configs is worry-free
Left/Right Identity
(Monoid)
prop-test
empty ⊕ a = a
a ⊕ empty = a
- empty + config = config
- config + empty = config
Missing configs are valid
Monoid Homomorphism
(structure-preserving map)
f(a ⊕ b) = f(a) ⊗ f(b)
f(empty) = empty
- parse(file1 ^ file2) = parse(file1) @ parse(file2)
- parse("") = []
- pretty(list1 @ list2) = pretty(list1) ^ pretty(list2)
- pretty([]) = ""
Parallel processing; incremental updates
Monoid Isomorphism
(two-way structure preservation)
prop-test
f ∘ g = id
g ∘ f = id
- pretty(parse(config_text)) = config_text
- parse(pretty(key_vals)) = key_vals
Serialization is lossless

Usage

See CLI tests for examples

About

A Rust implementation of CCL (Categorical Configuration Language)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published