Tide is a small, experimental programming language (implemented in C) with a REPL, pattern-matching relations, and a simple query syntax.
This repo currently builds a single executable: tide.
curl -fsSL https://raw.githubusercontent.com/stanislas7/tide/main/install.sh | shBy default this installs tide into ~/.local/bin.
Install system-wide (requires sudo):
curl -fsSL https://raw.githubusercontent.com/stanislas7/tide/main/install.sh | sh -s -- --systemmake./bin/tide./bin/tide examples/basics.tideTide ignores a leading shebang line, so you can make a .tide file directly executable:
#!/usr/bin/env tide
query double(5)
Then:
chmod +x script.tide
./script.tideOr using the Makefile helper:
make exec FILE=examples/basics.tidemake test--test runs every *.tide file in ./tests.
Tests are regular Tide programs that use the built-in assertions (assert, assert_eq).
Tide code is a mix of relation declarations and queries.
relation double where
double(x) = x * 2
Relations can have multiple clauses and guards:
relation factorial where
factorial(0) = 1
factorial(n) = n * factorial(n - 1) when n > 0
query double(5)
query 1..5
query [x * x for x in 1..5]
See examples/basics.tide for a more complete tour.
- This project is early-stage and the syntax/semantics may change.
- If you get build errors on some systems, see the troubleshooting section in
docs/cli.md.