{"id":13561094,"url":"https://github.com/yaml/yamlscript","last_synced_at":"2025-05-14T14:09:50.813Z","repository":{"id":45402045,"uuid":"510139682","full_name":"yaml/yamlscript","owner":"yaml","description":"Programming in YAML","archived":false,"fork":false,"pushed_at":"2025-04-09T22:05:44.000Z","size":18728,"stargazers_count":461,"open_issues_count":16,"forks_count":44,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-13T13:13:37.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaml.png","metadata":{"files":{"readme":"ReadMe.md","changelog":"Changes","contributing":"Contributing.md","funding":null,"license":"License","code_of_conduct":".github/Code-of-Conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-03T21:31:31.000Z","updated_at":"2025-04-12T22:17:13.000Z","dependencies_parsed_at":"2024-02-12T05:25:16.256Z","dependency_job_id":"848c2164-df8f-4bfb-b5c6-8ed4c89b811a","html_url":"https://github.com/yaml/yamlscript","commit_stats":{"total_commits":853,"total_committers":13,"mean_commits":65.61538461538461,"dds":0.05392731535756157,"last_synced_commit":"b00b86c41aae7e17501183dde42110112dde52a4"},"previous_names":["ingydotnet/yamlscript"],"tags_count":125,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaml","download_url":"https://codeload.github.com/yaml/yamlscript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254160536,"owners_count":22024571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-08-01T13:00:52.448Z","updated_at":"2025-05-14T14:09:45.789Z","avatar_url":"https://github.com/yaml.png","language":"Clojure","readme":"YS / YAMLScript\n===============\n\nProgram in YAML — Code is Data\n\n\n## About YS\n\n\u003e See https://yamlscript.org for the most/latest/best information about YS.\n\nYS is a functional programming language with a stylized YAML syntax.\n\nYS can be used for:\n\n* Extending YAML config files with functional transformations, external data\n  access, string interpolation; anything a programming language has access to\n* Writing new programs, applications, automation scripts\n  * Run with `ys file.ys`\n  * Or compile to binary with `ys -C file.ys`\n* Writing reusable shared libraries\n  * Bindable to almost any programming language\n* As a YAML loader module in many programming languages\n  * Load plain / existing YAML (or JSON) files\n  * Load YAML files with embedded YS functionality\n\nMost existing YAML files in the wild are already valid YS.\n\n\u003e YS is now an official language on the [Exercism](\n  https://exercism.org/tracks) (free) language learning site!\n  It's a great way to learn how to program in YS.\n\n\n### Run or Load?\n\nYS programs can either be \"run\" or \"loaded\".\nWhen a YS program is run, it is executed as a normal program.\nWhen a YS program is loaded, it evaluates to a JSON-model data structure.\n\nIf you have a valid YAML ([1.2 Core Schema](\nhttps://yaml.org/spec/1.2.2/#103-core-schema)) file that doesn't use custom\ntags, and loads to a value expressible in JSON, then it is a valid YS program.\nThe YS `load` operation will evaluate that file exactly the same in any\nprogramming language / environment.\n\nThese existing YAML files obviously can't use the YS functional programming\nfeatures since that would be ambiguous.\nFor example, what is the JSON value when \"loading\" this YS program?\n\n```yaml\nfoo: inc(41)\n```\n\nIs it `{\"foo\": \"inc(41)\"}` or `{\"foo\": 42}`?\n\nYS programs must start with a special YAML tag `!YS-v0` to indicate\nthat they have functional capabilities.\n\n```yaml\n!YS-v0:\nfoo:: inc(41)\n```\n\n\u003e Note: The `-v0` in the tag indicates the YS API version.\nThis is so that future versions of YS can run programs written to an older API\nversion, and also so that older versions of YS don't try to run programs\nwritten to a newer API version.\n\n\n### Using YS\n\nThere are two primary ways to use YS:\n\n* Using the `ys` command line runner / loader / compiler / installer\n* Using a YS library in your own programming language\n\nThe `ys` command line tool is the easiest way to get started with YS.\nIt has these main modes of operation:\n\n* `ys \u003cfile\u003e` - Run a YS program\n* `ys --load \u003cfile\u003e` - Load a YS program\n* `ys --compile \u003cfile\u003e` - Compile a YS program to Clojure\n* `ys --binary \u003cfile\u003e` - Compile YS to a native binary executable\n* `ys --eval '\u003cexpr\u003e'` - Evaluate a YS expression string\n* `ys --install` - Install the latest libyamlscript shared library\n* `ys --upgrade` - Upgrade ys and libyamlscript\n* `ys --help` - Show the `ys` command help\n\nYou can also use YS as a library in your own programming language.\nFor example, in Python you can use the `yamlscript` module like this:\n\n```python\nimport yamlscript\nys = yamlscript.YAMLScript()\ntext = open(\"foo.yaml\").read()\ndata = ys.load(text)\n```\n\n\n### Supported Operating Systems\n\nYS is supported on these operating systems:\n\n* Linux\n* macOS\n* Windows  (work in progress)\n\nYS is supported on these architectures:\n\n* Intel/AMD (`x86_64`)\n* ARM (`aarch64`)\n\nFor now other systems cannot be supported because `ys` and `libyamlscript` are\ncompiled by GraalVM's `native-image` tool, which only supports the above\nsystems.\n\n\n### Supported Programming Language Bindings\n\nYS wants to be the best YAML loader for both static and dynamic YAML usage in\nevery programming language where YAML is used.\n\nIt will have the same API, same features, same bugs and same bug fixes in every\nlanguage, giving you a great and consistent YAML experience everywhere.\n\nAt this early stage, YS has bindings for these programming languages:\n\n* [Clojure](https://clojars.org/org.yamlscript/clj-yamlscript)\n* [Go](https://github.com/yaml/yamlscript-go),\n* [Java](https://clojars.org/org.yamlscript/yamlscript)\n* [Julia](https://juliahub.com/ui/Packages/General/YAMLScript)\n* [NodeJS](https://www.npmjs.com/package/@yaml/yamlscript)\n* [Perl](https://metacpan.org/pod/YAMLScript)\n* [Python](https://pypi.org/project/yamlscript/)\n* [Raku](https://raku.land/zef:ingy/YAMLScript)\n* [Ruby](https://rubygems.org/gems/yamlscript)\n* [Rust](https://crates.io/crates/yamlscript)\n\n\n### Is YS a Lisp?\n\nEven though YS often has the look of an imperative programming language, it\nactually is just a (YAML based) syntax that *compiles* to\n[Clojure](https://clojure.org/) code.\nThe resulting Clojure code is then run by a native-machine-code Clojure runtime\ncalled [Small Clojure Interpreter (SCI)](https://github.com/babashka/sci).\n\nClojure is a functional programming language with its own Lisp syntax.\nTherefore it is fair to say that YS is a (functional) Lisp, even though it\ncommonly doesn't look like one syntactically.\n\nTypically Clojure produces Java bytecode that is run on the JVM, but for YS\nthere is no Java or JVM involved.\nIn testing so far, YS programs tend to run as fast or faster than\nequivalent Perl or Python programs.\n\nFor getting started with YS, you don't need to know anything about Lisp or\nClojure.\nYou can use it with as much or as little Lisp-ness as you want; the\nsyntax is quite flexible (*and even programmable!*).\nAs your YS programming requirements grow, you can rest assured that you have\nthe full power of Clojure at your disposal.\n\n\n## Try the YS `ys` Command\n\nYou can try out the latest version of the `ys` command without actually\n\"installing\" it.\n\nIf you run this command in Bash or Zsh:\n\n```\n. \u003c(curl https://yamlscript.org/try-ys)\n```\n\nit will install the `ys` command in a temporary directory (under `/tmp/`) and\nthen add the directory to your current `PATH` shell variable.\n\nThis will allow you to try the `ys` command in your current shell only.\nNo other present or future shell session will be affected.\n\nTry it out!\n\n\n## Installing YS\n\nYou can install the YS `ys` interpreter and/or its `libyamlscript.so` shared\nlibrary from pre-built binaries or building from source.\nBoth are very easy to do.\n\n\n### Installing YS Pre-built Binary Releases\n\nYS ships pre-built binaries for each release version [here](\nhttps://github.com/yaml/yamlscript/releases).\n\nTo install a latest release for your machine platform, try:\n\n```bash\ncurl https://yamlscript.org/install | bash\n```\n\nMake sure `~/.local/bin` is in your `PATH` environment variable.\n\nYou can use the following environment variables to control the installation:\n\n* `PREFIX=...` - The directory to install to. Default: `~/.local`\n* `VERSION=...` - The YS version to install. Default: `0.1.95`\n* `BIN=1` - Only install the `PREFIX/bin/ys` command line tool.\n* `LIB=1` - Only install the `PREFIX/lib/libyamlscript` shared library.\n* `DEBUG=1` - Print the Bash commands that are being run.\n\nOnce you have installed the `ys` command you can upgrade to a bin binary\nversion with `ys --upgrade`.\n\n\n### Installing YS from Source\n\nThis is very easy to build and install YS from its source code because the YS\nbuild process has very few dependencies:\n\n* `bash` (your interactive shell can be any shell)\n* `curl`\n* `git`\n* `make`\n\nTo install the `ys` command line tool, and `libyamlscript` shared library,\nrun these commands:\n\n```bash\ngit clone https://github.com/yaml/yamlscript\ncd yamlscript\nmake build\nmake install\n```\n\nThat's it!\n\nThe `make install` command will install `ys` and `libyamlscript` to\n`~/.local/bin` and `~/.local/lib` respectively, by default.\nIf run as root they will default to `/usr/local/bin` and `/usr/local/lib`.\n\nTo install to a different location, run `make install PREFIX=/some/path`.\n\n\u003e Notes:\n\u003e * `make install` triggers a `make build` if needed, but...\n\u003e * You need to run `make build` not as root\n\u003e * The build can take several minutes (`native-image` is slow)\n\u003e * If you install to a custom location, you will need to add that location to\n\u003e   your `PATH` and `LD_LIBRARY_PATH` environment variables\n\n\n### Installing a YS Binding for a Programming Language\n\nYS ships its language binding libraries and the `libyamlscript.so` shared\nlibrary separately.\n\nCurrently, each binding release version requires an exact version of the shared\nlibrary, or it will not work.\nThat's because the YS language is still evolving quickly.\n\nThe best way to install a binding library is to use your programming language's\npackage manager to install the latest binding version, and the YS installer to\ninstall the latest shared library version.\n\nSo for Python you would:\n\n```bash\npip install yamlscript\nys --install\n```\n\nThe Perl installation process can automatically install the shared library, so\nyou can just do:\n\n```bash\ncpanm YAMLScript\n```\n\n\n## The YS Repository\n\nThe [YS source code repository](https://github.com/yaml/yamlscript)\nis a mono-repo containing:\n\n* The YS compiler code\n* The YS shared library code\n* A YS binding module for each programming language\n* The YS test suite\n* The YS documentation\n* The yamlscript.org website (with docs, blog, wiki, etc)\n\n\n### `make` It So\n\nThe YS repository uses a `Makefile` system to build, test and install its\nvarious offerings.\nThere is a top level `Makefile` and each repo subdirectory has its own\n`Makefile`.\nWhen run at the top level, many `make` targets like `test`, `build`, `install`,\n`clean`, `distclean`, etc will invoke that target in each relevant subdirectory.\n\nGiven that this repository has so few dependencies, you should be able to clone\nit and run `make` targets (try `make test`) without any problems.\n\n\n### Contributing to YS\n\nTo ensure that YS libraries work the same across all languages, this project\naims to have a binding implementation for each programming language.\n\nIf you would like to contribute a new YS binding for a programming language,\nyou are encouraged to\n[submit a pull request](https://github.com/yaml/yamlscript/pulls) to this\nrepository.\n\nSee the YS [Contributing Guide](\nhttps://github.com/yaml/yamlscript/tree/main/Contributing.md) for more details.\n\n\n## YS Resources\n\n* [YS Documentation](https://yamlscript.org/doc/)\n* [YS Blog](https://yamlscript.org/blog/)\n* [Learn YS at Exercism](http://exercism.org/tracks/yamlscript)\n* [Example YS Programs on RosettaCode.org](\n  https://rosettacode.org/wiki/Category:YAMLScript)\n\n\n## Authors\n\n* [Ingy döt Net](https://github.com/ingydotnet) - Creator / Lead\n* [Ven de Thiel](https://github.com/vendethiel) - Language design\n* [tony-o](https://github.com/tony-o) - Raku binding\n* [Ethiraric](https://github.com/Ethiraric) - Rust binding\n* [José Joaquín Atria](https://github.com/jjatria) - Perl binding\n* [Delon R.Newman](https://github.com/delonnewman) - Clojure, Java, Ruby bindings\n* [Andrew Pam](https://github.com/xanni) - Go binding\n* [Kenta Murata](https://github.com/mrkn) - Julia binding\n\n\n## Copyright and License\n\nCopyright 2022-2025 by Ingy döt Net\n\nThis is free software, licensed under:\n\nThe MIT (X11) License\n","funding_links":[],"categories":["others","Clojure","hacktoberfest","Configuration Management","\u003ca name=\"Clojure\"\u003e\u003c/a\u003eClojure"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaml%2Fyamlscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaml%2Fyamlscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaml%2Fyamlscript/lists"}