Skip to content

Repository files navigation

Awesome Standard ML Awesome

A curated list of resources for the Standard ML programming language, plus a complete index of the sjqtentacles pure-SML library ecosystem.

Standard ML is a statically typed functional language with a formally defined semantics (The Definition of Standard ML), type inference, parametric polymorphism, and an expressive module system. This list collects compilers, learning resources, and tooling for the wider community, followed by an auto-generated catalog of the sjqtentacles ecosystem: 380+ small, pure, dependency-free libraries that build byte-identically under both MLton and Poly/ML. See also the dependency graph of how the ecosystem libraries depend on each other.

Contents

Compilers & runtimes

Implementations of Standard ML you can actually run code with.

  • MLton - A whole-program optimizing compiler producing fast standalone native executables. The de-facto target for performance-sensitive SML.
  • Standard ML of New Jersey (SML/NJ) - A mature compiler and interactive system with a large library and the Compilation Manager (CM).
  • Poly/ML - A full implementation with a fast incremental compiler and REPL; the implementation language of the Isabelle theorem prover.
  • MLKit - A compiler emphasizing region-based memory management and full Definition compliance.
  • Moscow ML - A lightweight implementation based on the CAML runtime, with interactive and batch use.
  • HaMLet - A faithful, reference-style implementation of the SML Definition, intended as executable specification.
  • SOSML - An in-browser SML interpreter, handy for teaching and quick tries.

Language standard & evolution

The Definition and ongoing successor-language work.

Learning resources

Books, courses and tutorials for learning Standard ML.

Tooling (community)

Build tools, package managers, formatters and language servers outside this ecosystem.

  • smlpkg - A generic package manager for SML using Git/GitHub package paths; the layout the sjqtentacles libraries vendor against.
  • Millet - A language server and VS Code extension for Standard ML.
  • smlfmt - A custom parser and pretty-printer / formatter for SML source.
  • SML/NJ Compilation Manager (CM) - SML/NJ's dependency-tracking build system.
  • ML Basis system (MLton) - MLton's .mlb system for programming in the large.

Editor support

Syntax highlighting and IDE integration.

Other lists & indexes

Related curated lists and package indexes.

sjqtentacles ecosystem

The sjqtentacles Standard ML ecosystem: 385 libraries.

Developer tooling (SML self-tooling)

The cluster of tools that operate on Standard ML itself: a frontend (lexer/parser/AST), formatter, doc generator, language server, linter, type elaborator, package/build tool, test frameworks and benchmarking. 19 libraries.

  • sml-bench - A deterministic, count-based micro-benchmark harness in pure Standard ML: measures operation counts (not wall-clock time) so results are exactly reproducible (MLton + Poly/ML).
  • sml-check - Pure Standard ML property-based testing with rose-tree shrinking (MLton + Poly/ML, deterministic seeds).
  • sml-doc - A pure Standard ML documentation generator emitting static HTML/Markdown.
  • sml-editorcore - Text-editor core in pure Standard ML: piece-table buffer, undo/redo history, Unicode-aware cursor, stable marks (MLton + Poly/ML).
  • sml-elab - Pure Standard ML type elaborator: Hindley-Milner Algorithm W over the positioned sml-mlast AST, with principal types, row-polymorphic records, and spanned diagnostics. Byte-identical under MLton and Poly/ML.
  • sml-fmt - A pure Standard ML, deterministic and idempotent source code formatter.
  • sml-hm - Hindley-Milner type inference (Algorithm W) for a mini-ML in pure Standard ML, with let-polymorphism and an ofLambda bridge to the vendored sml-lambda. Dual-compiler MLton + Poly/ML.
  • sml-lineedit - Line-editing driver over readline in Standard ML: key-event processing, escape sequences, cursor/buffer state, and rendering.
  • sml-lint - Pure, deterministic static linter for Standard ML over the positioned sml-mlast AST: unused/shadow/dead-open/non-exhaustive/redundant-parens/naming rules. MLton + Poly/ML, byte-identical.
  • sml-lsp - A pure Standard ML language server (LSP over JSON-RPC) for Standard ML.
  • sml-mlast - A pure Standard ML lexer, parser, AST and pretty-printer for Standard ML '97.
  • sml-pkg - Pure Standard ML package-manifest resolver + lockfile + .mlb generator (smlpkg-compatible), with a thin Git/mlton build driver. Byte-identical under MLton and Poly/ML.
  • sml-pretty - A Wadler/Leijen pretty-printer combinator library in pure Standard ML (group/nest/line, width-aware layout).
  • sml-readline - Pure Standard ML line-editor state machine: key model, ANSI decoder, history, kill-ring, completion hook (MLton + Poly/ML).
  • sml-resolver - A SAT-backed package dependency resolver using semver ranges and DPLL for Standard ML.
  • sml-semver - Pure Standard ML SemVer 2.0.0 parser, comparison, and range matching (MLton + Poly/ML, deterministic).
  • sml-stlc - Simply-typed lambda calculus with Curry-Howard bridge to natural deduction, in pure SML.
  • sml-test - A Standard ML test framework with property-based testing, QuickCheck-style generators, forAll, and shrinking.
  • sml-tls-tool - Conformance and fuzzing harnesses for sml-tls: BoGo shim, tlsfuzzer driver, OpenSSL differential, AFL persistent-mode fuzzers. Impure, quarantined.

Cryptography & security

Hashes, ciphers, AEAD, public-key crypto, key derivation, TLS, X.509, and related security primitives. 34 libraries.

  • sml-aead - Unified AEAD facade (ChaCha20-Poly1305 + AES-128/256-GCM) in pure Standard ML, with byte-exact RFC 8439 / NIST GCM vectors. Dual-compiler (MLton + Poly/ML).
  • sml-aes - AES block cipher with ECB, CBC, CTR, and GCM modes in pure Standard ML (FIPS 197).
  • sml-asn1 - ASN.1 DER encoder/decoder for Standard ML (INTEGER/SEQUENCE/OID/… via arbitrary-precision integers). Pure, dual-compiler.
  • sml-bigint - Arbitrary-precision signed integers for Standard ML: Karatsuba multiply, divMod, gcd, modpow, Miller-Rabin. Pure, dual-compiler.
  • sml-blake2b - BLAKE2b cryptographic hash (RFC 7693) in pure Standard ML.
  • sml-blake3 - BLAKE3 cryptographic hash function in pure Standard ML.
  • sml-chacha20 - ChaCha20-Poly1305 and XChaCha20-Poly1305 AEAD in pure Standard ML (RFC 8439).
  • sml-codec - Binary codecs for Standard ML: Base64/Base16 (RFC 4648), SHA-1 (RFC 3174), SHA-256 (RFC 6234), CRC-32. Verified against RFC vectors. Pure, dual-compiler.
  • sml-cookie - RFC 6265 Cookie/Set-Cookie parse+build for Standard ML (Path, Domain, Max-Age, Expires, Secure, HttpOnly, SameSite) plus HMAC-signed cookies. Pure, dual-compiler.
  • sml-cose - COSE (RFC 8152 / RFC 9052) CBOR message structures in pure Standard ML (MLton + Poly/ML).
  • sml-crypto - HMAC-SHA256 (RFC 4231), constant-time compare, and signed tokens for Standard ML. Verified against RFC vectors. Pure, dual-compiler.
  • sml-ed25519 - Ed25519 digital signatures over Edwards25519 in pure Standard ML (RFC 8032).
  • sml-html - HTML AST with safe-by-default, context-aware escaping for Standard ML. XSS holes are opt-in and greppable. Pure, dual-compiler (MLton + Poly/ML).
  • sml-jwt - A Standard ML library for JSON Web Tokens (JWS) with HMAC-SHA256 (HS256) signing and verification.
  • sml-kdf - Key-derivation functions in pure Standard ML: HKDF (RFC 5869) + scrypt (RFC 7914), with byte-exact RFC vectors. Dual-compiler (MLton + Poly/ML).
  • sml-merkle - RFC-6962 Merkle trees in pure Standard ML (MLton + Poly/ML): domain-separated hashing, inclusion + consistency + multi proofs, append/updateLeaf, and accessors.
  • sml-murmur3 - MurmurHash3 (x86_32 and x86_128) non-cryptographic hashing in pure Standard ML.
  • sml-oauth - OAuth 2.0 + PKCE (RFC 6749 / RFC 7636) as a pure state machine in Standard ML (MLton + Poly/ML).
  • sml-p256 - NIST P-256 (secp256r1) ECDH key agreement and ECDSA signature verification in pure Standard ML. Built on sml-bigint, sml-asn1, sml-codec. Pure, dual-compiler.
  • sml-pem - Pure Standard ML PEM encode/decode (RFC 7468) over Base64 (MLton + Poly/ML).
  • sml-ripemd160 - RIPEMD-160 cryptographic hash for Standard ML (Bitcoin hash160), verified against the official test vectors. Pure, dual-compiler.
  • sml-rsa - Pure Standard ML RSA: keygen, PKCS#1 v1.5 / OAEP / PSS, DER/PEM keys (MLton + Poly/ML).
  • sml-sanitize - Allowlist HTML sanitizer in pure Standard ML (MLton + Poly/ML), built on sml-html.
  • sml-secp256k1 - ECDSA and Schnorr (BIP-340) signatures over secp256k1 in pure Standard ML.
  • sml-session - Pure session handling for Standard ML: one string->string model with in-memory and stateless HMAC-signed-cookie backends. Pure, dual-compiler.
  • sml-sha3 - Keccak-f[1600] sponge, SHA3-224/256/384/512, SHAKE128/SHAKE256 XOF, and KMAC in pure Standard ML.
  • sml-shamir - Pure Standard ML Shamir Secret Sharing over GF(256) (MLton + Poly/ML).
  • sml-siphash - SipHash-2-4 keyed pseudorandom function in pure Standard ML.
  • sml-tls - TLS 1.3 (RFC 8446) sans-IO state machine in pure Standard ML, verified against RFC 8448 vectors. Experimental, not for production security.
  • sml-totp - Pure Standard ML HOTP/TOTP (RFC 4226 / RFC 6238), HMAC-SHA1/256/512 (MLton + Poly/ML).
  • sml-trie - Merkle Patricia Trie for string key-value storage in pure Standard ML: prefix queries, fold/map/filter, union, bulk ops, and cryptographic root hashing (MLton + Poly/ML).
  • sml-x25519 - Curve25519 Diffie-Hellman key exchange (RFC 7748) in pure Standard ML.
  • sml-x509 - Pure Standard ML X.509 certificate parser and RSA signature verifier (MLton + Poly/ML, deterministic).
  • sml-xxhash - XXH32 and XXH64 non-cryptographic hashing in pure Standard ML.

