Installing YAMLScript
YAMLScript has 3 main things you might want to install:
- The
ys
compiler, loader and runner command. - The
libyamlscript.so
shared library needed by a YAMLScript loader library for your particular programming language. - A YAMLScript loader library for your particular programming language, like Python, Rust, NodeJS, etc.
NOTE: Currently when you install a YAMLScript loader library for your particular programming language you must also install the
libyamlscript
shared library of the exact same version. Fortunately this is simple.
Quick Install of ys
and libyamlscript
You can install both ys
and libyamlscript
with a single CLI command, where:
VERSION
defaults to the latest YAMLScript version.PREFIX
defaults to$HOME/.local
.LIB=1
means only install the shared library.BIN=1
means only install theys
binary.
Examples:
$ curl https://yamlscript.org/install | bash
$ curl https://yamlscript.org/install | VERSION=0.1.47 bash
$ curl https://yamlscript.org/install | VERSION=0.1.47 LIB=1 bash
$ curl https://yamlscript.org/install | PREFIX=/tmp/yamlscript bash
You'll need to have PREFIX/bin
in your PATH
. Unless you use the default PREFIX
you'll need to add PREFIX/lib
to LD_LIBRARY_PATH
and export that variable.
Temporary Test Install
If you just want to try out the ys
command but not install it permanently, you can run this (in Bash and Zsh only):
$ source <(curl https://yamlscript.org/try-ys)
This will install the ys
binary under /tmp/
and add the directory to you current shell's PATH
. It will only be available for the duration of the shell session that you run it in.
Download and Install
All the binary pre-built release files are here.
- Download the appropriate release file.
- Expand the file with
$ tar xf <release-file>
. - Use
cd
to enter the release directory. - Run
make install
ormake install PREFIX=...
.- Or just copy the binary file to the place where you want it.
Build a Release from Source
You can also easily build and install ys
and libyamlscript
from source:
- Download the "Source code" release file.
- Expand the file with
$ tar xf <release-file>
. - Use
cd
to enter the release directory. - Run
make install
ormake install PREFIX=...
.
This will take a few minutes but it requires no dependencies besides bash
, make
and curl
.
On linux it also requires the
libz-dev
package.
Install a YAMLScript Loader Library
YAMLScript loader libraries are intended to be a drop in replacement for your current YAML loader.
YAMLScript loader libraries are currently available for these programming languages:
Install the library you want using the normal library installer for your language. Then install the matching version of the libyamlscript
shared library as described above.