Packages

Small core, userland packages.

The compiler keeps its built-ins to virtual modules for IO, threads, env, FFI and math. Everything else is an ordinary Coil package with an optional native library, added to your project through coil.toml.

Data formats

Encoders and decoders written in pure Coil.

  • json pure Coil

    JSON and JSONC.

    Strict RFC 8259 encode/decode, plus a JSONC mode that accepts comments and trailing commas. Errors carry line and column.

    use json::{Json, JsonValue, JsonError};
  • toml pure Coil

    TOML 1.0.

    Full TOML 1.0.0 syntax: dotted keys, multiline strings, datetimes, inline tables and arrays of tables.

    use toml::{Toml, TomlValue, TomlError};
  • msgpack pure Coil

    MessagePack.

    Binary encode/decode covering every MessagePack type, including extensions and timestamps.

    use msgpack::{Msgpack, MsgpackValue, MsgpackError};

Networking & security

Talk to the network, securely.

  • http pure Coil

    HTTP client and server.

    Class-oriented HTTP/1.1 client and server with connection pooling, HTTP/2, WebSockets, and HTTPS via tls.

    use http::client::Client;
  • tls native library

    TLS streams on rustls.

    A native library loaded with dload("tls") that attaches to ordinary io streams.

    use tls::{client, server};
  • crypto native library

    Hashing and secure randomness.

    sha256, random_bytes and constant-time ct_eq, backed by a native library loaded with dload.

    use crypto::{sha256, random_bytes, ct_eq};

Text, bytes & time

Everyday utilities.

  • regex native library

    PCRE2 regular expressions.

    PCRE2 bindings loaded through FFI: compile a pattern once, then match and find_all.

    use regex::{compile, find_all, Regex};
  • deflate pure Coil

    DEFLATE compression.

    RFC 1951 compress and decompress in pure Coil. Raw DEFLATE blocks only (no gzip or zlib wrapper).

    use deflate::{compress, decompress, DeflateError};
  • time native library

    Calendar and monotonic time.

    UTC timestamps, calendar periods, chrono-style format/parse and Instant for elapsed time.

    use time::{timestamp};
Example package

greet →

A minimal library consumed via spool. Start here to see how a package is laid out and linked.

use greet::hello;

Not sure whether something is a builtin? See What is not built in and the coil.toml reference for wiring packages into a project.

↑ ↓ navigate ↵ open