Blockchain & cryptocurrency

Bitcoin, Ethereum and related ledger/encoding primitives. 7 libraries.

  • sml-base58 - Base58 and Base58Check codec for Standard ML (Bitcoin alphabet, double-SHA256 checksum). Pure, dual-compiler.
  • sml-bech32 - Bech32 and Bech32m encoding with SegwitAddr support in pure Standard ML (BIP-173/350).
  • sml-bip32 - Pure Standard ML BIP-32 hierarchical deterministic wallets (private-tree CKDpriv + neuter, P2PKH) (MLton + Poly/ML).
  • sml-bip39 - Pure Standard ML BIP-39 mnemonic seed phrases (PBKDF2-HMAC-SHA512) (MLton + Poly/ML).
  • sml-rlp - Recursive Length Prefix (RLP) encoder/decoder for Ethereum in pure Standard ML.
  • sml-script - Bitcoin Script stack machine interpreter (subset) in pure Standard ML.
  • sml-utxo - Bitcoin-style UTXO model in Standard ML: transaction validation, fees, balances, and atomic block application.

Media containers & codecs

Image, audio and video container formats and codec parsers: JPEG baseline decoding, FLAC and Ogg framing, RIFF chunks, ISO BMFF (MP4) box scanning, and Matroska/EBML header detection. 6 libraries.

  • sml-flac - A FLAC metadata and frame-header parser for Standard ML (STREAMINFO + frame parsing; LPC residual decoding is a documented stub).
  • sml-jpeg - JPEG metadata parser in Standard ML: dimensions, frame info, segment enumeration, JFIF density, comments, and best-effort EXIF orientation.
  • sml-mkv - Matroska / WebM (EBML) primitives for Standard ML: VINT decoding, element id/size, and a top-level element scanner.
  • sml-mp4 - MP4/ISO-BMFF box parser in Standard ML: byte-accurate box tree, find/path navigation, payload slicing, and typed ftyp/mvhd/tkhd/mdhd parsing.
  • sml-ogg - Ogg container page segmentation with lacing-table parsing for Standard ML.
  • sml-riff - A RIFF container chunk reader/writer (WAV, AVI, WebP) for Standard ML.

Encoding, serialization & compression

Wire formats, text/binary codecs, structured-data parsers, and compression algorithms. 36 libraries.

  • sml-base32 - Pure Standard ML Base32 codec: RFC 4648, base32hex, Crockford, z-base-32 (MLton + Poly/ML).
  • sml-bencode - BitTorrent bencode encoder/decoder in pure Standard ML with canonical dictionary ordering. Deterministic, MLton + Poly/ML.
  • sml-cbor - CBOR (Concise Binary Object Representation) encoder/decoder in pure Standard ML (RFC 8949).
  • sml-css - Typed CSS model in pure Standard ML: selector/declaration/stylesheet algebra with a deterministic serializer and a round-tripping parser. Dual-compiler (MLton + Poly/ML), byte-identical, zero deps.
  • sml-csv - A Standard ML RFC 4180 CSV/TSV parser and writer with full quoting and escaping.
  • sml-deflate - RFC 1951 DEFLATE inflate + RFC 1950/1952 zlib/gzip wrappers for Standard ML. Verified against known compressed vectors. Pure, dual-compiler.
  • sml-float - IEEE-754 float <-> bytes codec (f16/bf16/f32/f64, little- and big-endian) in pure Standard ML.
  • sml-gemini - Pure Standard ML codec for the Gemini protocol and gemtext markup — dependency-free, MLton + Poly/ML.
  • sml-geohash - Geohash encode/decode with neighbors in pure Standard ML.
  • sml-gif - Pure Standard ML animated GIF encoder (LZW + median-cut palette) (MLton + Poly/ML).
  • sml-gzip - A Standard ML gzip (RFC 1952) container codec over DEFLATE/INFLATE with CRC32 verification.
  • sml-hex - Hexadecimal encode/decode in Standard ML: strict and tolerant decode (whitespace/0x), digit and byte helpers, and xxd-style hexdump.
  • sml-inflate - DEFLATE/zlib/gzip decompression for Standard ML (MLton + Poly/ML): RFC 1950/1951/1952, CRC-32 and Adler-32, fixed and dynamic Huffman. Pure, FFI-free.
  • sml-json - Self-contained JSON parser + serializer for Standard ML, built on (vendored) sml-parsec.
  • sml-jsonpatch - JSON Patch (RFC 6902) and JSON Pointer (RFC 6901) in pure Standard ML.
  • sml-jsonpath - Pure Standard ML JSONPath query engine over sml-json (MLton + Poly/ML).
  • sml-lz4 - Pure Standard ML LZ4 block-format compressor and decompressor (zero dependencies, MLton + Poly/ML).
  • sml-msgpack - MessagePack binary serialization (spec v2.0) in pure Standard ML.
  • sml-openapi - Typed OpenAPI 3.0 model with YAML + JSON parsing and serialization in pure Standard ML (MLton + Poly/ML).
  • sml-pdf - Pure Standard ML PDF generator: page tree, vector graphics, Core-14 base fonts, FlateDecode - no font embedding.
  • sml-pg - Pure Standard ML PostgreSQL wire-protocol v3 codec: encode/decode frontend + backend messages with a streaming-friendly decoder (MLton + Poly/ML).
  • sml-protobuf - Protocol Buffers wire-format codec for Standard ML (varint, zigzag, length-delimited, fixed32/64). Pure, dual-compiler.
  • sml-punycode - Punycode (RFC 3492) encoder and decoder in pure Standard ML.
  • sml-qrcode - Pure Standard ML QR code generator (Reed-Solomon GF(256) + masking) (MLton + Poly/ML).
  • sml-schema - JSON Schema (draft 2020-12) parser and validator in pure Standard ML, built on sml-json (MLton + Poly/ML).
  • sml-sexp - S-expression reader/writer (Lisp/Scheme atoms, lists, quote forms; line + block comments) for Standard ML, built on sml-parsec. Pure, dual-compiler.
  • sml-sqlite - Pure Standard ML reader for the SQLite database file format: B-tree pages, native varint, record codec - zero dependencies.
  • sml-sse - Pure Standard ML codec for Server-Sent Events (text/event-stream) — dependency-free, MLton + Poly/ML.
  • sml-suffixarray - Suffix arrays, Kasai LCP, Burrows-Wheeler transform/inverse, and SA substring search in pure Standard ML (MLton + Poly/ML).
  • sml-tar - Pure Standard ML POSIX ustar tar archive read/write (MLton + Poly/ML).
  • sml-toml - A Standard ML TOML parser and serializer (subset of v1.0.0) built on parser combinators.
  • sml-varint - Pure Standard ML variable-length integer codec: LEB128, zigzag, protobuf varints (MLton + Poly/ML, byte-exact).
  • sml-xml - Namespaced XML parser, DOM, and serializer for Standard ML (entities, CDATA, comments). Pure, dual-compiler.
  • sml-yaml - Subset YAML 1.2 parser (block + flow, multi-doc) in pure Standard ML.
  • sml-zip - Pure Standard ML PK ZIP archive read/write (store + deflate, CRC-32, central directory) (MLton + Poly/ML).
  • sml-zstd - Pure Standard ML Zstandard (RFC 8878) decompressor plus a raw-block compressor - zero dependencies.

