YS (aka YAMLScript) is a functional programming language that uses YAML External link as its syntax. Its primary intent is to provide YAML with the capabilities of a general purpose programming language for all its users and use cases. YS does this in a seamless fashion, that feels like a very natural extension of the YAML you know and use today.
YS (aka YAMLScript) is a new YAML loader for 15 (and counting) programming languages:
C#, Clojure, Crystal, Go, Haskell, Java, Julia, Lua, NodeJS, Perl, PHP, Python, Raku, Ruby and Rust.
Try using YS in place of your current YAML loader!
- It's as easy to use as your current YAML loader
- Loads your existing YAML files properly
- It works the same way in every programming language
- Same API, same features, same bugs, same bug fixes
- YS has optional functional programming features
- File imports, string interpolation, standard library, etc
- Everything a compiled programming language has
How can YS offer all this?
Using YAML as the base configuration format allows me to define structured defaults that are easy to read, maintain, and version-control. Environment variables then handle dynamic values for environment-specific customisations, with custom logic to support default values for additional flexibility.
Export/Import/Edit etcd directory as JSON/YAML/TOML and validate directory using JSON schema.
Use cases
- Backup/Restore in a format which is not database or version specific.
- Migration of data from production to testing.
- Store configuration in Git and use import to populate etcd.
- Validate directory entries using JSON schema.
This section provides a quick glimpse into the expressive power of YAML. It is not expected that the first-time reader grok all of the examples. Rather, these selections are used as motivation for the remainder of the specification.
![]()
%YAML 1.2
YAML: YAML Ain't Markup Language™
![]()
YAML Resources:
YAML Specifications:
- YAML 1.2:
- Revision 1.2.2 # Oct 1, 2021 New
- Revision 1.2.1 # Oct 1, 2009
- Revision 1.2.0 # Jul 21, 2009
- YAML 1.1
- YAML 1.0
YAML (/ˈjæməl/) (see § History and name) is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Extensible Markup Language (XML) but has a minimal syntax which intentionally differs from Standard Generalized Markup Language (SGML).[1] It uses both Python-style indentation to indicate nesting, and a more compact format that uses [...] for lists and {...} for maps[1] thus JSON files are valid YAML 1.2.[2]
If you nowadays work with and on the cloud or simply *-as-Code, chances are you came into proximity of ‘Yet Another Markup Language’ (YAML). Deceptively simple in appearance, YAML provides you with a plethora of ways to shoot yourself in the foot. This talk discusses a number of common pitfalls. In a nutshell: Why YAML is not as easy as you may think.
There are two types of formats that YAML supports for strings: block scalar and flow scalar formats. (Scalars are what YAML calls basic values like numbers or strings, as opposed to complex types like arrays or objects.) Block scalars have more control over how they are interpreted, whereas flow scalars have more limited escaping support.