Skip to content

ad-si/pure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

Warning

This are just some random thoughts for a new data language. It will probably never be implemented.

Pure

The pure data language.

Spiritual successor of YAML, JSON and TOML. One file format to rule them all.

Goals

  • Simple specification
  • Only one correct way to format a file (highly whitespace sensitive)
  • Maximum space efficiency while keeping readability
  • Ability to reproduce large share of commonly used data & config files (>95%)
  • Streaming friendly (no lookback necessary => state machine)
  • Typed

Specification

  • a-zA-z - String
  • & - Boolean
  • -x - List of datatype x (if x in a-zA-z type = String)
  • = - Dictionary
  • % - Number (arbitrary precision floating point, no scientific)
  • # - Comment
  • @ - Datetime
  • - Multi line continuation
  • | - Multi line continuation with newline
  • \ - Escape first character

Reserved chars: +*^}{][/:;().,?'"

null is conveyed by a single _ as the value

Example

name Pure
version 0.1.0
description The pure data language
&private false
-tags
data
language
normalized

:competitor_map
yaml https://yaml.org
json json.org

Purex

Extension to pure. File extension: .purex

  • ! - Include path
  • ~a8 - Inline binary with a8(hex) bytes
  • $lang - Code in language lang

Related

  • cue - Data validation and configuration language
  • Dhall - Typed configuration language
  • HCL - HashiCorp configuration language
  • Jsonnet - JSON-based templating language
  • KDL - Human-readable document language
  • Nickel - Typed configuration with functions
  • RON - Rust-oriented data format
  • Starlark - Deterministic Python-like configuration language
  • TOML - Minimal human-readable config format
  • YAML - Human-readable data serialization

TODO

  • True / false key character instead of value
  • Is purex a good idea?
  • Pseudocode implementation
  • + instead of %?
  • Extra datatype for URLs?

About

The pure data language

Topics

Resources

Stars

Watchers

Forks

Contributors