Web, networking & protocols

HTTP and friends, web framework pieces, sockets, and internet protocols. 23 libraries.

  • sml-dns - Pure Standard ML DNS message wire codec with name compression, RFC 1035 (MLton + Poly/ML).
  • sml-dns-resolve - DNS stub resolver in pure Standard ML: TTL-aware LRU cache, CNAME chains, typed answers, built on sml-dns (MLton + Poly/ML).
  • sml-email - A MIME multipart email parser and serialiser for Standard ML.
  • sml-feed - Unified RSS 2.0 + Atom 1.0 feed parser and generator in pure Standard ML (MLton + Poly/ML).
  • sml-forms - Decode form/query/JSON bodies into typed values for Standard ML via a validation applicative that accumulates errors. Pure, dual-compiler.
  • sml-git - Pure Standard ML Git plumbing: object, packfile, index and ref formats (MLton + Poly/ML, deterministic).
  • sml-http - RFC 9110/9112 HTTP/1.1 message model for Standard ML: request/response records, case-insensitive headers, parser, chunked + Content-Length framing, CLI. Pure, dual-compiler.
  • sml-http2 - HTTP/2 framing + HPACK header compression in pure Standard ML, verified against RFC 7541 vectors (MLton + Poly/ML).
  • sml-httpc - Pure sans-IO HTTP/1.1 client state machine in Standard ML (request builder + incremental response/chunked decoder + redirect logic). Dual-compiler (MLton + Poly/ML).
  • sml-httpc-tool - Impure TCP socket driver + CLI for the pure sml-httpc HTTP/1.1 client. Quarantined IO tool (not dual-compiler-guaranteed); plain HTTP only.
  • sml-ipaddr - IPv4/IPv6 address parsing, CIDR arithmetic, and RFC 5952 canonical formatting in pure Standard ML (MLton + Poly/ML).
  • sml-middleware - Composable handler->handler middleware for Standard ML: compose, error catching, body limits, logging, headers, in-memory static files (glob). Pure, dual-compiler.
  • sml-mime - MIME for Standard ML: media-type parse/format (RFC 9110), multipart/form-data splitter+builder (RFC 7578), extension->MIME table. Pure, dual-compiler.
  • sml-mqtt - MQTT 3.1.1/5.0 packet codec + pure client state machine in pure Standard ML (MLton + Poly/ML), zero dependencies.
  • sml-negotiate - RFC 9110 proactive content negotiation for Standard ML: Accept / Accept-Encoding / Accept-Language parsing + q-value best-match. Pure, dual-compiler.
  • sml-redis - Pure Standard ML RESP protocol codec and Redis command builders (MLton + Poly/ML).
  • sml-robots - Pure Standard ML robots.txt parser and matcher (RFC 9309) — dependency-free, MLton + Poly/ML.
  • sml-router - Pure HTTP router for Standard ML: path patterns with :params and *wildcards, method dispatch, request->response handlers. Pure, dual-compiler.
  • sml-serve - Design doc (not a buildable library) for the MLton-only socket adapter that drives an sml-web app via sml-async: the one impure edge of the pure-SML web stack.
  • sml-smtp - SMTP (RFC 5321) codec, RFC 5322 message assembly, and a sans-IO client state machine in pure Standard ML (MLton + Poly/ML).
  • sml-uri - RFC 3986 URI + x-www-form-urlencoded for Standard ML: percent codec, parse/toString, reference resolution, query handling, CLI. Pure, dual-compiler.
  • sml-web - Umbrella of the pure-SML web stack: one request->response app wiring router + middleware + sessions + negotiation. Pure, deterministic, dual-compiler.
  • sml-ws - RFC 6455 WebSockets for Standard ML: Sec-WebSocket-Accept handshake, frame encode/decode, fragmentation reassembly. Verified against RFC vectors. Pure, dual-compiler.

Parsing & languages

Parsers, interpreters, term rewriting, logic programming and small language runtimes. 26 libraries.

  • sml-datalog - Datalog engine: semi-naive evaluation and stratified negation in pure Standard ML.
  • sml-earley - Earley parser for arbitrary context-free grammars in pure Standard ML.
  • sml-egraph - E-graphs and equality saturation in pure Standard ML.
  • sml-free - Free monad and interpreter pattern over a key/value DSL in pure Standard ML.
  • sml-glob - Shell-style glob matching for Standard ML (MLton + Poly/ML): *, ?, classes, escapes, case-insensitive, brace expansion, path-aware ** matching, filter/partition, and regex/literal introspection.
  • sml-graphql - GraphQL executable-document parser, AST and deterministic pretty-printer in pure Standard ML (MLton + Poly/ML).
  • sml-lambda - Untyped + simply-typed lambda calculus: parser, capture-avoiding substitution, normal-order reduction, STLC typechecker, in pure Standard ML (MLton + Poly/ML).
  • sml-lisp - A small functional Scheme interpreter in Standard ML (MLton + Poly/ML): closures, IntInf bignums, proper tail calls.
  • sml-markdown - CommonMark-subset Markdown parser in pure Standard ML, rendering to an sml-html node tree (MLton + Poly/ML).
  • sml-minikanren - Pure Standard ML miniKanren: relational logic programming (==, =/=, conde, fresh, run/reify) over fair streams (MLton + Poly/ML).
  • sml-packrat - Memoizing PEG (packrat) parser for Standard ML (MLton + Poly/ML): ordered choice, & / ! predicates, linear-time memoization.
  • sml-parsec - Parser combinators for Standard ML (MLton + Poly/ML), with position tracking and precise error reporting.
  • sml-plist - Apple property list (XML plist) parser and serializer in pure Standard ML.
  • sml-pratt - Pratt (top-down operator precedence) parser in pure Standard ML.
  • sml-prolog - Prolog interpreter core: unification, SLD resolution, cut in pure Standard ML.
  • sml-queryparse - Boolean search-query parser in Standard ML: AND/OR/NOT, implicit AND, phrases, field:term, eval, and De Morgan simplification.
  • sml-rederiv - A Standard ML regular-expression engine using Brzozowski derivatives, with search, replace, and bounded quantifiers.
  • sml-regex - A linear-time regular expression engine (Thompson NFA + Pike VM) with capture groups for Standard ML.
  • sml-rewrite - First-order term rewriting in pure Standard ML: unification, matching, LPO, critical pairs, and Knuth-Bendix completion (dual-compiler MLton + Poly/ML).
  • sml-sh - A tiny POSIX-ish shell line parser for Standard ML: quote-aware tokenizer and pipes / && / || / ; into a command AST.
  • sml-shglob - Shell glob matching in Standard ML: wildcards, character classes, ** globstar/path matching, escaping, case-insensitive, plus brace expansion with nesting and numeric ranges.
  • sml-ssg - Pure Standard ML static-site-generator core: frontmatter + markdown + template -> HTML (MLton + Poly/ML).
  • sml-template - Logic-light Mustache/Handlebars-style templating engine in pure Standard ML (MLton + Poly/ML), with HTML escaping.
  • sml-vdom - Virtual DOM in pure Standard ML: diff two sml-html trees into a minimal patch list with a round-tripping apply oracle. Dual-compiler (MLton + Poly/ML), byte-identical, deterministic.
  • sml-vm - A small stack-based bytecode VM, label-resolving assembler, and disassembler in pure Standard ML (MLton + Poly/ML).
  • sml-wasm - Pure Standard ML WebAssembly toolkit: binary .wasm decoder, .wat text parser, and a stack-machine interpreter.

