Tish Examples

Example applications you can run and compile with Tish. Build the CLI from the repo root: cargo build --release -p tish.

Examples

ExampleDescriptionFeatures
npm-usageUses @tishlang/tish from npm (npm install, scripts)None
hello-worldMinimal app that logs and exitsNone
matmulDense matrix multiply across backends: CPU (f64 native), Metal GPU (MPS via Swift), Apple MLX (Metal via Python)fs, process (GPU/MLX variants)
new-expressionnew Uint8Array / new AudioContext on every target; real new on --target jsNone
http-helloBasic HTTP server with routinghttp
http-env-var-exampleHTTP server reading PORT, TEST, DEPLOYMENT_ID from process.envhttp, process
json-apiREST API with JSON responseshttp
echo-serverEchoes request details backhttp
counter-apiStateful counter servicehttp
async-awaitAsync/await with fetch / fetchAllhttp
mdx-docsStatic docs: MDX, file-based routing, pre-renderedhttp, fs
json-file-editRead JSON file, decode, modify, write backfs
tishx-exampleTish + JSX compiled to vanilla JavaScript (no 3rd party libs)

Quick start — run locally

From the repo root, run any example with the interpreter:

cd examples/http-hello
tish run src/main.tish --feature http

Or compile to a native binary:

tish build src/main.tish -o server --feature http
./server

Use the same pattern for other examples; enable the features they need (e.g. http, fs, process).

Deploy

Use the zectre CLI from an example directory. See Deploy Overview for details. Prerequisites: built tish binary and platform config pointing at this repo.

Project structure

Each example follows:

example-name/
├── tish.yaml        # Optional: deployment/config
├── README.md        # Example-specific docs
└── src/
    └── main.tish    # Entry point

Feature flags

FlagEnables
httpNetwork access (fetch, fetchAll, serve)
fsFile system (readFile, writeFile, mkdir, etc.)
processProcess control (process.exit, process.env, etc.)
regexRegular expressions (RegExp, String.match, etc.)
fullAll features

By default, Tish runs in secure mode with no features enabled. Pass --features http (or other flags) when running or compiling.

Improve this documentation