shellac

shellac is a suite of software which aims to provides OS-level process control for the Elixir language. The software is composed of two sub-projects which coordinate to accomplish this goal:

Prerequisites

You will need a Rust toolchain, which includes the build tool cargo, in order to sucesfully build this package. Please visit the Rust website for instructions on how to install these tools. This library can be built with the "stable channel" of the Rust compiler.

Getting Started

  1. Add {:lacca, "~> 0.1"} to your mix.exs file's dependencies.
  2. Run mix deps.get to download the dependency.
  3. Run mix deps.compile to verify that the package compiles sucessfully.
  4. Use the library in your program, for instance ...
{:ok, pid} = Lacca.start "echo", ["hello, world."]
Lacca.read_stdout pid
# {:ok, "hello, world.\n"}
Lacca.stop pid

Note on Native Code

This library builds a native executable which is bundled into the priv/ directory of this OTP application during the mix compile phase. To do this you must have a working Rust toolchain installed on any machine that will be compiling a project that depends on lacca. You do not need the toolchain installed on deployment targets, however when building a release, e.g: with the mix release command, you will need to ensure that the resulting binaries can be executed on the target system.

Some common gotchas include:

Protocol Versioning

The lacca and resin programs do not follow standard semantic versioning guideliens. Please read the following to understand how the project's versions are controlled. The developer's suggest pinning both a major AND minor version when using build tools which expect semantic versioning. i.e: pin to "\~> 1.3.0" rather than "\~> 1.3" in your build tool. This would allow the patch version to change, but not the major or minor version.

The version number consits of protocol, library, and patch components. Their significance to the project is as follows:

NOTE: v0 of the protocol is considered unstable. For best results you should always build and deploy the v0 programs together.

Protocol Format

shellac v0 packets are sent on the wire as follows:

Packet Types

Packet types are as follows:

TBD

  1. Start Process (exec: string, args: [string]])
  2. Stop Process ()
  3. DataOut (ty: (Stdout | Stderr), buf: [u8])
  4. DataIn (buf: [u8])

Future Additions

Lacca Design

When the lacca application starts it will kick off a supervision process. To start an OS-level process lacca will perform the following initialization sequence:

TODO