Information retrieval & NLP

Full-text search, ranking, tokenization, language models and bioinformatics sequence tooling. 9 libraries.

  • sml-bio - Bioinformatics toolkit in pure Standard ML: FASTA/FASTQ parsing, reverse complement, GC content, Needleman-Wunsch & Smith-Waterman alignment. MLton + Poly/ML.
  • sml-bm25 - Okapi BM25 / TF-IDF document ranking in pure Standard ML, built on an inverted index. Deterministic, MLton + Poly/ML.
  • sml-bpe - Byte-pair encoding (BPE) subword tokenizer in pure Standard ML: train, encode, decode. Deterministic, MLton + Poly/ML.
  • sml-bytebpe - GPT-2 byte-level BPE tokenizer in pure Standard ML, conformance-tested against tiktoken.
  • sml-fts - A small full-text search index for Standard ML: analyzer, Porter stemming, inverted index, and AND/OR/phrase queries.
  • sml-gpt - GPT-2 inference in pure Standard ML — byte-identical on MLton and Poly/ML.
  • sml-invertedindex - Inverted index for full-text search in pure Standard ML: boolean queries (AND/OR/NOT) and positional phrase matching. Deterministic, MLton + Poly/ML.
  • sml-ngram - N-gram language models in pure Standard ML with add-k and interpolated backoff smoothing; perplexity. Deterministic, MLton + Poly/ML.
  • sml-stemmer - Porter and Snowball English word stemmer in Standard ML — full Porter steps 1a–5b, plus stem/stemAll convenience.

Formal methods & logic

Theorem proving, model checking, SAT/SMT solving and decision diagrams. 11 libraries.

  • sml-argumentation - Dung abstract argumentation frameworks: labelling and SAT engines in pure SML.
  • sml-bdd - Reduced ordered binary decision diagrams (ROBDDs) with a hash-consing manager, in pure Standard ML (MLton + Poly/ML).
  • sml-collision - 2D AABB, circle, and SAT convex polygon collision detection in pure Standard ML.
  • sml-fol - First-order logic: parser, Skolemization, tableaux and resolution provers in pure SML.
  • sml-logic - Propositional logic toolkit: parser, truth tables, tautology/SAT/equivalence, NNF/CNF/DNF, in pure Standard ML (MLton + Poly/ML).
  • sml-modal - Propositional modal logic (K/T/S4/S5): tableau and Kripke model engines in pure SML.
  • sml-modelcheck - Symbolic CTL model checking over finite Kripke structures in pure Standard ML, using the vendored sml-bdd ROBDD library. Dual-compiler MLton + Poly/ML.
  • sml-proof - Natural-deduction proof checker for classical propositional logic in pure Standard ML, built on the vendored sml-logic formula type. Dual-compiler MLton + Poly/ML.
  • sml-sat - DPLL SAT solver with a DIMACS CNF parser, in pure Standard ML (MLton + Poly/ML).
  • sml-sequent - Gentzen LK/LJ sequent calculi for propositional logic in pure Standard ML: proof search, derivation checker, cut elimination (MLton + Poly/ML).
  • sml-smt - Lazy DPLL(T) SMT solver in pure Standard ML over the vendored sml-sat DPLL core: EUF (congruence closure) + LRA (Fourier-Motzkin). Dual-compiler MLton + Poly/ML.

Math, numeric & scientific

Arbitrary precision, linear algebra, statistics, signal processing, physics, astronomy and other numerics. 79 libraries.

  • sml-acoustics - Pure Standard ML acoustics: dB/SPL conversions, A/C frequency weighting, Sabine/Eyring reverberation, inverse-square falloff, speed of sound (MLton + Poly/ML).
  • sml-ad-rev - Forward-mode automatic differentiation for Standard ML.
  • sml-annealing - Generic simulated annealing optimizer in pure Standard ML with configurable cooling schedules (seeded PRNG). Deterministic, MLton + Poly/ML.
  • sml-astro - Astronomy basics in pure Standard ML: Julian/Modified Julian dates, a Newton Kepler-equation orbit solver, and low-precision solar position (declination, equation of time). Deterministic, byte-identical on MLton and Poly/ML.
  • sml-atmosphere - Pure Standard ML US Standard Atmosphere 1976: temperature/pressure/density vs altitude, pressure-altitude inversion, speed of sound (MLton + Poly/ML).
  • sml-autodiff - Pure Standard ML automatic differentiation: forward (dual numbers) and reverse (tape) modes (MLton + Poly/ML, deterministic).
  • sml-bayesnet - Discrete Bayesian network inference via full enumeration for Standard ML.
  • sml-bigdecimal - Arbitrary-precision decimal arithmetic for Standard ML (Java BigDecimal style), built on IntInf with explicit rounding modes. Portable, tested on MLton and Poly/ML.
  • sml-blackbody - Pure Standard ML blackbody radiation: Planck spectral radiance, Wien displacement, Stefan-Boltzmann, CCT to CIE xy (MLton + Poly/ML).
  • sml-chem - Chemistry toolkit in pure Standard ML: periodic table, formula parser, molar mass, and stoichiometric equation balancing. Deterministic on MLton and Poly/ML.
  • sml-cluster - Clustering in pure Standard ML: k-means (k-means++), DBSCAN, and hierarchical agglomerative clustering. Deterministic, byte-identical on MLton and Poly/ML.
  • sml-combinatorics - Combinatorial enumeration and exact counting in pure Standard ML: permutations, combinations, partitions, Gray codes, Catalan/Stirling numbers (IntInf). MLton + Poly/ML.
  • sml-complex - Pure Standard ML complex numbers: arithmetic, exp/log/sqrt, powers, trig/hyperbolic and inverse functions, nth-roots, and polar form — deterministic across MLton and Poly/ML.
  • sml-constants - CODATA fundamental physical constants as typed, dimensioned quantities in pure Standard ML, built on sml-units (MLton + Poly/ML).
  • sml-coords - Pure Standard ML astronomical coordinate transforms: equatorial/ecliptic/horizontal/galactic frames, IAU 1976 precession, Bennett refraction, sidereal time (MLton + Poly/ML).
  • sml-decisiontree - CART decision trees in pure Standard ML for classification and regression (Gini, entropy, variance). Deterministic, MLton + Poly/ML.
  • sml-distrib - Probability distributions (pdf, cdf, and pure functional sampling via SplitMix64) for Standard ML.
  • sml-dsp - Frequency-domain DSP in pure Standard ML: windows, RBJ biquads, windowed-sinc FIR, IIR, FFT convolution, STFT/ISTFT (MLton + Poly/ML).
  • sml-epidemic - Pure Standard ML compartmental epidemic models: SIR/SEIR via fixed-step RK4, R0, herd-immunity threshold, peak finder (MLton + Poly/ML).
  • sml-fft - Fast Fourier Transform (FFT/IFFT, real-FFT, FFT convolution) for Standard ML. Radix-2 + Bluestein. Pure, dual-compiler.
  • sml-ga - Generic genetic algorithm optimizer in pure Standard ML: tournament selection, elitism, crossover, mutation (seeded PRNG). MLton + Poly/ML.
  • sml-geo - GeoJSON (RFC 7946) typed geometry model with parser, serializer, and bbox in pure Standard ML (MLton + Poly/ML).
  • sml-geodesy - WGS-84 geodesy in pure Standard ML: haversine, Vincenty geodesics, and UTM projection (MLton + Poly/ML).
  • sml-glm - Graphics linear algebra for Standard ML (MLton + Poly/ML): vec2/3/4, mat2/3/4, quaternions, transforms, projections. Column-major, OpenGL conventions, pure (no FFI).
  • sml-gmm - Gaussian Mixture Model fitting via Expectation-Maximization for Standard ML.
  • sml-gp - Gaussian-process regression with a squared-exponential (RBF) kernel for Standard ML.
  • sml-gpx - GPX waypoint reading/writing and great-circle distance for Standard ML.
  • sml-hmm - Hidden Markov Models in pure Standard ML: forward/backward, Viterbi, Baum-Welch. Built on a matrix library. MLton + Poly/ML.
  • sml-hungarian - Assignment problem (Hungarian/Kuhn-Munkres) and Hopcroft-Karp bipartite matching in pure Standard ML, integer arithmetic (MLton + Poly/ML).
  • sml-hydrology - Pure Standard ML engineering hydrology: rational method, SCS curve-number runoff, Manning flow, unit-hydrograph convolution (MLton + Poly/ML).
  • sml-interval - Pure Standard ML interval arithmetic: outward-rounded operations, elementary functions, width/midpoint/contains, interval-Newton root enclosure (MLton + Poly/ML).
  • sml-itersolve - Iterative linear solvers (Conjugate Gradient) for sparse systems in Standard ML.
  • sml-kalman - Linear Kalman filter and recursive least squares in pure Standard ML, over the vendored sml-matrix. Dual-compiler (MLton & Poly/ML), deterministic.
  • sml-knn - K-Nearest-Neighbors classification and regression in pure Standard ML, built on a k-d tree (majority vote / weighted averaging). MLton + Poly/ML.
  • sml-lunar - Pure Standard ML lunar model: Moon phase angle, illuminated fraction, phase name, lunar age, next new/full moon search (MLton + Poly/ML).
  • sml-magdec - Pure Standard ML geomagnetic field: spherical-harmonic Gauss coefficients to declination/inclination/intensity via Schmidt recurrence (MLton + Poly/ML).
  • sml-markov - Discrete-time Markov chains in pure Standard ML: n-step distributions, stationary distribution, and seeded trajectory sampling. Deterministic on MLton and Poly/ML.
  • sml-matrix - A Standard ML dense linear algebra library: multiply, transpose, LU, determinant, solve, inverse, QR.
  • sml-mcmc - MCMC samplers in pure Standard ML: Metropolis-Hastings and Gibbs with seeded PRNG (no ambient randomness). Deterministic, MLton + Poly/ML.
  • sml-money - Currency-aware money arithmetic in pure Standard ML on exact decimals: rounding modes and lossless allocation/splitting. MLton + Poly/ML.
  • sml-montecarlo - Seeded Monte-Carlo integration and estimation in pure Standard ML: 1-D/box integration, antithetic variates, and a pi estimate. Deterministic on MLton and Poly/ML.
  • sml-nbody - Barnes-Hut quadtree gravitational N-body in pure Standard ML: mass/center-of-mass quadtree, opening-angle force approximation, direct O(n^2) cross-check, symplectic leapfrog. Deterministic, byte-identical on MLton and Poly/ML.
  • sml-nn - Neural networks in pure Standard ML on reverse-mode autodiff: dense layers, activations, MSE/CE, SGD/Adam.
  • sml-numbertheory - Pure Standard ML number theory: sieve, factorization, CRT, totient, Jacobi (MLton + Poly/ML).
  • sml-ode - Pure Standard ML ODE integrators: Euler, RK4, adaptive RK45 (MLton + Poly/ML).
  • sml-optim - Unconstrained numerical optimization (gradient descent and Nelder-Mead) for Standard ML.
  • sml-orbit - Pure Standard ML orbital mechanics: vis-viva, circular/escape velocity, Hohmann and bi-elliptic transfers, Tsiolkovsky rocket equation, sphere of influence (MLton + Poly/ML).
  • sml-particle - SIR particle filter in Standard ML: configurable params, per-step traces, weighted statistics, and effective-sample-size diagnostics.
  • sml-pca - Principal Component Analysis in pure Standard ML via Jacobi eigen-decomposition: components, explained variance, transform. MLton + Poly/ML.
  • sml-pde - Finite-difference PDE solvers (heat: FTCS + Crank-Nicolson; wave: leapfrog) on 1-D/2-D grids in pure Standard ML over sml-matrix. Dual-compiler (MLton & Poly/ML).
  • sml-pharmaco - Pure Standard ML pharmacokinetics: one/two-compartment models, Bateman absorption, half-life/clearance/Vd, steady-state accumulation, AUC (MLton + Poly/ML).
  • sml-photometry - Pure Standard ML photometry: radiometric to photometric via CIE photopic curve, inverse-square illuminance, magnitude/flux relations (MLton + Poly/ML).
  • sml-physics - 2D rigid-body and particle physics in pure Standard ML: symplectic integrators (Verlet/leapfrog/semi-implicit Euler), projectile closed forms, and a bouncing rigid-body world. Deterministic, byte-identical on MLton and Poly/ML.
  • sml-poly - Univariate polynomials over an arbitrary ring for Standard ML, via a nesting Poly functor. Euclidean division and GCD over fields. Portable across MLton and Poly/ML.
  • sml-popgen - Pure Standard ML population genetics: Hardy-Weinberg, chi-square fit, allele/genotype frequencies, Fst, Wright-Fisher drift, linkage disequilibrium (MLton + Poly/ML).
  • sml-ppl - A probabilistic programming DSL with importance sampling and Metropolis-Hastings over a sampling stack for Standard ML.
  • sml-proj - Cartographic projections for Standard ML: Web Mercator (EPSG:3857) and equirectangular behind a projection type.
  • sml-psychro - Pure Standard ML psychrometrics: saturation vapor pressure, dew point, humidity ratio, iterative wet-bulb, moist-air enthalpy (MLton + Poly/ML).
  • sml-rational - Exact rational-number arithmetic for Standard ML, built on IntInf. Portable (Basis-only), tested on MLton and Poly/ML.
  • sml-safetensors - A pure Standard ML reader for the safetensors weight format — dequantizes f16/bf16/f32/f64 to reals.
  • sml-seismic - Pure Standard ML seismology relations: Gutenberg-Richter, moment magnitude, energy, PGA/MMI, P-S epicentral distance (MLton + Poly/ML).
  • sml-simplex - Linear and mixed-integer programming in pure Standard ML: two-phase simplex (Bland's rule) + branch-and-bound, dual-compiler (MLton & Poly/ML).
  • sml-sparse - Sparse matrices in Standard ML: COO/CSR formats, dense conversions, transforms, and sparse matrix-vector/matrix-matrix products.
  • sml-spatialjoin - Point-in-polygon testing and point-to-polygon spatial joins for Standard ML, with an optional R-tree-accelerated join.
  • sml-specfun - Pure Standard ML special functions: gamma, beta, erf, incomplete gamma/beta (MLton + Poly/ML, deterministic).
  • sml-spectrum - Pure Standard ML spectroscopy: wavelength/frequency/wavenumber/photon-energy conversions, Doppler and redshift, Rydberg hydrogen series (MLton + Poly/ML).
  • sml-stats - Pure Standard ML statistics: descriptive stats, distributions, regression, correlation, and hypothesis tests (t / chi-square / F) — MLton + Poly/ML.
  • sml-tensor - N-dimensional tensors in pure Standard ML: broadcasting, reshape/transpose, reductions, matmul, einsum.
  • sml-thermo - Pure Standard ML compressible-flow thermodynamics: isentropic ratios, area-Mach relation, normal-shock jump relations (MLton + Poly/ML).
  • sml-tides - Pure Standard ML harmonic tide synthesis: constituent summation, time-series prediction, high/low-water extrema (MLton + Poly/ML).
  • sml-tiles - Slippy-map (Web Mercator) tile math for Standard ML: lon/lat<->XYZ, tile bounds, quadkeys, and parent/children/neighbors.
  • sml-tle - Pure Standard ML NORAD TLE parser: checksum validation, mean-element decode, mean-motion propagation and semi-major axis (MLton + Poly/ML).
  • sml-topojson - TopoJSON-style coordinate quantization in Standard ML: scale/translate transforms, arc delta-encoding, and shared-arc extraction/reconstruction.
  • sml-transformer - Transformer building blocks (softmax, LayerNorm, GELU, multi-head causal attention, block) in pure Standard ML.
  • sml-tvm - Time value of money in pure Standard ML: PV, FV, NPV, IRR, PMT, amortization schedules. Deterministic, MLton + Poly/ML.
  • sml-units - Runtime dimensional analysis for Standard ML: dimension-checked physical quantities over the SI base units. Portable across MLton and Poly/ML.
  • sml-wav - Pure Standard ML WAV I/O and synth/DSP: oscillators, ADSR, biquad filters (MLton + Poly/ML).
  • sml-windchill - Pure Standard ML human-comfort weather indices: NWS wind chill, NOAA heat index, humidex, apparent temperature, dew point (MLton + Poly/ML).
  • sml-wkt - Well-Known Text (WKT) geometry parser & serializer in pure Standard ML, sharing the GeoJSON geometry AST. Deterministic, MLton + Poly/ML.

Data structures

Trees, heaps, tries, maps, sets and other persistent/efficient containers. 26 libraries.

  • sml-bitset - Portable packed bit-set for Standard ML (MLton + Poly/ML): persistent set algebra, popcount, ascending iteration, fixed 32-bit chunks.
  • sml-bloom - Bloom filter with optimal sizing and SHA-256 hashing in pure Standard ML.
  • sml-btree - Persistent B-tree in pure Standard ML (MLton + Poly/ML): polymorphic keys, delete with rebalancing, ordered queries (min/max/floor/ceiling/pred/succ), folds, range ops, invariant checks.
  • sml-buffer - Growable char buffer with rope-style concat for Standard ML (MLton + Poly/ML): truncate/reserve, typed appends (addInt/addChars/addLine), slices, update, fold/app over chars. Pure, deterministic.
  • sml-countmin - Count-Min sketch with heavy hitters in pure Standard ML.
  • sml-cuckoofilter - Cuckoo filter approximate set membership in pure Standard ML.
  • sml-deque - Purely functional double-ended queue for Standard ML (MLton + Poly/ML): banker's two-list deque, O(1) amortised both ends, plus map/folds/filter/append/equal/nth and non-rebalancing views.
  • sml-fenwick - Fenwick trees (BIT) and a lazy-propagation segment tree in pure Standard ML — persistent prefix/range sums, cumulative search, range-add/range-sum; dual-compiler (MLton + Poly/ML).
  • sml-fingertree - Persistent 2-3 finger tree (sequence/deque) in pure Standard ML (MLton + Poly/ML).
  • sml-graph - A Standard ML graph algorithms library: BFS, DFS, topological sort, SCC, MST, and max-flow.
  • sml-hamt - Persistent immutable hash map and vector (HAMT/CHAMP, 32-ary trie) for Standard ML, with structural sharing. Pure, dual-compiler.
  • sml-hyperloglog - HyperLogLog cardinality estimation in pure Standard ML.
  • sml-kdtree - Balanced k-d trees in pure Standard ML: nearest-neighbour, k-NN, box, and radius queries over real coordinates. Deterministic, byte-identical on MLton and Poly/ML.
  • sml-lru - Bounded LRU/LFU caches with optional TTL for Standard ML (functional, logical-clock based). Pure, dual-compiler.
  • sml-minhash - MinHash and SimHash similarity estimation in pure Standard ML.
  • sml-patricia - Compressed radix trie (Patricia tree) with longest-prefix match and prefix search in pure Standard ML. Pure, dual-compiler.
  • sml-pqueue - Purely functional priority queue (pairing heap) for Standard ML (MLton + Poly/ML): functor over ORDERED, persistent, O(1) merge/meldAll, takeMin, folds, raising and option peeks.
  • sml-rbtree - Persistent functional red-black maps and sets in pure Standard ML (polymorphic keys, MLton + Poly/ML).
  • sml-rope - Persistent text rope with insert/delete/replace, iteration (app/fold/map), line helpers, and Fibonacci rebalancing in pure Standard ML.
  • sml-rtree - R-tree spatial index in pure Standard ML: quadratic-split insertion, window/containment/point-stab/nearest queries over rectangles. Deterministic, byte-identical on MLton and Poly/ML.
  • sml-skiplist - Probabilistic skip list ordered map and set functor in pure Standard ML.
  • sml-tdigest - T-digest streaming quantile estimation in pure Standard ML.
  • sml-timewheel - Hierarchical timing wheel as a pure value in Standard ML: schedule, cancel, cascade, advance. Deterministic, MLton + Poly/ML.
  • sml-treap - Persistent seeded treap (randomized balanced BST) in pure Standard ML: insert/delete/split/merge, ordered map, invariant validators — deterministic and byte-identical on MLton and Poly/ML.
  • sml-unionfind - Disjoint-set / union-find for Standard ML (MLton + Poly/ML): union by rank + path compression, set sizes, components, merge-reporting union, and a functor over ordered elements. Pure.
  • sml-zipper - Generic list and rose-tree zippers in pure Standard ML (MLton + Poly/ML): tree structural edits + traversals (preorder/postorder/fold), list navigation (moveTo/start/toEnd), maps and folds.

Algorithms

Graph, string, search and optimization algorithms not tied to a single data structure. 16 libraries.

  • sml-astar - Generic A* and Dijkstra pathfinding with 2D grid support in pure Standard ML.
  • sml-bvh - Bounding-volume hierarchy in Standard ML: AABB primitives, ray/box intersection, median-split BVH build, traversal, and nearest-neighbor queries.
  • sml-clipper - 2D polygon geometry in Standard ML: area/centroid/bbox, point-in-polygon, convex hull, and Sutherland-Hodgman convex intersection/union.
  • sml-csolver - Finite-domain constraint solver (CSP) in pure Standard ML: AC-3 arc consistency + backtracking. N-queens, Sudoku. MLton + Poly/ML.
  • sml-diff - Myers O(ND) sequence diff for Standard ML: edit scripts, LCS, edit distance, and line-oriented text diffing. Portable across MLton and Poly/ML.
  • sml-dp - Dynamic-programming toolkit in pure Standard ML: knapsack, LIS, coin change, matrix-chain, interval scheduling (MLton + Poly/ML).
  • sml-editdist - String edit-distance metrics in Standard ML: Levenshtein (configurable costs), OSA, true Damerau–Levenshtein, Hamming, LCS, Jaro/Jaro–Winkler, ratios, bounded.
  • sml-fuzzy - Fuzzy string matching for Standard ML: Levenshtein/Damerau distance, similarity ranking, BK-tree, and Soundex. Pure, dual-compiler.
  • sml-geom2d - Constructive 2D computational geometry in pure Standard ML: convex hull, Delaunay triangulation, polygon clipping, area/centroid — deterministic and byte-identical on MLton and Poly/ML.
  • sml-hull3 - 3D convex hull computation producing a triangulated hull mesh for Standard ML.
  • sml-levauto - Levenshtein edit distance and dictionary fuzzy search for Standard ML.
  • sml-mincostflow - Minimum-cost maximum-flow in pure Standard ML via successive shortest augmenting paths (SPFA). Cost-aware extension over a graph library. MLton + Poly/ML.
  • sml-puzzles - Classic puzzle solvers (N-Queens, Hanoi, Lights Out, Peg Solitaire) in pure Standard ML.
  • sml-stringalgo - Classic string matching & analysis in pure Standard ML: KMP, Z-function, Boyer-Moore, Rabin-Karp, Aho-Corasick, Manacher (MLton + Poly/ML).
  • sml-sudoku - Deterministic 9x9 Sudoku constraint solver (candidate elimination + MRV backtracking) in pure Standard ML for MLton and Poly/ML.
  • sml-voronoi - A 2D Voronoi diagram generator via half-plane intersection for Standard ML.

Graphics, geometry & imaging

2D/3D math, rasterization, image codecs, fonts, color, layout and plotting. 18 libraries.

  • sml-camera - Scene math for Standard ML (MLton + Poly/ML): transforms (TRS), camera view/projection, frustum culling, and ray/AABB/sphere/triangle intersection. Built on sml-glm, FFI-free.
  • sml-canvas2d - Pure-SML immediate 2D drawing-command model rendering one scene to both a raster image (sml-raster/sml-image) and SVG. Deterministic, byte-identical on MLton and Poly/ML.
  • sml-color - Color-space math for Standard ML (MLton + Poly/ML): sRGB/linear, HSL/HSV, RGBA8 packing, gamma, blending, interpolation. Deterministic and FFI-free.
  • sml-colorsci - CIE colour-science extensions (XYZ, xyY, CIELUV, CIE94, Bradford adaptation, CCT) on top of sml-color, in pure Standard ML for MLton and Poly/ML.
  • sml-font - Pure Standard ML bitmap font (BDF) glyph rendering into sml-image (MLton + Poly/ML).
  • sml-image - Image codecs for Standard ML (MLton + Poly/ML): decode/encode PNM (PPM/PGM), BMP, TGA, and PNG (RGBA8). PNG built on vendored sml-inflate. Pure, FFI-free.
  • sml-layout - Pure-SML constraint/flexbox box-layout solver: box tree + viewport -> resolved rects (Row/Column, flex-grow, basis, padding/margin/gap, justify/align), byte-identical on MLton and Poly/ML.
  • sml-mesh - An indexed face-list polygon mesh with face normals, the Euler characteristic, and Catmull-Clark subdivision for Standard ML.
  • sml-netpbm - Netpbm (PBM/PGM/PPM) image reader and writer in pure Standard ML.
  • sml-noise - Procedural noise for Standard ML (MLton + Poly/ML): Perlin, simplex, value, and worley noise plus fbm/turbulence. Deterministic, seedable, pure (no FFI).
  • sml-obj - Mesh parsers for Standard ML (MLton + Poly/ML): Wavefront OBJ/MTL and PLY (ASCII + binary little-endian). Triangulates faces, emits sml-glm vertex/index buffers. FFI-free.
  • sml-plot - Pure Standard ML charting to PNG: line/bar/scatter/histogram with axes, ticks, and legend (MLton + Poly/ML).
  • sml-png - PNG decoder and encoder (8-bit RGB/RGBA) in pure Standard ML.
  • sml-qoi - Pure Standard ML QOI (Quite OK Image) encoder/decoder (MLton + Poly/ML).
  • sml-raster - Pure Standard ML 2D rasterizer: lines, rects, circles, triangles, polygons into RGBA8 images (MLton + Poly/ML).
  • sml-svg - Pure Standard ML SVG document builder and pretty-printed serializer (MLton + Poly/ML).
  • sml-text-layout - Pure-SML Unicode-aware text layout: greedy line breaking, word wrap, and grapheme-cluster measurement on bitmap fonts. Deterministic, byte-identical on MLton and Poly/ML.
  • sml-ui - Pure, self-drawn immediate-mode GUI toolkit for Standard ML - deterministic, byte-identical rendering across MLton and Poly/ML, tested headlessly with golden images.

Audio & music

Synthesis, MIDI, music theory and audio file formats. 5 libraries.

  • sml-midi - Pure Standard ML Standard MIDI File (SMF) reader/writer: format 0 and 1, full event model, VLQ codec (MLton + Poly/ML).
  • sml-music - Pure Standard ML music theory: pitches, MIDI, frequencies, scales, chords, and key signatures (MLton + Poly/ML).
  • sml-score - Musical score data model in pure Standard ML, built on sml-music and sml-midi: rational beat durations, chords/scales, transposition, and Standard MIDI File rendering (MLton + Poly/ML).
  • sml-sequencer - Step/event sequencer and drum machine in pure Standard ML on sml-midi + sml-music: grid patterns, GM drums, Euclidean (Bjorklund) rhythms, and Standard MIDI File output (MLton + Poly/ML).
  • sml-synth - Higher-level music synthesis in pure Standard ML: wavetable, additive & FM synthesis, voices/ADSR, polyphonic mixdown, WAV export (MLton + Poly/ML).

Games & simulation

Game-dev building blocks: ECS, AI, procedural generation, collision and cellular automata. 20 libraries.

  • sml-automata - Cellular automata in pure Standard ML: Wolfram elementary rules and Conway's Game of Life (MLton + Poly/ML).
  • sml-backgammon - Backgammon engine: legal moves, pip count, bear-off in pure Standard ML.
  • sml-bsp - Binary Space Partitioning dungeon generator with rooms and corridors in pure Standard ML.
  • sml-checkers - English draughts (checkers) with mandatory captures and search in pure Standard ML.
  • sml-chess - Pure Standard ML chess core: fully legal move generation, perft, FEN, UCI, and a negamax search (MLton + Poly/ML).
  • sml-connect4 - Connect Four engine with alpha-beta search in pure Standard ML.
  • sml-dice - RPG dice notation evaluator with exact distributions in pure Standard ML.
  • sml-ecs - Entity-Component-System with generational entity IDs, sparse component stores, and multi-component queries/joins in pure Standard ML.
  • sml-fov - Symmetric recursive shadowcasting field-of-view (Euclidean/Chebyshev/Manhattan radius) + Bresenham line-of-sight and explored-tile memory, in pure Standard ML.
  • sml-fsm - Finite state machines and behavior trees in Standard ML (MLton + Poly/ML): data-driven tables, recognizers, bounded history, Graphviz export, a Mealy machine, and BT decorators (cooldown/timeout/parallel).
  • sml-gametree - Generic adversarial game-tree search (negamax/alpha-beta/PVS/IDAB) in pure Standard ML.
  • sml-go - Go board-game engine: Tromp-Taylor rules, Zobrist hashing, GTP in pure Standard ML.
  • sml-mancala - Kalah (Mancala) with sowing, captures, extra turns, and search in pure Standard ML.
  • sml-maze - Seeded maze generation (DFS/Prim/Kruskal/Wilson) and solving in pure Standard ML.
  • sml-nim - Nim and Sprague-Grundy combinatorial game theory in pure Standard ML.
  • sml-othello - Reversi/Othello engine with disc flipping and alpha-beta search in pure Standard ML.
  • sml-poker - 7-card poker hand evaluator in pure Standard ML.
  • sml-roguelike - Roguelike building blocks (Brogue-style flow maps, autotiling, deterministic seeded placement) on top of sml-astar, in pure Standard ML for MLton and Poly/ML.
  • sml-tictactoe - M,n,k-game (tic-tac-toe/gomoku) with perfect-play minimax search in pure Standard ML. MLton + Poly/ML.
  • sml-tween - 30 easing functions and keyframe timeline tweening in pure Standard ML.

Concurrency, effects & systems

Async runtimes, structured concurrency, effect handlers, FRP, resilience, observability and distributed-systems building blocks. 25 libraries.

  • sml-actor - Cooperative actor model in Standard ML on sml-chan mailboxes: become/stop/self, ask-reply, supervision, and a deterministic run-to-quiescence scheduler.
  • sml-async - A portable, deterministic async library for Standard ML (scheduler + futures + async monad), running identically on MLton and Poly/ML.
  • sml-chan - Buffered FIFO channels in Standard ML: amortized O(1) two-list queue, bounded channels, and a cooperative run-to-completion scheduler.
  • sml-circuit - Resilience primitives in pure Standard ML: circuit breaker, retry with backoff + jitter, rate limiter, bulkhead (MLton + Poly/ML).
  • sml-consistenthash - Consistent hashing ring with virtual nodes in pure Standard ML (CRC32-based). Minimal remapping on membership change. MLton + Poly/ML.
  • sml-crdt - A Standard ML library of state-based CRDTs: G-Counter, PN-Counter, LWW-Register, and OR-Set.
  • sml-cron - Cron expression parser & schedule calculator in pure Standard ML: next/prev firing times. Time is an input. MLton + Poly/ML.
  • sml-csp - CSP channels and structured concurrency in pure Standard ML on a deterministic virtual-time scheduler.
  • sml-effects - Algebraic effects and handlers (State/Reader/Writer/Exception/Nondet) via a free-monad tree in pure Standard ML.
  • sml-gossip - SWIM-style gossip membership & failure detection simulated as a pure deterministic state machine in Standard ML (seeded PRNG). MLton + Poly/ML.
  • sml-hlc - Hybrid logical clocks (HLC) in pure Standard ML: physical+logical timestamps with bounded drift. Physical time is an input. MLton + Poly/ML.
  • sml-lens - Concrete getter/setter optics (lenses, prisms, traversals, isos) in pure Standard ML.
  • sml-log - Leveled structured logging for Standard ML (MLton + Poly/ML): logfmt + JSON renderers, withFields child loggers, tee/filter sinks, parseLevel/setLevel, and a deterministic capturing sink. Pure.
  • sml-metrics - Prometheus-style counters, gauges, histograms + text exposition in pure Standard ML (MLton + Poly/ML).
  • sml-otel - OpenTelemetry trace/span model in Standard ML: timing, attributes, events, status/kind, sampling, W3C traceparent propagation, span forest, and JSON export.
  • sml-prom - Prometheus text exposition format for Standard ML: typed counter/gauge/histogram builders, name validation, float formatting.
  • sml-raft - Raft consensus as a pure deterministic state machine in Standard ML: leader election, log replication, commit quorum (MLton + Poly/ML).
  • sml-ratelimit - Rate limiters as pure values in Standard ML: token bucket, leaky bucket, sliding window. Time is an input. MLton + Poly/ML.
  • sml-recscheme - Recursion schemes (cata/ana/para/hylo) over functor fixpoints in pure Standard ML.
  • sml-signal - Pure deterministic FRP: signals and events with hold/snapshot/switch/accumE/lift and incremental foldp, byte-identical on MLton and Poly/ML.
  • sml-stm - Single-threaded software transactional memory in pure Standard ML (MLton + Poly/ML): all-or-nothing rollback, orElse/retry/check, atomicallyOpt/runOrRetry, stateTVar, and commit-time invariants.
  • sml-stream - Pure Standard ML lazy streams (MLton + Poly/ML): fair interleave, generators (unfold/iterate/repeat/cycle), zip/zipWith, slicing (take/drop/While), folds, and uncons/head/tail/nth.
  • sml-trace - OpenTelemetry-aligned tracing in pure Standard ML: spans, W3C traceparent codec, OTLP/JSON export (MLton + Poly/ML).
  • sml-transducer - Composable, fused transducers in pure Standard ML (MLton + Poly/ML): map/filter/take/mapcat/dedupe/distinct/partitionAll/interpose/keep/indexed variants, a completion flush hook, and list/string/array runners.
  • sml-vectorclock - Vector clocks for causal ordering in distributed systems, pure Standard ML: tick, merge (LUB), and happens-before comparison. Deterministic, MLton + Poly/ML.

Databases & storage

Key-value stores, embedded databases and query engines. 7 libraries.

  • sml-kv - Pure Standard ML log-structured key/value store (MLton + Poly/ML): append-only log, replay, tombstone-aware merge, fold/foldRange, and SSTable blocks with binary-search range/prefix.
  • sml-mvcc - Multi-version concurrency control store as a pure value in Standard ML: snapshot isolation, first-committer-wins, GC. MLton + Poly/ML.
  • sml-pager - Database buffer pool / page cache in pure Standard ML built on an LRU policy: dirty tracking, flush, eviction stats. MLton + Poly/ML.
  • sml-sheet - A pure Standard ML spreadsheet engine: A1 addressing, recursive-descent formula parser, and dependency-ordered recalc with cycle detection (MLton + Poly/ML).
  • sml-sql - Pure in-memory SQL query engine (tokenizer + recursive-descent parser + evaluator) in Standard ML, no dependencies.
  • sml-wal - Write-ahead log as a pure value in Standard ML: CRC32-framed records, checkpointing, and crash-safe replay. Byte-identical on MLton + Poly/ML.
  • sml-xlsx - Pure Standard ML .xlsx (Office Open XML) reader/writer: sheets, shared strings, formulas.

GUI, terminal & application UI

Windowing, immediate-mode GUIs, TUIs and UI architectures. 5 libraries.

  • sml-ansi - ANSI/VT escape-sequence parser and renderer in Standard ML: cursor/erase/scroll/save-restore CSI, 256-color and truecolor SGR builders, fragment render, and strip.
  • sml-tea - The Elm Architecture in pure Standard ML: Model-View-Update with zero-FFI server-side rendering, sml-vdom patches, sml-css styling, and sml-signal subscriptions. Dual-compiler (MLton + Poly/ML), byte-identical, deterministic.
  • sml-tui - Pure Elm-architecture terminal UI toolkit for Standard ML: declarative widgets, an immutable screen buffer, and ANSI rendering with zero FFI (MLton + Poly/ML).
  • sml-vt - Terminal screen emulator in Standard ML: attributed cell grid with per-cell color, line wrap, scrolling, erase line/screen, cursor positioning, and ANSI color output.
  • sml-window - Impure minifb desktop-window backend for the pure sml-ui toolkit: opens a real OS window and runs the live interactive widget demo (MLton FFI, macOS). Quarantined impure tool.

Text, Unicode & utilities

Unicode handling, date/time, configuration, randomness and IDs. 13 libraries.

  • sml-cli - A Standard ML declarative command-line argument parser with subcommands and auto-generated help.
  • sml-collate - Unicode-aware string collation for Standard ML: diacritic stripping and multi-level (primary/secondary/tertiary) compare.
  • sml-config - Typed config for Standard ML from a pure key/value source (env/dotenv): real/char/oneOf/list/csv readers, validation (ensure/satisfy), scoping (prefixed/section), defaults, and schema checks. Pure, dual-compiler.
  • sml-datetime - Civil date arithmetic for Standard ML (MLton + Poly/ML): leap years, epoch days, addDays/diffDays, dayOfWeek, ISO-8601. Branch-free days-from-civil.
  • sml-ical - iCalendar (RFC 5545) VEVENT parsing and RRULE recurrence expansion for Standard ML.
  • sml-ini - INI configuration parser and serializer in pure Standard ML: sections, comments, quoted values, idempotent round-trip. MLton + Poly/ML.
  • sml-msgfmt - CLDR-style named cardinal plural rules and category selection for Standard ML.
  • sml-prng - Deterministic pseudo-random number generators for Standard ML (MLton + Poly/ML): SplitMix64, xoshiro256, PCG, uniform reals/ranges. Golden-vector tested, FFI-free.
  • sml-random - Splittable deterministic PRNG (SplitMix64) for Standard ML: tokens, nonces, session IDs. Reproducible seeded streams. Pure, dual-compiler.
  • sml-tzdb - Hand-coded timezone UTC-offset lookup in Standard ML with exact weekday-based DST transitions, isDst, zone abbreviations, and zone discovery.
  • sml-ulid - ULID lexicographically-sortable unique identifiers in pure Standard ML.
  • sml-unicode - Unicode utilities for Standard ML: UTF-8/UTF-16 codecs, NFC/NFD normalization, case folding, grapheme segmentation, and display width. Pure, dual-compiler.
  • sml-uuid - RFC 4122/9562 UUID parse, format, and generate for Standard ML (MLton + Poly/ML): v4 + v7, deterministic (caller-supplied randomness), I/O-free.

About

A curated list of Standard ML resources + an auto-generated index of the 380+ sjqtentacles sml-* ecosystem.

Topics

Resources

Contributing

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages