Introducing Confetti

Confetti is a configuration language that blends the readability of Unix configuration files with the flexibility of S-expressions. It is minimalistic, untyped, and opinionated. Schema conformance is validated by the user application.

Confetti does not compete with JSON or XML, it competes with INI.

Kitchen Sink Example#

The following example uses most features of Confetti:

# This is a comment.

probe-device eth0 eth1

user * {
    login anonymous
    password "${ENV:ANONPASS}"
    machine 167.89.14.1
    proxy {
        try-ports 582 583 584
    }
}

user "Joe Williams" {
    login joe
    machine 167.89.14.1
}

Implementations#

The canonical implementation of Confetti is written in C11 and is available on GitHub.

If you would like to create your own implementation of Confetti, then review the specification and test your implementation against the official conformance test suite.

Philosophy#

Simplicity and minimalism is at the heart of Confetti. Some formats, like YAML, are very complicated (look at the size of its specification!) whereas Confetti’s spec is simple and minimal, and it can be learned in minutes.

Confetti is typeless by design and its syntax is composable. Confetti provides the atoms necessary to create everything from simple configuration, to textual file formats, to lightweight scripting. Check out the various examples for inspiration.

Other key features:

  • Opinionated: Confetti lets you define custom keywords, like on and off, and tristates, like yes, no, and maybe. This is in contrast to formats, like TOML, which mandate the keywords true and false.

  • Localization Friendly: Confetti lets you write configuration files in your native language. This is in contrast to formats, like JSON, which requires the English words null, true, and false, and Western digits 0 through 9.

  • Extensions Encouraged: Much like how Markdown has different flavors, you are encouraged to create unique flavors of Confetti. Its specification defines the common language. Its annex includes extensions known to be compatible with the grammar.

Feature Comparison#

Here’s how Confetti compares to popular formats:

Confetti INI JSON TOML

Specification

Typeless

Localization Friendly

1
2
2

Unicode Literals

1

Multiline Literals

Comments

Hierarchical Structures

Intended Use Case

Configuration

Configuration

Data Interchange

Configuration

1 INI has no specification and therefore support for internalization and Unicode are implementation dependent.

2 JSON and TOML mandate the English words true and false and Western digits 0 through 9.