Buildless server language · canonical reference

Fast to run.
Clear to read.

Gray combines PHP-like immediacy with typed boundaries, native server primitives, and Live, Static, and Adaptive execution.

Quickstart

Source to response, immediately.

No application build directory and no framework are required.

gray new hello-gray
cd hello-gray
gray run

# Develop with validated hot replacement
gray dev
01

Write Gray

{{ set String $name = "Ada"; }}
Hello, {$name}!

Use pure `.gy` programs or mix server blocks with literal output.

Language and tooling

Find the surface you need.

Template

<?gray ... ?>, includes, and {expr}

Compose ordinary files in shared scope and render expressions inside literal text.

Types

Typed when it matters

Mix typeless values with checked parameters, returns, fields, and storage.

Objects

Classes with identity

Constructors, methods, references, and contextual visibility are implemented.

Data

Schemas with structure

Declare typed records, pass them through functions, and encode them as JSON.

Database

Native SQLite

Use parameterized SQL, typed rows, binary-safe values, transactions, and mapped schemas.

Acceleration

Bounded native cache

Cache isolated Gray values with TTL, deterministic LRU eviction, binary keys, and observable limits.

Security

Native Session Fabric

Use opaque encrypted sessions, typed state, CSRF, recent authentication, bounded risk, and redacted events.

Concurrency

spawn and await

Structured tasks propagate values, cancellation, and source-aware errors.

Tooling

Compiler-backed feedback

gray fmt, gray lint, and the LSP share Gray's syntax model.

Execution

Three policies, one language

Run from source, ship a standalone artifact, or replace ready server workers.

Runnable tutorials

Exact source, not pseudocode.

Every example is formatted and output-checked by the repository suite.

Loading tutorial…

Native Session Fabric

Secure state without hidden middleware.

Explicit Gray APIs, durable adapters, bounded signals, and reproducible local tests.

Reference

Session API

Lifecycle, CSRF, browser policy, authentication, rate limits, management, risk, and events.

Read API guide
Deployment

Storage adapters

Choose bounded memory, encrypted SQLite, or encrypted Redis/Valkey deliberately.

Read storage guide
Operations

Key rotation

Deploy active and retiring encryption and risk keys without silent state loss.

Read rotation guide
Privacy

Retention and fairness

Understand coarse signals, short retention, redaction, and application-owned decisions.

Read privacy guide

Compiler-backed API explorer

Documentation from Gray itself.

Loading gray.docs.v1

Served natively

This documentation is a Gray application.

The status below comes directly from runtime_stats().

loading…