Skip to content

malloydata/motly

Repository files navigation

MOTLY

MOTLY is a lightweight, human-friendly configuration language. It originated as the annotation/tag language in Malloy and is becoming Malloy's configuration language. It is designed for readability: no quotes on simple strings, no commas, explicit braces instead of significant whitespace, and native types for booleans and dates.

MOTLY isn't really an acronym, but if it were, it could stand for:

  • Malloy Object Tagging Language, Yahoo!
  • More Objects Than Lines, Yippee!
  • Markup Objects Tersely, Like YAML
  • Makes Other Things Look Yucky
  • Might Overtake TOML Later, Y'know

It is spelled MOTLY (all upper case), like YAML, TOML and JSON though.

Quick Example

# Application configuration
app: {
  name = "My Application"
  version = 1.2
  debug = @false

  server: {
    host = localhost
    port = 8080
    ssl = @true
  }

  features = [logging, metrics, caching]

  scheduled_maintenance = @2024-06-15T02:00:00Z
}

Why MOTLY?

JSON YAML TOML MOTLY
Quotes on simple keys/values Required No Keys no, values yes No
Separators Commas required None None None
Nesting Braces Indentation Section headers Braces
Comments No Yes Yes Yes
Native booleans true/false Many (yes, on, ...) true/false @true/@false
Native dates No Yes (ambiguous) Yes @2024-01-15
Copy-paste safe Yes No (whitespace) Partially Yes

MOTLY uses explicit braces like JSON (no whitespace surprises like YAML) but drops the syntactic noise (no quotes on simple strings, no commas, no colons between keys and values). Booleans and dates are unambiguous with the @ prefix.

Status

MOTLY is under active development. Malloy uses the MOTLY parser for its tagged annotations.

What works today (0.1.0):

  • Full parser and interpreter (Rust and pure TypeScript, kept in sync)
  • Reference system ($root.path, $^.sibling, $^^.grandparent, $^ for parent, indexed access)
  • Clone/override patterns with := for configuration modes and inheritance
  • @malloydata/motly-ts-parser -- the TypeScript parser, published on npm with zero native dependencies

Future plans:

  • Schema validation -- validating MOTLY files against MOTLY-defined schemas
  • DOM API -- schema-driven typed access to configuration data
  • WASM backend -- the Rust parser compiled to WASM, behind the same TypeScript API

See VISION.md for more.

Documentation

Packages

  • Rust: cargo doc --open -- Rust library and CLI ( not published yet )
  • TypeScript: @malloydata/motly-ts-parser -- pure TypeScript parser (zero native deps)

The file extension is .motly.

About

MOTLY configuration language

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors