Sauce is a statically typed programming language that feels like a script.
It is built around two core ideas:
- Pipelines (
|>) are the default way data flows - Effects are explicit (
toss) instead of hidden control flow
Sauce is intentionally small.
It focuses on correctness and clarity over features.
This repository contains a full compiler pipeline written in Rust:
- lexer
- parser
- typechecker
- interpreter
- LLVM backend
As of v0.1.0, Sauce can:
- parse and typecheck real programs
- run programs using an interpreter
- compile programs to native binaries using LLVM
- handle integers and strings
- express data flow using pipelines
- represent effects explicitly (interpreter only)
Sauce is early, but it is real and working.
yell "answer is:";
yell 67;
Interpreter output:
String("answer is:")
Int(67)
LLVM-compiled output:
answer is:
67
The same program can be interpreted, typechecked, or compiled.
| Keyword | Meaning |
|---|---|
grab |
Bind a value |
yell |
Print a value |
toss |
Perform an effect |
Sauce is expression-oriented.
Supported expressions:
- integer literals (
42) - string literals (
"hello") - identifiers
- parenthesized expressions
- pipelines (
a |> b) - effect expressions (
toss effect arg)
Pipelines are the main way data flows.
a |> b
This means:
- evaluate
a - bind the result to
_ - evaluate
b
Example:
grab x = 10 |> _;
yell x;
Pipelines are left-associative:
a |> b |> c
is evaluated as:
(a |> b) |> c
The right side of a pipeline cannot be a literal. Pipelines represent computation, not value chaining.
Inside a pipeline, _ refers to the value from the left side.
grab x = 5 |> _;
Outside a pipeline, _ has no meaning.
Supported statements:
grab x = expr;
yell expr;
expr;
There is no special toss statement.
toss is just an expression.
toss represents an explicit effect.
toss network_error "timeout";
Notes:
- Effects are supported in the interpreter
- Effects are not supported in the LLVM backend yet
- Attempting to compile effects will produce a clear error
This is an intentional design boundary for v0.1.
Sauce has a small but strict type system.
Int
String
Unit
- Identifiers must be defined before use
- Types are inferred
- Pipelines propagate types from right to left
- Effects evaluate to
Unit
sauce run example.sauce
sauce check example.sauce
sauce build example.sauceLegacy flags are also supported.
Sauce v0.1.0 does not include:
- arithmetic operators
- conditionals
- loops
- functions
Because of this, algorithms like prime checking or fibonacci are not expressible yet.
This is intentional. The focus is on core semantics first.
source code
↓
Lexer (Logos)
↓
Parser (Chumsky)
↓
AST
↓
Typechecker
↓
Interpreter or LLVM backend
Each phase is explicit and separate.
Sauce v0.1.0 is an early release.
The architecture is stable, but:
- the AST may evolve
- effect handling is interpreter-only
- the LLVM backend supports a pure subset
Small, focused contributions are preferred.
Sauce is designed to be:
- small
- explicit
- pipeline-first
- effect-aware
It is built to understand how languages work, not to hide complexity.