Skip to main content
In development

Getting Started with Sarlin

Create a project, check it, compile it to a native executable, and run it.

1. Install the compiler

Sarlin ships as a prebuilt binary. The compiler is developed in a private repository, so there is nothing to check out and nothing to build: you download the release for your platform from GitHub Releases and put it on your PATH. Released binaries are dual licensed under MIT OR Apache-2.0.

One other tool is needed:

  • clang 15 or newer, which the compiler calls to turn its LLVM output into a native executable. Programs will not build without it.

Version 0.1.0

2026-09-06

Download the matching .sha256 file from the release page and verify the archive before extracting it:

shell
sha256sum --check sarlin-linux-x86_64.tar.gz.sha256

For the Linux x86_64 release, unpack the downloaded archive:

shell
tar -xzf sarlin-linux-x86_64.tar.gz

Then move the sarlin binary somewhere on your PATH and confirm it runs:

shell
sudo mv sarlin /usr/local/bin/sarlin
sarlin --version
output
sarlin 0.1.0

2. Create a project

shell
sarlin new "My Project"
output
created Sarlin project: my_project

The project name is turned into a lower case folder name, so "My Project" becomes my_project. You get this layout:

my_project
my_project/
    sarlin.project
    .gitignore
    source/
        main.sar
    output/

sarlin.project marks the project root and describes it:

sarlin.project
name: My Project
entry: source/main.sar
language: 1

name and entry are required. The entry must name one of the .sar files under source/. The optional language setting is a whole-number compatibility version; 0.1.0 supports language version 1 and rejects projects asking for a newer one. Blank lines and lines beginning with # are ignored.

Every .sar file under source/ is part of the project, including files in subfolders. Compiled executables go to output/, which the generated .gitignore excludes.

3. The program

source/main.sar starts as this:

source/main.sar
func main() {
    print("Hello from Sarlin")
}
  • func declares a function.
  • main is the program entry point.
  • Braces explicitly define the block.
  • print outputs text.
  • Statements do not need semicolons.

4. Check your code

Running sarlin against a project checks it without compiling anything:

shell
sarlin my_project
output
checked 0 define(s), 0 class(es), and 1 top-level function(s)

Errors are reported as file:line:column: error: message. This is the fast loop to stay in while writing code, since it skips the native build entirely.

5. Build and run

Adding build compiles the project to a native executable through LLVM and clang:

shell
sarlin build my_project
output
built native executable: my_project/output/my_project

Then run it directly. There is no separate run command:

shell
./my_project/output/my_project
output
Hello from Sarlin

6. Where to go next