Skip to content

Stanislas7/tide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tide

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.

Install

Instant install (prebuilt binaries)

curl -fsSL https://raw.githubusercontent.com/stanislas7/tide/main/install.sh | sh

By 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 -- --system

Build from source

make

Quick start

Run the REPL

./bin/tide

Run a file

./bin/tide examples/basics.tide

Executable scripts (shebang)

Tide 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.tide

Or using the Makefile helper:

make exec FILE=examples/basics.tide

Run tests

make test

--test runs every *.tide file in ./tests.

Tests are regular Tide programs that use the built-in assertions (assert, assert_eq).

Language overview (very short)

Tide code is a mix of relation declarations and queries.

Relations

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

Queries

query double(5)
query 1..5
query [x * x for x in 1..5]

See examples/basics.tide for a more complete tour.

Docs

Notes

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published