快 · req/s(c=50)
47,200req/s
领先 Go(42,800)和 Node(38,700)1。原生异步,真正的多核,一个静态二进制文件,零运行时。
编程语言 · AI 智能体框架 · 默认安全
同一个 URL,按内容协商。Synsema 是一门快速、默认安全、面向 AI 智能体的编程语言,内置智能体框架:同一条路由向人返回 HTML,向模型返回 Markdown。切换面板,看看 LLM 从这个页面收到的 Markdown 究竟是什么。
在 try.synsema.com 边做边学:带真实沙箱的课程,无需安装。
# Synsema > 一门面向 AI 智能体的编程语言。 ## 它是什么 - 快。 47,200 req/s,领先 Go 和 Node。 - 默认安全。 没有 `require`,就没有访问。 - 智能体原生。 一条路由,HTML 或 Markdown。 ## 安装 curl -fsSL synsema.com/install.sh | sh 智能体索引: /llms.txt
一门面向 AI 智能体的编程语言。
↑ 同一资源,两种表现形式 · curl -H "Accept: text/markdown" synsema.com/zh
快 · req/s(c=50)
47,200req/s
领先 Go(42,800)和 Node(38,700)1。原生异步,真正的多核,一个静态二进制文件,零运行时。
默认安全
-- 没有 require,就没有访问 require net("api.shop.com") fetch("api.shop.com") ✓ 允许 fetch("evil.com") ⊘ 拒绝
没有 require 就没有访问:拒绝的是解释器,而不是代码审查。认证、校验和 intent 都是声明式的。
智能体原生
这个页面就是演示。每条路由向人返回 HTML,向智能体返回 Markdown/JSON,/llms.txt、/sitemap.xml 和 /openapi.json 都由路由表推导而来。
文档站提供一个 MCP 服务器:智能体通过一个端点搜索、阅读、运行和测试代码。
1 · 在 Linux VPS 上测得,6 种负载,c=50,多次运行取中位数(首轮丢弃)。可复现的测试框架:synsema-arena。
你能用它构建什么
智能体应用需要的一切都在语言里,而不是粘在上面的框架里:LLM 调用、工具使用、记忆、人工审批、多智能体编排、生产级服务器和安全模型。所以同一门语言也能构建智能体周围的 API、网站、定时任务和 CLI。
应用
synsema init --desktop:同一个服务端渲染的应用,在 Android 和 iOS 上作为带原生推送的 PWA 安装,在桌面上作为桌面应用分发 — 单个二进制文件、浏览器应用窗口、你的图标、无控制台。
一个文件
Synsema 程序以声明它可以触碰什么开头。这一行以下的一切——路由、数据库、密钥、模型——都在其中运行。下面两个文件原样即可解析和运行。
-- A bookshop API. The `require` lines are the whole permission
-- surface: a port, one database file, one secret. Nothing else.
intent: "public read API; writes need the staff token"
require serve(8080)
require db("./shop.db")
require secret("API_TOKEN")
task check_token(token)
let want be hmac_sha256("staff", token)
when verify_hmac("staff", want, secret("API_TOKEN"))
give {"role": "staff"}
give nothing
serve on 8080
auth with check_token
rate_limit 120 per minute
route "GET /books"
give paged("SELECT id, title, price FROM books")
route "POST /books" requires auth
expect body {title: text, price: number}
let b be json of request
sql_exec("INSERT INTO books (title, price) VALUES (?, ?)",
[b.title, b.price])
give created(b)
route "GET /about"
let doc be page([heading(1, "Bookshop"),
prose("HTML or Markdown, one route.")],
{"title": "Bookshop"})
give content(doc)-- An agent that triages support tickets. The model decides;
-- a human approves refunds; the API key is a sealed secret.
intent: "triage open tickets; refunds wait for a human"
require llm
require net("api.example.com")
require secret("SUPPORT_TOKEN")
let api be "https://api.example.com"
let auth be {"Authorization": bearer(secret("SUPPORT_TOKEN"))}
let r be http_get(api + "/tickets?open=1", auth)
let tickets be json_decode(body of r)
each t in tickets
let msg be t["text"]
let kind be decide between ["bug", "billing", "other"] given msg
when kind == "billing"
let amount be analyze msg for "the amount to refund"
let who be t["customer"]
approve "Refund " + text(amount) + " to " + who + "?" within 1h
otherwise
let reply be generate "a short, kind answer" given msg
let url be api + "/tickets/" + t["id"] + "/reply"
http_post(url, {"text": reply}, auth)require 就是全部的权限面。 一个端口、一个数据库文件、一个密钥。对其他任何主机的 fetch 都会被解释器拒绝。auth with 指定判断令牌身份的任务;expect body 用一个点名字段的 400 拒绝错误的请求体。content() 向浏览器返回 HTML,向智能体返回 Markdown 或 JSON;paged() 替你给大结果集分页。decide 返回选项之一或重试;analyze 和 generate 是有类型的,不是手工拼接的提示词字符串。approve … within 1h 等待真实的人;没人在场就拒绝。用 Synsema 构建
智能体的能力
可移植的能力单元:清单声明代码可以触碰什么,运行时强制执行并审计每一次调用。lamp add,然后 lamp mcp,即可用于 Claude Code、Cursor 或任何 MCP 智能体。
博客精选
Engine, program, modules, templates and assets in a single sealed executable, with a capability ceiling baked in. Nothing to install on the target — deploy it FROM scratch, or hand it to someone as a file.
A Synsema app is a website with automatic HTTPS, an installable phone app with native push, and a desktop app in its own window with your icon — from one server-rendered program and one API module. No native toolkit, no second codebase, no store required.
MCP is JSON-RPC. In Synsema the whole server is a dispatcher task and one POST route. Tools are tasks with real bodies, secrets stay sealed, and untrusted input runs under a capability ceiling.