#configuration-language #peg #pest #wasm

libcorn

Parsing engine for Corn, a simple and pain-free configuration language

11 releases (6 breaking)

0.10.1 Jan 23, 2026
0.10.0 Aug 23, 2024
0.9.2 Sep 14, 2023
0.8.0 Jun 18, 2023
0.6.0 Nov 28, 2022

#115 in Configuration

Download history 161/week @ 2025-12-30 153/week @ 2026-01-06 136/week @ 2026-01-13 289/week @ 2026-01-20 231/week @ 2026-01-27 229/week @ 2026-02-03 187/week @ 2026-02-10 201/week @ 2026-02-17 170/week @ 2026-02-24 218/week @ 2026-03-03 287/week @ 2026-03-10 249/week @ 2026-03-17 233/week @ 2026-03-24 272/week @ 2026-03-31 213/week @ 2026-04-07 188/week @ 2026-04-14

993 downloads per month
Used in 10 crates (8 directly)

MIT license

55KB
1K SLoC

🌽 Corn

A simple and pain-free configuration language.

Corn has been designed using inspiration from JSON and Nix to produce a language that's easy and intuitive to write, good for config files, and has a feature-set small enough you can learn it in minutes. It was born out of the following frustrations:

  • JSON is not a config language, despite how often people use it as one.
  • TOML is good for flat structures but gets ugly quickly with deeper objects.
  • YAML is far too complex and its whitespace rules make it error-prone.
  • Nix is a full-sized language and not easy to integrate.


let {
    $entry = "dist/index.js"
    $author = { name = "John Smith" email = "mail@example.com" }
} in {
    name = "example-package"
    version = "1.0.0"
    main = $entry
    bin.filebrowser = $entry
    private = false

    author = $author
    author.url = "https://example.com"

    contributors = [ $author ]

    scripts.build = "tsc"
    scripts.run = "node dist"

    dependencies = {
        dotenv = "^8.2.0"
        // put the rest of your deps here...
    }

    devDependencies.typescript = "^4.5"

    config.port = 8080
    config.hostname = null
}

Corn is available as libraries for Rust, Go, Lua, and JavaScript (via WASM).
A CLI and web API are also available.

Editor plugins are available for JetBrains IDEs, VS Code and Neovim.

Dependencies

~2.7–9MB
~162K SLoC