Sylvan

A general-purpose programming language with that aspires to have support for attribute grammars, managed effects, and efficient pure functional programming.

Miscellaneous links:

Getting Started

Note: This is a super-preliminary release; expect tons of stuff to be broken!

Currently, the best way to try Sylvan is via our dev container image. You can download or update it by running:

$ docker pull oci.sylvan-lang.org/dev:0.0.1
0.0.1: Pulling from dev
[...]
Status: Downloaded newer image for oci.sylvan-lang.org/dev:0.0.1
oci.sylvan-lang.org/dev:0.0.1

(This is an OCI image, and so should work with any other container runtime, e.g. Buildah or Podman.)

You can create a container, mount the current working directory to /code inside it, and run commands inside it with:

$ docker run --rm -itv "$(pwd):/code" oci.sylvan-lang.org/dev:0.0.1

# sylvan --help
NAME
sylvan-stage0 v0.0.1 - Sylvan stage0 interpreter

SYNOPSIS

sylvan [options...] src-dir libs-to-load... [-- main::module [args-to-main...]]

[...]

Inside the dev container, source files and libraries will be searched for inside of /code. /code is also the default working directory.

Letʼs try making and running a “Hello, world” program. Create a file in /code named hello_world.syl.

# nvim hello_world.syl

Here, we use the Neovim text editor, which is installed and configured inside the dev container to support editing Sylvan code. If you prefer a different text editor, it can be installed with apt. Otherwise, since the /code directory is mounted from the host, you can use a text editor on the host machine.

Write the following code into the file, then save and exit:

pub def main() -{ OS }> () {
perform(OS::Print("Hello, world!\n"))
}

We can load the standard library and our code to check both for errors and then run the hello_world::main function by passing them to the sylvan binary on the command line.

# sylvan std hello_world -- hello_world
Hello, world!

Project Roadmap

v0.0.2 release

v0.0.3 release

v0.0.4 release

v0.1.0 release

v0.2.0 release

v0.2.1 release

v0.2.2 release

v0.2.3 release

v0.3.0 release

v0.4.0 release

The far future

Examples