Building YS
Try running these commands on Linux or Mac:
git clone https://github.com/yaml/yamlscript
cd yamlscript
make install
Chances are that everything will just work.
You'll have new builds of ~/.local/ys
and ~/.local/lib/libys.so
(.dylib
on
a Mac).
YS actually has a lot of heavy dependencies like Clojure, Java, Maven, GraalVM, etc.
So how does it just work?
Today I'll tell you!
Go Ahead, make
My Day🔗
I've always been a big fan of make
.
Specifically, GNU make
.
It's always surprised me how many projects have tried to reinvent make
over
the years.
It's so capable.
You just need to actually learn it well.
The YS Makefile system is quite involved.
Every subdirectory has a Makefile, and they mostly inherit common code from a
set of common/*.mk
files:
$ ls -1 common/*.mk
common/base.mk
common/binding.mk
common/clojure.mk
common/install.mk
common/java.mk
common/native.mk
common/python.mk
common/vars-cli.mk
common/vars-core.mk
common/vars-libys.mk
common/vars.mk
common/zild.mk
But the result is fantastic.
These Makefiles install all the dependencies you need to build YS.
And they do everything inside the yamlscript/.cache
directory so you don't
have to worry about polluting your system.
Caching Large Downloads
Some of the dependencies involve rather large downloads.
If you create a ~/.cache/makes/
directory, these downloads will be cached
there forever.
This is a great way to avoid downloading the same thing over and over again. Also handy if you're working on a slow connection.
Language Dependencies🔗
YS currently supports loader bindings for 13 languages:
If you run make test
you'll see that all of these languages are tested, as
long as the Makefile can find the language's build tools on your system.
Unless you are a language nut, you probably don't have all of these installed.
As of very recently, the YS build system has been modified to install almost all of these language dependencies for you when you need them.
The currently unsupported languages for auto-install are: NodeJS
, Perl
,
Python
and Ruby
.
These languages should support auto-install soon, but they are also very common
and easy to install languages.
The "Makes" System🔗
I've been working on a new system that makes it trivial to build complex Makefiles that share almost all of the same code.
The system is called Makes
and I've been
integrating it into the YS Makefile system lately.
This system has a <name>.mk
file for every language or tool that I use it for.
You should check it out. Please send PRs to add more languages and tools!