The Glide Book

A complete guide to Glide.

From glide run hello.glide to a multi-package service. Each chapter compiles to real working code, nothing is hand-waved. Written and maintained by Murillo Deolino.

33
Chapters
~568
Minutes
0.3.3
Glide
I

Foundations

Install the toolchain, learn the shape of the language, and write your first programs.

II

Errors & memory

How Glide handles failure and ownership — no exceptions, no lifetime annotations.

III

Types & traits

Modelling data with structs, enums, generics, and the trait system.

IV

Concurrency

M:N coroutines, channels, and select — the parallelism story.

V

Project

Modules, packages, the manifest, and shipping a real application.

VI

Standard library

A tour, then a chapter per module — strings, collections, math, time, files, JSON, regex, networking, and more.

09 6 min read

A tour of the standard library

A guided tour of the batteries Glide ships with: strings and vectors (built in), then hashmaps, iterators, math, time, files, environment, and JSON from `stdlib::*`. The functions you'll actually call.

  • Strings
  • Vectors
  • HashMaps
  • Math
10 16 min read

Prelude & built-ins

The always-in-scope prelude — printing, formatting, raw heap allocation, channels, CLI args, scheduler helpers, diagnostic macros, memory introspection, and the Pair<K,V> type.

  • Import
  • Public surface at a glance
  • Printing &amp; formatting
  • Channels
11 13 min read

Strings

Reference for Glide's built-in string type: inspection, search, slicing, splitting, transformation, and parsing methods.

  • Import
  • Method catalog
  • Inspection &amp; comparison
  • Searching
12 15 min read

Vector\<T>

Vector<T> API reference — growable owning array: construction, mutation, functional combinators, iterators, and element-typed reducers for i32/f64/string/bool.

  • Import
  • The struct
  • Construction
  • Element access &amp; mutation
13 13 min read

HashMap & Set

Reference for Glide's string-keyed HashMap<V> and string StringSet collections: insert, get, remove, iteration snapshots (keys/values/entries), map_values, and lifetime management.

  • Import
  • HashMap&amp;lt;V&amp;gt;
  • StringSet
  • Pair&amp;lt;K, V&amp;gt;
14 14 min read

Iterators

The stdlib::iter module — the Iterator trait, VecIter, and eager combinator helpers (map/filter/take/skip/fold/find/range/repeat) over Vector<T>.

  • Import
  • Public surface at a glance
  • The Iterator trait
  • Transformers — return a new *Vector&lt;U&gt;
15 11 min read

Math

Glide standard library math reference: libm float functions (sqrt, pow, trig, logs), the PI/E constants, and pure-Glide integer/float helpers (min/max/clamp, abs, sign, ipow, gcd, lcm).

  • Import
  • Surface at a glance
  • Constants
  • Floating-point functions
16 19 min read

Time

Standard-library time API — Duration spans, Time instants with civil components and formatting, the monotonic Stopwatch, RFC 3339 parsing, and the after/tick timer channels.

  • Import
  • Constants
  • Duration
  • Time
17 14 min read

Filesystem & I/O

Standard-library reference for stdlib::fs (files, directories, paths, binary I/O) and stdlib::io (stdin/stdout/stderr line and byte I/O).

  • Import
  • Reading files
  • Writing files
  • Existence, size &amp; type
18 17 min read

OS

Host machine and process identity — platform detection, process IDs, cwd, executable path, hardware info, standard directories, TTY checks, and a one-liner shell escape.

  • Import
  • Full catalog
  • Platform identity (compile-time, infallible)
  • Process identity
19 11 min read

Environment & CLI args

Per-process environment for Glide programs: CLI argument access, environment-variable lookup/mutation/enumeration, variable expansion, and process exit.

  • Import
  • Public surface at a glance
  • CLI arguments
  • Reading environment variables
20 15 min read

Process

Spawn and run subprocesses with argv-level control — capture stdout/stderr, set env and cwd, feed stdin, stream live pipes, and inspect exit codes and signals.

  • Import
  • Overview
  • Result and configuration types
  • Building a command
21 16 min read

JSON

JSON parsing, emitting, and the JsonValue tree — constructors, navigation, typed accessors, building, and the JsonBind trait.

  • Import
  • Public surface at a glance
  • Kind constants
  • The JsonValue struct
22 20 min read

Regex

stdlib::regex — a pure-Glide PCRE-like regular-expression engine: compile patterns, match/search/find/replace/split, captures (numbered and named), and the supported syntax (classes, quantifiers, anchors, backreferences, lookaround, flags).

  • Import
  • At a glance
  • Compiling patterns
  • Testing for a match
23 10 min read

Random

Pseudo-random number generation in Glide's standard library: the xorshift64* Rng generator, deterministic and clock seeding, and helpers for raw 64-bit values, non-negative ints, bounded ranges, uniform floats, and coin flips.

  • Import
  • Public surface at a glance
  • The Rng generator
  • Construction
24 13 min read

Encoding, crypto & compression

API reference for Glide's encoding, crypto and compression modules — base64, hex, ByteBuffer, SHA/HMAC hashes, gzip inflate and in-memory tar extraction.

  • Import
  • Public surface at a glance
  • base64
  • hex
25 18 min read

Logging

stdlib::log — structured leveled logger: log levels, info!/warn!/error! macros, the Logger/LoggerBuilder/LogSink/LogLine types, structured fields, output formats and sink configuration.

  • Import
  • Public surface at a glance
  • Levels, formats, timestamps, and sink kinds
  • Quick start: the global logger
26 13 min read

Synchronization

Synchronization primitives — Mutex<T>, Atomic, and WaitGroup for guarding shared state across coroutines.

  • Import
  • Overview
  • Mutex&amp;lt;T&amp;gt;
  • Atomic
27 14 min read

CLI: argparse & spinner

CLI building blocks — the ArgParser flag parser (string/int/bool flags, short+long forms, positionals, auto --help) and the stderr progress spinner.

  • Import
  • Public surface at a glance
  • argparse — overview
  • Flag value structs
28 89 min read

Networking, HTTP & URL

The full Glide networking stack — IPv4/IPv6 addressing and SocketAddr parsing, DNS resolution, TCP client and server, UDP with IPv4 multicast, raw sockets and ICMP ping/traceroute, TLS 1.2/1.3 over OpenSSL, WebSocket client, a complete HTTP/1.1 client (cookies, forms, multipart, JWT, gzip), an HTTP/1.1 server with method routing, typed extractors, middleware chains, CORS, static files, SSE and a reverse proxy, plus HTTP/2 and HTTP/3 clients and URL percent-encoding.

  • Import
  • Module map
  • IP &amp; socket addresses — IpAddr
  • DNS resolution — resolve
29 19 min read

Email (SMTP / IMAP / POP3)

Compose, send, and read email from Glide — build RFC 5322 messages with the Mail type, send over SMTP (STARTTLS / SMTPS, PLAIN / LOGIN auth), and read mailboxes over IMAP4rev1 or POP3.

  • Import
  • The Mail type
  • SMTP — sending
  • IMAP — reading &amp; flagging
30 20 min read

System & tooling

System & tooling reference — typed OS signal handling, runtime stack-trace capture, the compile-time meta (AST) surface for proc-macro authors, and the built-in lint codes plus the lint_code helper.

  • Import
  • Signals
  • Backtraces
  • Declarative macros (macro name!)
VII

Building applications

Put it together: an HTTP service, then tests and benchmarks to keep it honest.

VIII

Going lower

Reach below the language — call C, embed raw C, and write inline assembly.