Skip to main content

Gura

Gura is a file format for configuration files. Gura is as readable as YAML and simple as TOML. Its syntax is clear and powerful, yet familiar for YAML/TOML users.

# This is a comment in a Gura configuration file.
# Define a variable named `title` with string value "Gura Example"
title: "Gura Example"
# Define an object with fields `username` and `age`
# with string and integer values, respectively
# Indentation is used to indicate nesting
person:
username: "Stephen"
age: 20
# Define a list of values
# Line breaks are OK when inside arrays
hosts: [
"alpha",
"omega"
]
# Variables can be defined and referenced to avoid repetition
$foreground: "#FFAH84"
color_scheme:
editor: $foreground
ui: $foreground
basic: "I'm a string. "You can quote me". Name\tJos\u00E9\nLocation\tSF."
multiline_basic: """
The quick brown \
fox jumps over \
the lazy dog.
"""
literal: 'C:\Users\nodejs\templates'
multiline_literal: '''
The first newline is
trimmed in raw strings.
All other whitespace
is preserved.
'''
Read more about strings

Gura is simple and elegant

Gura was born from the need to have a configuration language that is human readable without falling into the unnecessary complexity of popular formats such as YAML.

Read more in the full specs!
Differences with YAML

Differences with YAML

YAML offered a readable alternative to JSON or INI for a configuration file. While TOML was great for basic files because of its simplicity, YAML provided a readable solution when the complexity of the file grew. However, as the NOYAML manifesto argues, we should stop supporting that format. The reason? YAML is unnecessarily complex. We highlight main issues with YAML that Gura tries to solve.

  • Multiple different ways to define a list and the elements inside it.
  • 4 (!) ways to define a boolean.
  • Boolean automatically inferred from strings (workarounds).
  • Unnecessary unquoted strings that lead to float type inference problems.
  • Serious security issues. Safe YAML attempts to address those, but only those.
  • Increadibly long YAML specs for what is supposed to be a simple configuration language?
  • Special data types such as Date or Datetime are defined in the spec, but the definition of their semantics is relegated to each specific implementation.

Differences with JSON

Differences with JSON

It's easy, JSON is and will be the fastest serialization language available. Gura is not meant for fast processing and/or machine-to-machine communication. When a readable, simple, and maintainable language is needed Gura becomes an excellent alternative.

Differences with TOML

Differences with TOML

The idea of Gura is not to replace TOML but to complement it when the complexity of the project warrants it. The use of TOML for files such as cargo.toml in the Rust programming language is an excellent example of matching the complexity of the language to that of the domain. However, when the level of nesting increases, TOML is very cumbersome since you must resort to repeating all the parent levels (using Dotted keys) every time you want to define a nested value. Furthermore, even TOML falls in some cases into the same complexity as YAML, with features such as:

  • Multiple ways to specify keys.
  • Empty keys.
  • Special data types.

Gura ⭐

Gura ⭐

Gura combines the readability of YAML and a reduced version of its syntax with the (even more simplified) simplicity of TOML. It also brings in some features and characteristics exclusive to this language:

  • 📦 Variables: Gura allows you to define variables of any type, even using environment variables,
  • both as a flat value and as values inside a string. So you can compact and reuse the values you require.
  • 📑 Imports: Gura defines a way to import different Gura files within the same file in order to
  • modularize the configuration.
  • 🚫 Standard errors: Gura defines the semantic errors that should be thrown in certain
  • situations. This way you get an implementation-agnostic definition and the developer can get the same type of error regardless of the programming language he/she is using.
  • 🥧 Gura is short and simple to learn and use since it follows the only one way to do it Python maxim.
  • 🌈 Writing a parser or wrapper for Gura in a new language should be a short and simple as well.

Simple

Simple

Gura is simple, and its "one way of doing things" philosophy minimizes the possibility of error and its implementation complexity.

Robust

Robust

Gura has no implicit mechanisms that lead to bugs, it is strongly typed and bugs are standardized to make it a robust configuration language.

Friendly

Friendly

Gura retains the best aspects of well-known languages such as TOML and YAML to make user adoption a smooth and agile process.