moonbitstack logo

moonbitstack

A stack of MoonBit libraries: web services, data, protocols, surfaces and inference.

moon add moonbitstack/moonapi

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.

Web

Servers, frameworks, and the seam between them.

moonfetch0.1.5

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

mooncakes

moonpug0.1.4

Every feature of four template languages, spelled the way Jinja2 spells it.

after Jinja2, Django templates, Pug and Slim

documentationmooncakes

moonmcp0.1.10

Model Context Protocol servers and clients: the wire model, tools, resources and prompts.

after FastMCP and the MCP specification

documentationmooncakes

moonp8s0.1.1

Prometheus metrics: every metric kind, labelled families, and the text and OpenMetrics formats.

after the Prometheus clients

documentationmooncakes

Protocols

State machines that take bytes and hand back events, and the services standing on them.

moonhttp0.15.8

The formats a request and a response are written in, with nothing about sockets in them.

after the HTTP family of RFCs, and ylong

documentationmooncakes

moontls0.9.14

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

mooncakes

moonquic0.3.11

QUIC transport: packets, streams, loss recovery and congestion control.

after RFC 9000 to 9002

mooncakes

moonnet0.1.10

Connections that read and write the same in the clear and under TLS, the listener and the dialler.

after Go net and hyper

mooncakes

moonrtcin design

The WebRTC stack, layer by layer: SDP, STUN, ICE, RTP, SRTP and the data channel.

after pion/webrtc and aiortc

Data

One interface, three drivers that speak the wire themselves, and the mapper above them.

Systems

Replication, and agents that plan before they act.

Surface

Two toolkits: one draws in a terminal, one draws pixels.

moonegui0.2.1

Immediate-mode graphical interfaces: one frame, one pass over the state.

after egui

mooncakes

moonvitein design

Scaffolding a new interface project, and the dev server it runs under.

after Vite

Inference

Running a model, and the four libraries underneath it.

mooninferin design

Run a model: weights, a KV cache, sampling, and a server to put it behind.

moonggmlin design

Tensors, the graph built from them, and the schedule that runs it on CPU or GPU.

after ggml

moonwgpuin design

The WebGPU API: one surface over the browser’s own and a native backend.

after the WebGPU and WGSL specifications

moonggufin design

GGUF model files: the header, the metadata table and the tensor index.

after the GGUF specification

moontoken0.1.1

Text into tokens and back: byte-level BPE and the SentencePiece shape.

mooncakes

Formats

Text and binary formats, read and written back.

moonjson0.4.3

One tree, several ways of writing it: JSON, JSONC, JSON5 and JSON Lines.

after RFC 8259, and each dialect’s own specification

documentationmooncakes

moonregex0.1.3

Python’s re, the regex superset behind it, and the dialect JSON Schema means.

after re, mrab-regex, and ECMA-262 §22.2

documentationmooncakes

moonzip0.3.6

DEFLATE, the zlib and gzip containers built on it, and the ZIP archive.

after RFC 1950 to 1952, and the ZIP appnote

documentationmooncakes

moonbase0.4.3

base16, base32, base36, base58, base62 and base64, then bech32, base58check and multibase.

after RFC 4648, and the alphabets that grew up outside it

documentationmooncakes

moonvar0.2.1

How a number becomes bytes and back, fixed width and variable length alike.

after the four protocol families that each define it differently

documentationmooncakes

moonmime0.2.3

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.

documentationmooncakes

moonsver0.1.1

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.

documentationmooncakes

moonurl0.2.5

URI references as RFC 3986 defines them: parsing, recomposing, resolving and percent coding by component, and data URLs.

documentationmooncakes

Foundations

What everything above is allowed to depend on.

mooncrypt0.4.11

Hashes, MACs, ciphers, AEAD, key agreement and signatures — one algorithm to a package.

after hashlib, hmac and the RustCrypto crates

documentationmooncakes

mooncred0.6.9

Credential formats: JSON Web Tokens, the keys they are verified with, ASN.1 and X.509.

after the JOSE, ASN.1 and PKIX specifications

documentationmooncakes

moonast0.2.6

Generate MoonBit code from annotated declarations: templates over the official syntax tree, typed attribute arguments, and the generator scaffolding behind dev_build.

documentationmooncakes

moonward0.2.1

Resilience without I/O: circuit breaking, adaptive load shedding, rate limits, backoff and deadlines, with the clock and the randomness passed in.

documentationmooncakes

moonucd0.1.3

Unicode character database for MoonBit: categories, properties, case mapping and folding, generated from the UCD.

documentationmooncakes

moonnum0.2.5

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.

documentationmooncakes

moonrand0.1.2

Reproducible pseudo-random numbers: a default generator, sixty-three more, and the sampling and distributions Python’s random names.

mooncakes

moonkart0.1.0

A cache for MoonBit: bounded by count or weight, with expiry, loaders and eviction listeners.

mooncakes

moonconsul0.1.2

A Consul client for MoonBit: agent, catalog, health, KV and sessions, with blocking queries.

mooncakes

moonetcd0.1.2

An etcd v3 client for MoonBit: KV, watch, lease, transactions, locks and elections over gRPC.

mooncakes

moonredis0.1.3

A Redis client for MoonBit: RESP2 and RESP3, pipelines, transactions, pub/sub, cluster and sentinel.

mooncakes

moonsd0.1.1

Service discovery for MoonBit: the contract backends implement, with one in-memory registry and a conformance suite.

mooncakes

moonproto0.1.0

Protocol Buffers for MoonBit: runtime, reflection, JSON and text formats, and the protoc plugin.

mooncakes

moonstl0.1.0

Data structures and algorithms the MoonBit core library leaves out.

mooncakes

moonip0.1.0

IP addresses and networks for MoonBit: IPv4, IPv6, prefixes and how to classify them.

mooncakes

moontaskin design

Task queues and schedules for MoonBit: workers, retries, beats, workflows, and a console.

moona2ain design

The Agent2Agent protocol for MoonBit: agent cards, tasks, streaming and push notifications.

documentation

moonmd0.1.0

Markdown for MoonBit: CommonMark and GFM, whole or as it streams in.

mooncakes

moonmusein design

Talk to language models from MoonBit: one contract for chat, streaming, tools and embeddings, with a subpackage per provider.

moonragin design

Documents, splitting, vector stores and retrieval for MoonBit.

moonskillsin design

Agent Skills for MoonBit: discover, read and validate SKILL.md.

moonstate0.1.0

Durable state graphs for MoonBit: nodes, merging, checkpoints, interrupts and resume.

mooncakes

moonacpin design

The Agent Client Protocol for MoonBit: editors talking to agents, over ASGI or stdio.

moonjsonrpc0.1.0

JSON-RPC 2.0 for MoonBit: messages, a method table, two-way calls and framing.

mooncakes

Beginning

Not published: one to copy from, one to read.

moonkita template

The template every repository here starts from: workflows, skeleton, licence.

moonheloan example

An end-to-end example running nine of these as one service.