cympfh / cumin

Mini-Programmable Configuration Language

Home Page:https://cympfh.cc/cumin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cumin

crates.io

Cumin is a Structured, Typed and Mini-Programmable Configuration Language.

Documents

Features

  • Rust-like Syntax
  • Structured
    • struct, enum
  • Typed
    • Validated Data
  • Mini-Programmable

Language Example

struct UserRecord {
    id: Int,
    name: Option<String> = None,
    region: Region = Region::Unknown,
}

enum Region {
    Unknown,
    East,
    West,
}

[
    UserRecord(1, "cympfh", Region::East),
    UserRecord { id = 2, name = "Alan", region = Region::West, },
    UserRecord { id = 3, name = "Bob" },
    UserRecord { id = 4, region = Region::East },
]

Installation

cuminc command as a compiler

# Install from crates.io
$ cargo install cumin

# from this Repository HEAD
$ git clone https://github.com/cympfh/cumin
$ cd cumin
$ make install

wasm

This code contains wasm bind.

Python bind

See cympfh/cumin-py.

cuminc Compiler

Cumin Compiler cuminc converts to JSON from Cumin.

$ cuminc ./examples/names.cumin
[
  {
    "id": 1,
    "name": "cympfh",
    "region": "East"
  },
  {
    "id": 2,
    "name": "Alan",
    "region": "West"
  },
  {
    "id": 3,
    "name": "Bob",
    "region": "Unknown"
  },
  {
    "id": 4,
    "name": null,
    "region": "East"
  }
]

For Vim Users

Plugin 'rust-lang/rust.vim'
au BufRead,BufNewFile *.cumin set filetype=cumin
au FileType cumin set syntax=rust
ezoic increase your site revenue

About

Mini-Programmable Configuration Language

https://cympfh.cc/cumin/

License:MIT License


Languages

Language:Rust 99.1%Language:HTML 0.7%Language:Makefile 0.2%