Ryan: a configuration language for the practical programmer

Overview

Crates.io PyPI NPM

Docs.rs Ryan license

Ryan: a configuration language for the practical programmer

Say hello to Ryan!
Say hello to Ryan!

Ryan is a minimal programming language that produces JSON (and therefore YAML) as output. It has builtin support for variables, imports and function calls while keeping things simple. The focus of these added features is to reduce code reuse when maintaining a sizable codebase of configuration files. It can also be used as an alternative to creating an overly complex CLI interfaces. Unsure on whether a value should be stored in a file or in an environment variable? Why not declare a huge configuration file with everything in it? You leave the users to decide where the values are coming from, giving them a versatile interface while keeping things simple on your side. Ryan makes that bridge while keeping the user's code short and maintainable.

Resources for Ryan

How to use Ryan

One-liner (Linux, MacOS)

Copy and paste the following command in your favorite console:

curl -L -Ssf "https://raw.githubusercontent.com/tokahuke/ryan/main/install/$(uname).sh" \
    | sudo sh

You will need sudo rights to run the script (this installation is system-wide).

Windows

Go to the Ryan repository and download the zipped file corresponding to Windows. Unzip it and move it to somewhere nice! Or...

Using cargo

You can run Ryan by installing the CLI from crates.io

cargo install ryan-cli

Integrate into your app!

Depending on your language, you can install a binding to Ryan from your standard package manager:

cargo install ryan          # Rust
pip install ryan-lang       # Python
npm install ryan-lang-web   # JavaScript (web)
npm install ryan-lang-node  # JavaScript (NodeJS)

Isn't this similar to X?

Yes, Ryan is a product of my frustrations with Dhall and Jsonnet. There is plenty of stuff I like and hate in both languages. Ryan is an opinionated middle term between the two, featuring:

  • A string equality comparator (yeah, that is a thing).
  • Type assertions. Ryan is not statically typed, but you can optionally annotate things to make sure that there is some type conformity.
  • Pattern matching. If you like the match statement from Python or Rust or whatever that thing is in Elixir, you will feel right at home.

Ryan key principles

It might look at first that adding one more thingamajig to your project might be overly complicated or even (God forbid!) dangerous. However, Ryan was created with your main concerns in mind and is purposefully limited in scope. Here is how you cannot code a fully functional Pacman game in Ryan:

  1. (Configurable) hermeticity: there is no print statement or any other kind side-effect to the language itself. The import system is the only way data can get into Ryan and even that can be easily disabled. Even if Ryan is not completely hermetic out-of-the-box, it can be made so in a couple of extra lines.
  2. Turing incompleteness: this has to do mainly with loops. There is no while statement and you cannot recurse in Ryan. While you can iterate through data, you can do so only in pre-approved ways. This is done in such a way that every Ryan program is guaranteed to finish executing (eventually).
  3. Immutability: everything in Ryan is immutable. Once a value is declared, it stays that way for the remaining of its existence. Of course, you can shadow a variable by re-declaring it with another value, but that will be a completely new variable.

Of course, one can reconfigure the import system to read from any arbitrary source of information and can also create native extensions to throw all these guarantees out of the window. The possibilities are infinite. However, these are the sane defaults that are offered out-of-the-box.

You might also like...
Alpha Hyprland/Hyprpaper/Hypr configuration file parser

Hyprland/Hyprpaper/Hypr configuration file parser [maintainer=@yavko]

Neovim Configuration Manager (Swap/Backup/Try Configurations Easily)
Neovim Configuration Manager (Swap/Backup/Try Configurations Easily)

ncm-rs Neovim Configuration Manager (Swap/Backup/Try Configurations Easily) I created this package because I wanted to try out Lazyvim (which is why i

Multi-source configuration library for Rust.

confik This crate provides a macro for creating configuration/settings structures and functions to read them from files and the environment. Example A

A monitor (service) for your monitor (display). Intercepts window behaviour when monitor configuration changes.

Mon-Mon A monitor (service) for your monitor (display). Listens for changes to display configuration (e.g. plugging in an additional screen) and allow

A CLI to easily switch between multiple Neovim configuration environments, written in Rust

Neovim Configuration Switcher Neovim Configuration Switcher (short nvims) is a CLI to easily switch between multiple Neovim configuration environments

The Amp programming language: a language designed for building high performance systems.

A language designed for building high performance systems. Platform Support x86_64-pc-windows ✅ x86_64-unknown-linux ⚠️ untested x86_64-unknown-darwin

An Interpreter for Brainfuck programming language implemented in the Rust programming language with zero dependencies.

Brainfuck Hello, Visitor! Hey there, welcome to my project showcase website! It's great to have you here. I hope you're ready to check out some awesom

Nexa programming language. A language for game developers by a game developer
Nexa programming language. A language for game developers by a game developer

NexaLang Nexa programming language. A language for game developers by a game developer. Features High-Level: Nexa is an easy high level language Two M

A Text User Interface library for the Rust programming language
A Text User Interface library for the Rust programming language

Cursive Cursive is a TUI (Text User Interface) library for rust. It uses ncurses by default, but other backends are available. It allows you to build

Releases(v0.2.0)
Owner
Pedro B. Arruda
T'iaimonhang!
Pedro B. Arruda
Original source code for Practical Rust Projects 2nd ed. by Shing Lyu and Andrew Rzeznik

Apress Source Code This repository accompanies Practical Rust Projects 2nd ed. by Shing Lyu and Andrew Rzeznik (Apress, 2023). Download the files as a

Apress 6 Aug 13, 2023
Rust API Server: A versatile template for building RESTful interfaces, designed for simplicity in setup and configuration using the Rust programming language.

RUST API SERVER Introduction Welcome to the Rust API Server! This server provides a simple REST interface for your applications. This README will guid

Harry Nguyen 3 Feb 25, 2024
A very opinionated, zero-configuration shell prompt

A very opinionated, zero-configuration shell prompt

amy null 8 Nov 4, 2021
Irx-config - The library provides convenient way to represent/parse configuration from different sources

The irx-config library provides convenient way to represent/parse configuration from different sources. The main goals is to be very easy to use and t

Andriy Bakay 2 Sep 14, 2022
Application microframework with command-line option parsing, configuration, error handling, logging, and shell interactions

Abscissa is a microframework for building Rust applications (either CLI tools or network/web services), aiming to provide a large number of features w

iqlusion 524 Dec 26, 2022
A command line tool for easily generating multiple versions of a configuration file from a single template

MultiConf A command line tool for easily generating multiple versions of a configuration file from a single template. Why? I'm a big fan of the i3 win

Ian Clarke 4 Dec 10, 2022
CLI application to run clang-format on a set of files specified using globs in a JSON configuration file.

run_clang_format CLI application for running clang-format for an existing .clang-format file on a set of files, specified using globs in a .json confi

martin 6 Dec 16, 2022
Set Shell Environment Variables across multiple shells with a single configuration file.

Xshe – Cross-Shell Environment Vars xshe allows for setting Shell Environment Variables across multiple shells with a single TOML configuration file.

Ethan Kinnear 9 Dec 16, 2022
CLI application to run clang-tidy on a set of files specified using globs in a JSON configuration file.

run-clang-tidy CLI application for running clang-tidy for an existing .clang-tidy file on a set of files, specified using globs in a .json configurati

martin 7 Nov 4, 2022
WIP GUI for NixOS documentation + configuration

nixos-druid Highly experimental GUI for NixOS. For now I expect to frequently make large changes and break stuff whenever I'm working on this. Screens

Sybrand Aarnoutse 6 Aug 23, 2022