Synsemadocsv0.6.xENES

Getting Started

Quickstart

Synsema is a programming language designed for AI agents — LLM reasoning, multi-agent coordination, human approval gates, an HTTP server and a deny-by-default security model are built into the language, not bolted on as frameworks. It ships as a single static binary (written in Rust) — no Python, no Node, no runtime to install.

Install§

macOS / Linux:

curl -fsSL https://synsema.com/install.sh | sh

Windows (PowerShell):

irm https://synsema.com/install.ps1 | iex

Check it:

synsema version

Hello, world§

The fastest start is the scaffold — it generates a commented hello.syn (a short tour of the language, with its test), a .env.example with every knob explained, and a .gitignore:

synsema init my-project

Or write it yourself — put this in hello.syn:

hello-world.syn
-- Doc example: your first Synsema program. Comments in English (universal code).
intent: "doc example: hello world + a tiny task"

task greet(name)
    give "Hello, " + name + "!"

print(greet("World"))                 -- run shows: Hello, World!

test "greet builds a friendly message"
    assert_eq(greet("World"), "Hello, World!")
    assert_eq(greet("Synsema"), "Hello, Synsema!")

Run it:

synsema run hello.syn

synsema run executes a file; synsema test runs its test blocks; synsema check parses without running.

Your first HTTP server§

Synsema has a production HTTP server built in — no framework to add. Everything is deny-by-default, so you declare what the program may do with require.

require serve(8080)

serve on 8080
    route "GET /hello"
        give {"msg": "hi"}
synsema serve app.syn          # → http://127.0.0.1:8080/hello

Your first web page§

The same server serves real HTML. A page is a template with { holes }; your CSS/JS live in static/ (they hot-reload per request — edit, refresh, done):

require serve(8080)

serve on 8080
    static "/assets" from "./static"        -- app.css, app.js
    route "GET /"
        give render("pages/home.html", {"title": "My site"})
<!-- pages/home.html -->
<!DOCTYPE html><html><head><title>{ title }</title>
<link rel="stylesheet" href="/assets/app.css"></head>
<body><h1>{ title }</h1></body></html>

Full walkthrough (layout, components, forms, error pages): Build a website.

Your first LLM call§

The LLM is a built-in primitive. Put your provider key in .env (it is never exposed to the program), then:

require llm

let summary be generate "a one-line summary" given report
let action be decide between ["approve", "reject"] given request

The result of a decide is validated to be one of the options — with automatic retries. See LLM in the sidebar for native ops and for calling a provider's HTTP API directly.

Next§