yamlscript  by yaml

Programming language for YAML data manipulation and dynamic execution

Created 3 years ago
599 stars

Top 54.5% on SourcePulse

GitHubView on GitHub
Project Summary

Programming in YAML (YS) is a novel approach that embeds a functional programming language within YAML files, allowing for dynamic data processing, transformation, and complex logic directly in configuration or data files. It targets developers who need more than static YAML parsing, offering a consistent and powerful YAML processing solution across 15+ programming languages with a unified syntax and feature set.

How It Works

YS processes YAML by first loading it into a Lisp Abstract Syntax Tree (AST) rather than directly into native data structures. This AST is then rendered into Clojure code and evaluated by a full-featured runtime. This AST-centric design enables YS to support advanced features like file imports, string interpolation, and a standard library, effectively treating YAML as a programming language. While Clojure is used internally, YS compiles to a native binary and shared library, eliminating the need for JVM or JavaScript runtimes for its core functionality.

Quick Start & Requirements

  • Primary install command: curl https://yamlscript.org/install | bash
  • Non-default prerequisites: The build process requires various programming languages.
  • Links:
    • Installation details: https://yamlscript.org/install
    • Documentation: Mentioned as YS Documentation (URL not provided)
    • Learning: Learn YS at Exercism

Highlighted Details

  • Universal YAML Loader: Acts as a YAML loader for C#, Clojure, Crystal, Go, Haskell, Java, Julia, Lua, NodeJS, Perl, PHP, Python, Raku, Ruby, and Rust, offering consistent behavior across languages.
  • Dynamic YAML Logic: Allows embedding executable code within YAML files using the !ys-0 tag for dynamic data generation, calculations, and transformations.
  • Powerful Data Manipulation: Provides a CLI tool (ys) and libraries for querying, manipulating, and transforming YAML and JSON into various formats (YAML, JSON, CSV, TSV, EDN).
  • External Data Integration: Can incorporate data from files, web APIs, databases, and shell commands directly into YAML structures.
  • Claude Code Plugin: An official plugin is available to enable Claude AI to write idiomatic YAMLScript.

Maintenance & Community

The project is led by Ingy döt Net, with contributions from Ven de Thiel, Delon R.Newman, Josephine Pfeiffer, Andrew Pam, Kenta Murata, José Joaquín Atria, tony-o, and Ethiraric. Resources include YS Documentation, YS Blog, and examples on RosettaCode.org.

Licensing & Compatibility

Licensed under the permissive MIT (X11) License, allowing for commercial use and integration into closed-source projects. It is 100% compatible with existing YAML files.

Limitations & Caveats

Current native compilation via GraalVM limits supported operating systems to Linux, macOS, and (upcoming) Windows, and architectures to x86_64 and aarch64. Efforts are underway to support alternative runtimes like JVM, JavaScript, and WebAssembly to broaden compatibility.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
6 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.