Shrimpl quickstart

Shrimpl is a small, beginner-friendly language that aims to bridge the gap between block-based tools and general-purpose programming. It is readable, approachable, and practical enough for APIs, data analysis, and simple machine-learning workflows.

Install the Shrimpl interpreter

Shrimpl is distributed as a Rust crate. You will need a recent Rust toolchain to get started.

Install via Cargo
bash
cargo install shrimpl

If you prefer to build from source, clone the repository and run a release build:

Build from source
bash
git clone https://github.com/adl5423/shrimpl-language
cd shrimpl-language
cargo build --release

# resulting binary:
# target/release/shrimpl

Your first Shrimpl program

Create a file named app.shr:

app.shr
shr
server 3000

endpoint GET "/":
  "Hello, Shrimpl!"

Then run it with the Shrimpl CLI:

Run the server
bash
shrimpl --file app.shr run

This will parse your program, run basic checks, and start a server on port 3000. Open http://localhost:3000/ in a browser to see the response.

Check diagnostics without running

To only check syntax and static diagnostics (e.g., unused path parameters, duplicate endpoints) without starting the server, use:

Static checks
bash
shrimpl --file app.shr check

HTTP basics: servers and endpoints

A Shrimpl program that exposes HTTP endpoints defines one server and one or more endpoint blocks.

Paths and parameters
shr
server 8080

# Path parameter
endpoint GET "/hello/:name":
  "Hello " + name

# Query parameter
endpoint GET "/greet":
  "Hello " + name  # /greet?name=Aisen

JSON responses

Use json { ... } to return JSON from an endpoint:

JSON endpoint
shr
endpoint GET "/info":
  json { "name": "Shrimpl", "version": 0.5 }

Where to go next

  • Read the full README in the Shrimpl core repository for language details.
  • Install the VS Code extension and point it at your shrimpl-lsp binary to get inline diagnostics.