Using Monolith Externally

Using Monolith Externally

Internal vs External

When monolith was originally created, the intent was that the monolith binary would be run from the top-level directory, always. This can be thought of as internalusage. Things in monolith relied on this being true, such as loading scheme files from the "p" directory.

As time went on, Monolith had more utilities stapled onto itself, and using the binary anywhere became more important. This is known as external usage.

Using S9 Scheme Externally

Using the default s9 scheme interpreter externally has historically been a tricky problem, but has gotten a little bit better.

For starters, wherever you run the scheme interpreter, it must be able to find and load the image. If it can't be found, it can be generated locally using:

monolith mkimg

From there, the environment variable MONOLITH_HOME must point to the top-level directory of the monolith source code.

Then, monolith scheme programs can be run like so:

monolith -l $MONOLITH_HOME/p/monolith.scm test.scm