[ANN] CCL: Categorical Configuration Language

Hi everyone :wave:

For the last month, I’ve been working on a hobby project, shaping years of my ideas into the implementation of minimalistic config language ccl: Categorical Configuration Language.

You can read the motivation and a tutorial in my latest article:

I implemented CCL in OCaml using angstrom. The source code is here:

9 Likes

I suspect most configuration languages start simple and start going down a slippery slope where they first add different value types, aggregate values like arrays or tables, next conditionals, and finally name spaces and maybe functions - at which point you have a language like Lua. The counter examples provided all show formats that evolved already and not when they started out; so I am a bit surprised about the confidence expressed here this being enough and most elegant.

1 Like

Hey @lindig,

Thanks for reading the article and sharing your feedback!

I understand your skeptiticism. For software, it’s quite natural to start small and evolve over time.

However, the main goal for CCL is to keep it minimalistic. In terms of user-facing syntax, CCL is done. I don’t plan to evolve it anymore.

1 Like

Hey @chshersh I don’t know that I’ll be able to provide you with actual feedback, just wanted to mention as I started reading the post, it got me quite a few laughs, and it brightens my day. :laughing: Thanks for the link!

3 Likes

yep, this this~ I think if you look at the first version of most configuration languages you’ll find they also started with the lofty goals of simple key-value pairs (YAML, TOML come to mind). Then, as adoption grew, and people began integrating and adding their own extensions, eventually the language designers had to standardise and incorporate these complexities to keep their language usable and we are left with the current state of affairs.

Reminds me a bit of that old XKCD comic~

If we do not learn from history, I suppose we are doomed to repeat it!

(edit: of course, not to rally against noble efforts to try and improve the state of the art, but it does feel a little shortsighted to not consider that prior configuration languages had also sought for simplicity and to look at the reasons that lead them astray~)

2 Likes

I’m not sure they strived for simplicity if they decided to add more features. And that’s totally fine! Sometimes you want more features.

The goal for CCL is avoid getting complex. If it adds more features, I’d consider this a failure.

I think this comic it the most misunderstood and wrongly quoted comic of the internet. I really wish people would stop referring to it. @chshersh doesn’t want to define a new standard, he wants to define his own configuration language by investigating minimalistic design principles. That’s fine.

Perhaps one sentence that people missed from the article is:

My goal is not to make everyone use this new language. What I want is to inspire you.

I liked the exposition of the design thinking that went behind it, the minimalism and do find it truly elegant. Now elegance is not necessarily a match for usability[1].


  1. For example user defined key override behaviour (“You’re the boss”), just… don’t :–) ↩︎

9 Likes

I think you may have to introduce document normalization at:

let cat ccl1 ccl2 = ccl1 ^ "\n" ^ String.trim ccl2

If, for example, ccl2 had its first line incorrectly indented … ccl2 would be an unparsable document on its own. But concatenating with cat ccl1 ccl2 would make a valid document.

(If you don’t like normalization, then fuzzing/etc. testing can be used since we shouldn’t trust user’s configuration files.)

Also, it would be nice to be explicit that there is a UTF-8 encoding (or else concatenation does not make much sense) and be explicit what is meant by trimming (will it remove control characters like backspace characters?).

Overall it seems quite interesting.

1 Like

A pedantic remark about Pedantic Alert #2. You have this bit of psedo-code, I assume.

let cat ccl1 ccl2 = ccl1 ^ "\n" ^ String.trim ccl2

I think it should be

let cat ccl1 ccl2 = String.trim ccl1  ^ "\n" String.trim ccl2

And it should be probably Ccl.trim which remove the the first line indentation from all lines.

Otherwise, I like it and I’m even lazily considering using it for generating XML.

1 Like

Shouldn’t it be

let cat ccl1 ccl2 = String.trim ccl1 ^ "\n" ^ String.trim ccl2 

instead then?

Yes. But re-reading the spec, it looks like only the second trim is required