Net Bacon
Public toolsDNS, ICMP ping, TLS, routing, and subnet tools with results you can put in a ticket.
- Networking
- Live monitoring
- Background workers
The agent-optimized language for building modern applications.
import { json, parse_json } from "std/http/server" import { schema, validate, required, email } from "std/validate" let signup_rules = schema(map { "email": [required, email], "name": [required, str] }) // @implements: feature.signup fn signup(req) requires len(req.body) < 4096 { let body = parse_json(req) otherwise { return json(map { "error": "bad json" }, 400) } let user = validate(signup_rules, body) otherwise { return json(map { "errors": err }, 422) } return json(map { "welcome": user["name"] }, 201) } post("/signup", signup) listen(8080)
## Glossary | Term | Means | |-------------------------------|---------------------------| | someone signs up with {body} | POST /signup body {body} | | they are welcomed | status 201 | | they are asked to fix it | status 422 | --- Feature: Signup id: feature.signup Scenario: Valid details When someone signs up with {"email": "[email protected]", "name": "Ada"} → they are welcomed → body contains "Ada" Scenario: Bad email When someone signs up with {"email": "nope", "name": "Ada"} → they are asked to fix it
$ ntnt intent check server.tnt -vv ✓ Feature: Signup ✓ Valid details → they are welcomed → body contains "Ada" ✓ status: 201 ✓ body contains "Ada" ✓ Bad email → they are asked to fix it ✓ status: 422 === Summary === Features: 1 total, 1 passed, 0 failed Scenarios: 2 passed, 0 failed, 0 skipped Assertions: 3 passed, 0 failed
Every major programming language was designed for people writing code by hand. NTNT is designed for agents writing the code while people decide what it should do, so the language, the tooling, and the standard library are all built around how an agent works.
ntnt learn writes setup files for Claude Code, Cursor, Codex, and Copilot, and ntnt docs answers any question about a function from the terminal. Your agent doesn’t need NTNT in its training data.ntnt intent check runs them against the real code after every change. ntnt lint and ntnt validate report errors as JSON, and ntnt inspect lists every route, function, and contract. The server hot-reloads, so each change is checked in seconds.NTNT_TYPE_MODE sets how strictly types are checked at runtime and NTNT_LINT_MODE sets how strictly they’re checked before it runs, so a prototype and a production app can use the same code. Errors are Result values, handled with ? or otherwise instead of slipping past, and requires and ensures report the values that broke them. In a route, a failed requires returns a 400.fetch blocks private network addresses and cloud metadata endpoints, responses get security headers, and std/secrets keeps credentials out of logs and pages. Rate limiting is built in and turns on with one environment variable. PostgreSQL connections to other hosts use verified TLS by default, and rediss:// URLs do the same for Redis and Valkey.Applications running on NTNT in production today.
DNS, ICMP ping, TLS, routing, and subnet tools with results you can put in a ticket.
The site you're reading: documentation, a PostgreSQL-backed blog, and this showcase.
Infrastructure monitoring with scheduled network checks and authenticated access.
Describe what the app should do in plain sentences, and NTNT turns them into tests. Scenarios are written in the Intent Assertion Language (IAL), where a glossary maps each phrase to a concrete check against routes, responses, or functions. Contracts check the code from the inside: requires and ensures state what each function accepts and returns, and fail with the values that broke them. Your agent writes both from your request, runs them after every change, and fixes what fails.
Your agent writes your requirements as IAL scenarios in a .intent file, and ntnt intent lint confirms every phrase resolves before anything runs.
ntnt intent lint server.intent
@implements ties each function to the requirement it serves. requires and ensures check what goes in and what comes out.
ntnt lint server.tnt
ntnt intent check runs every scenario against the real code and reports each assertion. Your agent fixes what fails and runs it again.
ntnt intent check server.tnt
How Intent-Driven Development works, with coverage reports and a visual studio
Each of these has a recipe with a working example or a prompt you can hand to your agent.
Web servers, databases, authentication, and background jobs ship in the runtime. ntnt docs gives an agent any function’s signature and examples without leaving the terminal.
std/http/serverRouting, middleware, static files, SSE, WebSockets, rate limitsstd/httpFetch with SSRF protection and safe redirectsstd/authOAuth/OIDC, sessions, CSRF, TOTP, magic linksstd/validateDeclarative schemas for forms and APIsstd/emailSMTP, batches, and a log transport for devstd/postgresPooled queries, transactions, verified TLSstd/sqliteEmbedded database with transaction modesstd/kvRedis, Valkey, SQLite, or in-memorystd/json std/csvParse and serializestd/markdownRendering and source-mapped block parsingstd/jobsDurable queues, cron, retries, crash-safe leasesstd/concurrentTasks, channels, broadcasts, parallel, racestd/processSupervised child processes, off by defaultstd/secretsOpaque, redacted secret valuesstd/logStructured logs with JSON contextstd/net std/netmonCIDR math, ping, TCP, DNS, SNMPstd/string std/collectionsText and higher-order data toolsstd/time std/mathDates, durations, “3 hours ago”std/cryptoHashing, AES-GCM, Argon2, UUIDsstd/fs std/path std/env std/urlFiles, paths, config, URLsRequests are handled by a Rust HTTP server on Tokio, and your route handlers run in the NTNT interpreter. In our nine-framework comparison, NTNT served over 300,000 plaintext requests per second.
The 0.6 releases added database migrations you can review, live updates over Server-Sent Events and WebSockets, built-in rate limiting, and verified TLS for PostgreSQL and Redis.
ntnt db accepts SQLite AUTOINCREMENT and built-in functions such as the JSON functions, and PostgreSQL enums, domains and extensions such as citext. Extensions a superuser installs can be declared, and a database restored with pg_restore no longer reports drift. If you use it with PostgreSQL, read the upgrade notes first: scratch databases have new requirements.ntnt db accepts SQLite timestamp defaults and partial and expression indexes, refuses a drop that would delete rows in related tables, and says which file, migration or setting caused each refusal. Runtime errors in imported modules point at the right file and line.fetch blocks cloud metadata endpoints however they’re written, and PostgreSQL and Redis connections can use verified TLS. Read the upgrade checklist before deploying.ntnt db init and ntnt db new scaffold a database and its migration files, ntnt db connects to PostgreSQL over verified TLS, and large tables can get longer migration time limits.Notes from building an agent-native language: releases, benchmarks, and design decisions.
A migration changes a database that already holds real data, and two things tend to go wrong. The database isn't in the state the code assumes,...
Most web pages show what was true when they loaded. If an order ships or a new comment arrives, you don't see it until you refresh. Live updates fix...
We reran the NTNT benchmark suite against the 0.5.5 release: nine frameworks, seven workloads, and a two-minute memory test. We also ran 0.4.2 and...
NTNT is open source under MIT and Apache 2.0. The code, the issues, and the roadmap are on GitHub.