moonasgi0.10.6
ASGI 3.0: the interface between servers and frameworks.
after the ASGI specification

A stack of MoonBit libraries: web services, data, protocols, surfaces and inference.
88 modules in all. 74 are published. 12 have their design settled and no code yet. Two are not published: the template every repository starts from, and an example that runs nine of them at once.
Servers, frameworks, and the seam between them.
ASGI 3.0: the interface between servers and frameworks.
after the ASGI specification
Native ASGI server speaking HTTP/1.1, HTTP/2, HTTP/3 and WebSocket.
after uvicorn
Typed web framework with validation, dependency injection and OpenAPI 2.0, 3.0 and 3.1.
after FastAPI
Code-first GraphQL with subscriptions and Apollo Federation.
after strawberry, and the GraphQL specification
HTTP client: a Client that keeps its connections, HTTP/1.1 and HTTP/2 by ALPN, redirects, timeouts and compression.
after aiohttp, requests, httpx and reqwest
Every feature of four template languages, spelled the way Jinja2 spells it.
after Jinja2, Django templates, Pug and Slim
Model Context Protocol servers and clients: the wire model, tools, resources and prompts.
after FastMCP and the MCP specification
Prometheus metrics: every metric kind, labelled families, and the text and OpenMetrics formats.
after the Prometheus clients
OpenTelemetry: traces, context propagation and OTLP export.
after the OpenTelemetry specification
Prometheus metrics for MoonBit.
State machines that take bytes and hand back events, and the services standing on them.
The formats a request and a response are written in, with nothing about sockets in them.
after the HTTP family of RFCs, and ylong
TLS 1.3 and DTLS 1.3, as state machines. No sockets, and not one line of cryptography of their own.
after RFC 8446 and RFC 9147
QUIC transport: packets, streams, loss recovery and congestion control.
after RFC 9000 to 9002
Connections that read and write the same in the clear and under TLS, the listener and the dialler.
after Go net and hyper
The WebRTC stack, layer by layer: SDP, STUN, ICE, RTP, SRTP and the data channel.
after pion/webrtc and aiortc
gRPC with server reflection, over moonhttp’s HTTP/2.
after grpc-go
Microservice framework: config-driven assembly, resilience and service discovery.
after go-zero
Spec-driven code generator for the whole stack, as the mctl command.
after goctl
Email for MoonBit: messages, SMTP, IMAP and POP3.
One interface, three drivers that speak the wire themselves, and the mapper above them.
ORM and SQL toolkit: query builder, sessions, relationships and migrations.
after SQLAlchemy 2.x
The database-access interface drivers implement, pooling included.
after database/sql and DB-API 2.0
SQLite driver for moondb.
after the SQLite C API
PostgreSQL driver speaking the wire protocol itself.
after asyncpg
MySQL and MariaDB driver speaking the wire protocol itself.
after PyMySQL
One field description, several projections: validation, OpenAPI, SDL and DDL.
after Pydantic
Replication, and agents that plan before they act.
Two toolkits: one draws in a terminal, one draws pixels.
Terminal user interfaces: cell buffers, diffed output, layout, widgets and drivers.
after Textual
Immediate-mode graphical interfaces: one frame, one pass over the state.
after egui
Scaffolding a new interface project, and the dev server it runs under.
after Vite
Running a model, and the four libraries underneath it.
Run a model: weights, a KV cache, sampling, and a server to put it behind.
Tensors, the graph built from them, and the schedule that runs it on CPU or GPU.
after ggml
The WebGPU API: one surface over the browser’s own and a native backend.
after the WebGPU and WGSL specifications
GGUF model files: the header, the metadata table and the tensor index.
after the GGUF specification
Text into tokens and back: byte-level BPE and the SentencePiece shape.
Text and binary formats, read and written back.
One tree, several ways of writing it: JSON, JSONC, JSON5 and JSON Lines.
after RFC 8259, and each dialect’s own specification
YAML 1.2.2, read into the same tree every other reader here produces.
after the YAML 1.2.2 specification
TOML 1.0.0 — the format MoonBit’s own moon.mod is written in.
after the TOML 1.0.0 specification
JSON Schema validation across all five drafts. It validates; it does not parse.
after the JSON Schema specification
Tag documents parsed, queried by XPath and CSS, edited, and written back.
after lxml and BeautifulSoup
Streaming playlists and containers: m3u8, MPD, MPEG-TS, fragmented MP4, RTMP.
after RFC 8216 and ISO/IEC 23009-1
Python’s re, the regex superset behind it, and the dialect JSON Schema means.
after re, mrab-regex, and ECMA-262 §22.2
A value written so that Java, Go or Python reads it back as its own.
after Apache Fory
DEFLATE, the zlib and gzip containers built on it, and the ZIP archive.
after RFC 1950 to 1952, and the ZIP appnote
base16, base32, base36, base58, base62 and base64, then bech32, base58check and multibase.
after RFC 4648, and the alphabets that grew up outside it
How a number becomes bytes and back, fixed width and variable length alike.
after the four protocol families that each define it differently
moonmime — the MIME family for MoonBit: media types and their parameters, the extension-to-type registry, Content-Disposition, multipart bodies and multipart/form-data, each read and written from bytes. No sockets, no files.
Semantic Versioning 2.0.0: parsing, printing, precedence, bumping and version ranges, with the range grammar of npm, Cargo, Ruby or the strict spec as a parameter.
URI references as RFC 3986 defines them: parsing, recomposing, resolving and percent coding by component, and data URLs.
What everything above is allowed to depend on.
Hashes, MACs, ciphers, AEAD, key agreement and signatures — one algorithm to a package.
after hashlib, hmac and the RustCrypto crates
Seal a file for several people at once; any one of them opens it.
after age
Credential formats: JSON Web Tokens, the keys they are verified with, ASN.1 and X.509.
after the JOSE, ASN.1 and PKIX specifications
Dates, times, instants, durations and cron expressions.
after Python’s datetime
A level, a message, fields carried as values, and a seam to write through.
after serlog
Resource pools, backoff and flow control — the bookkeeping every client rewrites.
Configuration from defaults, the environment and files, checked on the way in.
Generate MoonBit code from annotated declarations: templates over the official syntax tree, typed attribute arguments, and the generator scaffolding behind dev_build.
Resilience without I/O: circuit breaking, adaptive load shedding, rate limits, backoff and deadlines, with the clock and the randomness passed in.
Unicode character database for MoonBit: categories, properties, case mapping and folding, generated from the UCD.
UUIDs for MoonBit: parse every spelling, make versions 1 to 8, generate over your own clock and randomness.
moonnum — Python's numbers for MoonBit: arbitrary-precision integers, floats, complex numbers and fractions, read, written and formatted the way Python reads, writes and formats them.
Image codecs for MoonBit: PNG, QOI, BMP, TGA, JPEG, GIF and WebP, and the pixel arithmetic between them.
Vectors, matrices, quaternions and geometry for MoonBit, laid out for WGSL.
CSS colour syntax, colour spaces, gamut mapping, terminal colours and colour arithmetic for MoonBit.
Reproducible pseudo-random numbers: a default generator, sixty-three more, and the sampling and distributions Python’s random names.
Secure random bytes and unbiased sampling for MoonBit.
A cache for MoonBit: bounded by count or weight, with expiry, loaders and eviction listeners.
A Consul client for MoonBit: agent, catalog, health, KV and sessions, with blocking queries.
An etcd v3 client for MoonBit: KV, watch, lease, transactions, locks and elections over gRPC.
A Redis client for MoonBit: RESP2 and RESP3, pipelines, transactions, pub/sub, cluster and sentinel.
Service discovery for MoonBit: the contract backends implement, with one in-memory registry and a conformance suite.
Protocol Buffers for MoonBit: runtime, reflection, JSON and text formats, and the protoc plugin.
Graphs for MoonBit: representations and the algorithms on them.
Data structures and algorithms the MoonBit core library leaves out.
IP addresses and networks for MoonBit: IPv4, IPv6, prefixes and how to classify them.
Task queues and schedules for MoonBit: workers, retries, beats, workflows, and a console.
The Agent2Agent protocol for MoonBit: agent cards, tasks, streaming and push notifications.
Markdown for MoonBit: CommonMark and GFM, whole or as it streams in.
Talk to language models from MoonBit: one contract for chat, streaming, tools and embeddings, with a subpackage per provider.
Documents, splitting, vector stores and retrieval for MoonBit.
Agent Skills for MoonBit: discover, read and validate SKILL.md.
Durable state graphs for MoonBit: nodes, merging, checkpoints, interrupts and resume.
The Agent Client Protocol for MoonBit: editors talking to agents, over ASGI or stdio.
JSON-RPC 2.0 for MoonBit: messages, a method table, two-way calls and framing.
JSON-RPC 2.0 for MoonBit: messages, a method table, two-way calls and framing.
Agent Skills for MoonBit: discover, read and validate SKILL.md.
Not published: one to copy from, one to read.