Skip to content

Latest commit

 

History

History
97 lines (65 loc) · 5.12 KB

File metadata and controls

97 lines (65 loc) · 5.12 KB

Documentation

User guides

Libraries

34 libraries ship with the toolchain. The standard library is compiled into the compiler; extension libraries are added via m2.toml deps or -I paths.

Standard Library

  • m2stdlib — PIM4 + ISO standard library: InOut, Strings, Storage, MathLib, FileSystem, BinaryIO, Args, Terminal, RealInOut, STextIO, SWholeIO, SRealIO, SLongIO, SYSTEM

Graphics

  • m2gfx — SDL2-based graphics: windowing, 2D drawing, textures, fonts, pixel buffers, events

Networking

  • m2sockets — POSIX/BSD sockets: TCP/UDP with blocking and non-blocking I/O
  • m2tls — TLS transport layer wrapping OpenSSL/LibreSSL
  • m2stream — transport-agnostic byte streams: unifies TCP and TLS behind sync/async I/O
  • m2ws — WebSocket client (RFC 6455): text, binary, ping/pong frames over m2stream

HTTP

  • m2http — HTTP client: URI parsing, request/response, async I/O via m2stream
  • m2http2 — HTTP/2 framing and HPACK header compression, stream FSM, settings negotiation
  • m2http2server — HTTP/2 server: routing, middleware, TLS, connection and stream management

Services & Security

  • m2rpc — length-prefixed RPC framing over abstract byte transports
  • m2auth — authentication and authorization: JWT HS256, Ed25519 PASETO, policy engine, replay detection
  • m2oidc — OpenID Connect: OIDC discovery, JWKS key sets, RS256 JWT verification

Async & Concurrency

  • m2futures — promises/futures for single-threaded async: chaining, combinators (All, Race)
  • m2evloop — single-threaded event loop with I/O watchers and timers
  • m2pthreads — pthreads wrapper for M2+ concurrency: threads, mutexes, conditions

Database

  • m2sqlite — SQLite3 interface: prepared statements, caller-provided buffers
  • m2lmdb — LMDB key/value store: MVCC concurrency, zero-copy reads via memory-mapped B+ trees

Data Formats

  • m2json — SAX-style JSON tokenizer: zero-allocation streaming parser
  • m2fmt — output formatting: mini JSON writer, CSV encoder, text table renderer
  • m2conf — INI-style config file parser: [section] / key=value / # comment

Core

  • m2bytes — byte buffers and binary codec: growable Buf, zero-copy views, LE/BE/varint, hex
  • m2log — structured logging: multiple sinks (console, memory, file, stream), no heap alloc in log path
  • m2alloc — memory allocation: Arena (bump), Pool (fixed-block), no OS/C dependencies
  • m2hash — static hash table: open-addressing with FNV-1a hashing and linear probing
  • m2fsm — table-driven finite state machine: O(1) transitions, guards, actions, entry/exit hooks, trace
  • m2sys — C runtime shim: file I/O, process exec, SHA-256, tar, path utilities

Utilities

  • m2cli — CLI argument parser: flags, options, positional arguments
  • m2path — path string manipulation: normalize, split, join, match, relative paths
  • m2glob — gitignore-grade glob pattern matching: *, ?, [abc], **
  • m2regex — POSIX regex matching via system regex.h
  • m2text — text analysis: UTF-8 validation, encoding detection, line endings, text-vs-binary
  • m2tok — language-agnostic source tokenizer: strips strings/comments, yields identifiers
  • m2zlib — zlib compression/decompression: raw, zlib, and gzip formats
  • m2metrics — system metrics: load average, memory, CPU time, process RSS

Tools

  • m2dap — Debug Adapter Protocol server for M2-idiomatic IDE debugging
  • mxpkg — package manager: commands, manifest format, lockfile, dependency resolution

Reference

Project

Contributor guides