← flaris-lang.org

Libraries

46 add-on libraries, ready to import

Install a library once into your per-user libs folder — ~/.flaris/libs on macOS and Linux, %USERPROFILE%\.flaris\libs on Windows — and import it by name from any script, no --libs flag needed. (You can also just drop a .flx next to a script for one-off use.) Each library ships source and pre-compiled bytecode. Libraries marked --unsafe require the unsafe flag at runtime. Download the .fls source for inline documentation and usage examples.

Every library here is open source under the MIT licence and written in Flaris itself — so they double as a substantial worked example of the language. Source, tests, the FFI plugin shims and the documentation all live in github.com/flaris-lang/flaris. Contributions and new libraries are welcome.

Browse the open source on GitHub ↗

46 libraries
AI Web & Network Ollama AI client - chat, streaming, JSON-mode, tool/function calling, vision input, embeddings, async, and model management. Requires a local Ollama server or an HTTP proxy for cloud endpoints.
import { AI, AIClient, AIConversation } from library("https://www.flaris-lang.org/libs/AI.flx", "1.0");
import { AI, AIClient, AIConversation } from library("AI", "1.0");
Argparse Tooling & Async Command-line argument parser in the style of Python's argparse - options, positionals, nargs, type conversion, choices, subcommands, mutually exclusive groups, and generated usage/help.
import { ArgumentParser } from library("https://www.flaris-lang.org/libs/Argparse.flx", "1.0");
import { ArgumentParser } from library("Argparse", "1.0");
Audio Graphics & Media Audio processing library: WAV I/O, envelope, gain & dynamics, and effects. Extends the Signals DSP base.
import { Audio } from library("https://www.flaris-lang.org/libs/Audio.flx", "1.0");
import { Audio } from library("Audio", "1.0");
BigInt Math & Numerics Arbitrary-precision integer arithmetic - add, mul, pow, mod, bitwise (and/or/xor/not/shifts), byte conversion, no overflow.
import { BigInt } from library("https://www.flaris-lang.org/libs/BigInt.flx", "1.0");
import { BigInt } from library("BigInt", "1.0");
BinaryIO Data & Storage Binary serialization - BinaryWriter/Reader, streaming and file variants. Little-endian default.
import { BinaryWriter, BinaryReader, BinaryStreamWriter, BinaryStreamReader, BinaryFileWriter, BinaryFileReader } from library("https://www.flaris-lang.org/libs/BinaryIO.flx", "1.0");
import { BinaryWriter, BinaryReader, BinaryStreamWriter, BinaryStreamReader, BinaryFileWriter, BinaryFileReader } from library("BinaryIO", "1.0");
BitConverter Text & Encoding Bit-level and byte-order conversion between numeric types.
import { BitConverter } from library("https://www.flaris-lang.org/libs/BitConverter.flx", "1.0");
import { BitConverter } from library("BitConverter", "1.0");
Cache Data & Storage LRU cache with configurable capacity and optional TTL - O(1) lookup, automatic eviction, hit/miss stats, JSON persistence (Save/Load), async GetOrSet.
import { Cache } from library("https://www.flaris-lang.org/libs/Cache.flx", "1.0");
import { Cache } from library("Cache", "1.0");
Complex Math & Numerics Complex number arithmetic - add, mul, div, magnitude, phase, polar form.
import { Complex } from library("https://www.flaris-lang.org/libs/Complex.flx", "1.0");
import { Complex } from library("Complex", "1.0");
Config Data & Storage TOML, YAML and .env configuration parser - strings, ints, floats, bools, arrays, sections, dotted keys, ${VAR} interpolation.
import { Config } from library("https://www.flaris-lang.org/libs/Config.flx", "1.0");
import { Config } from library("Config", "1.0");
Connect Web & Network Connect RPC client (connectrpc.com) - gRPC-compatible unary calls over plain HTTP/1.1, so no HTTP/2, no HPACK and no ALPN. Client and server, binary or JSON codec, so a call can be reproduced with curl. Verified both directions against connect-go. Takes its method descriptors straight from a .proto loaded by Protobuf at runtime; maps the sixteen Connect/gRPC status codes both ways. Verified against connect-go.
import { Connect, ConnectError, Code } from library("https://www.flaris-lang.org/libs/Connect.flx", "1.0");
import { Connect, ConnectError, Code } from library("Connect", "1.0");
ConsoleMenu Tooling & Async Interactive terminal menus with keyboard navigation and selection callbacks.
import { ConsoleMenu } from library("https://www.flaris-lang.org/libs/ConsoleMenu.flx", "1.0");
import { ConsoleMenu } from library("ConsoleMenu", "1.0");
CryptoKit Tooling & Async HKDF and PBKDF2 key derivation, HOTP/TOTP one-time passwords, Argon2id password hashing in PHC format, XChaCha20-Poly1305 envelopes, and streaming MD5/SHA-1/SHA-2/SHA-3/Keccak-256/SHAKE digests.
import { Kdf, Otp, Password, Envelope, Digest } from library("https://www.flaris-lang.org/libs/CryptoKit.flx", "1.0");
import { Kdf, Otp, Password, Envelope, Digest } from library("CryptoKit", "1.0");
CSV Data & Storage RFC 4180 compliant CSV parser and serializer - quoted fields, custom delimiters, TSV support, type inference, formula-injection escaping.
import { CSV } from library("https://www.flaris-lang.org/libs/CSV.flx", "1.0");
import { CSV } from library("CSV", "1.0");
Datetime Tooling & Async Parse, format, compare, and do arithmetic on dates, times, and durations - including timezones and business-day arithmetic (holidays).
import { DateTime, Duration } from library("https://www.flaris-lang.org/libs/Datetime.flx", "1.0");
import { DateTime, Duration } from library("Datetime", "1.0");
Decimal Math & Numerics Fixed-point decimal math for financial and precision-sensitive calculations.
import { Decimal } from library("https://www.flaris-lang.org/libs/Decimal.flx", "1.0");
import { Decimal } from library("Decimal", "1.0");
Deflate Compression DEFLATE compression and decompression (RFC 1951) in pure Flaris, with zlib (RFC 1950) and gzip (RFC 1952) framing. Dynamic-Huffman encoder and table-driven decoder, both JIT-compiled. Classes: Inflate, Deflate.
import { Inflate, Deflate } from library("https://www.flaris-lang.org/libs/Deflate.flx", "1.0");
import { Inflate, Deflate } from library("Deflate", "1.0");
Graph Collections Directed/undirected weighted graph - BFS/DFS, shortest-path (Dijkstra, A*, Bellman-Ford, Floyd-Warshall), MST (Kruskal, Prim), connectivity & components. Supports BigInt/Decimal weights.
import { Graph } from library("https://www.flaris-lang.org/libs/Graph.flx", "1.0");
import { Graph } from library("Graph", "1.0");
Graphics Graphics & Media 2D software rasteriser written in Flaris - shapes, text, image compositing and PNG output, with a stateful stroke/fill/thickness context.
import { Graphics } from library("https://www.flaris-lang.org/libs/Graphics.flx", "1.0");
import { Graphics } from library("Graphics", "1.0");
Http Web & Network HTTP/1.1 client - GET, POST, fiber-based async, cookie jar, multipart form builder, retry with backoff. Plain HTTP over TCP; add the Https library for TLS.
import { Http, Status, ContentType, CookieJar, Multipart, HttpError, HttpUnsupportedError } from library("https://www.flaris-lang.org/libs/Http.flx", "1.0");
import { Http, Status, ContentType, CookieJar, Multipart, HttpError, HttpUnsupportedError } from library("Http", "1.0");
Https Web & Network HTTPS client - injects a TLS byte-transport from the built-in Tls module (OS TLS stack: Secure Transport / OpenSSL / SChannel) into the Http engine, so all framing, chunked decoding, redirects, and cookies are shared. Certificate verification on by default. No --unsafe flag needed.
import { Https, Status, ContentType, CookieJar, Multipart } from library("https://www.flaris-lang.org/libs/Https.flx", "1.0");
import { Https, Status, ContentType, CookieJar, Multipart } from library("Https", "1.0");
HttpServer Web & Network HTTP/1.1 server written in Flaris on the Stream API - fiber per connection, keep-alive, chunked request bodies and streamed responses, routing with path params, static files. No --unsafe required.
import { HttpServer } from library("https://www.flaris-lang.org/libs/HttpServer.flx", "1.0");
import { HttpServer } from library("HttpServer", "1.0");
HttpUtil Web & Network HTTP wire parsing - URLs, query strings, form encoding, headers, chunked bodies and route patterns. Pure string work with no I/O except chunked decoding, which reads from a stream. No --unsafe required.
import { HttpUtil } from library("https://www.flaris-lang.org/libs/HttpUtil.flx", "1.0");
import { HttpUtil } from library("HttpUtil", "1.0");
Jwt Web & Network JSON Web Tokens - issue and verify compact JWTs (HS256, HS512, and EdDSA/Ed25519) in Base64url format.
import { Jwt } from library("https://www.flaris-lang.org/libs/Jwt.flx", "1.0");
import { Jwt } from library("Jwt", "1.0");
Lexer Text & Encoding General-purpose configurable lexer - tokenizes any source string with fluent rule builder. Words, numbers, quoted strings, line/block comments, keywords, multi-char operators, line/col tracking.
import { Lexer } from library("https://www.flaris-lang.org/libs/Lexer.flx", "1.0");
import { Lexer } from library("Lexer", "1.0");
Linq Collections Functional collection queries - map, filter, reduce, groupBy, orderBy, distinctBy, minBy/maxBy, countBy, stats (median, stddev, percentile).
import { Linq } from library("https://www.flaris-lang.org/libs/Linq.flx", "1.0");
import { Linq } from library("Linq", "1.0");
Logger Tooling & Async Structured leveled logging - debug/info/warn/error with timestamps, sinks (stdout/file/syslog), JSON output, and size-based file rotation.
import { Logger } from library("https://www.flaris-lang.org/libs/Logger.flx", "1.0");
import { Logger } from library("Logger", "1.0");
Modem Web & Network AT-command transport and cellular modem control over a serial port. Two layers: AT owns line framing, prompts, OK/ERROR/+CME terminators, per-command timeouts and unsolicited result codes, so it drives anything that speaks AT; Modem owns 3GPP semantics - SIM and PIN state, signal, registration, operator, SMS and data contexts. Nothing raises: every call returns a result object with ok, and on failure an error plus an errorKind ("timeout", "port", "modem", "usage"), so a timeout is reported as a timeout rather than as a failure.
import { AT, Modem } from library("https://www.flaris-lang.org/libs/Modem.flx", "1.0");
import { AT, Modem } from library("Modem", "1.0");
Numerics Math & Numerics Numerical toolkit: root finding (Newton/bisection/secant/find-all-roots), integration & differentiation, interpolation, statistics (distributions, regression, tests), linear algebra (LU/Cholesky solve, det, inverse), matrix & vector algebra, and multi-series Gfx charts. Classes: Numerics, Stats, LinAlg, Matrix, Vec, Chart. Hot loops are JIT-compiled kernels.
import { Numerics } from library("https://www.flaris-lang.org/libs/Numerics.flx", "1.0");
import { Numerics } from library("Numerics", "1.0");
Png Graphics & Media PNG encoder/decoder - every colour type and bit depth, all five filters, palette + tRNS. Adaptive row filtering makes files far smaller than a fixed filter.
import { Png } from library("https://www.flaris-lang.org/libs/Png.flx", "1.0");
import { Png } from library("Png", "1.0");
Postgres --unsafe Data & Storage PostgreSQL client via native FFI - query, params, transactions. Requires pg_ffi.c and --unsafe flag.
import { Postgres } from library("https://www.flaris-lang.org/libs/Postgres.flx", "1.0");
import { Postgres } from library("Postgres", "1.0");
Process Tooling & Async Subprocess management - run external programs, capture stdout/stderr, wait for exit.
import { Process, Spawn, Run, Shell } from library("https://www.flaris-lang.org/libs/Process.flx", "1.0");
import { Process, Spawn, Run, Shell } from library("Process", "1.0");
Promise Tooling & Async Promise chaining, combinators (all, race, any), and error propagation.
import { Promise } from library("https://www.flaris-lang.org/libs/Promise.flx", "1.0");
import { Promise } from library("Promise", "1.0");
Protobuf Data & Storage Protocol Buffers (proto3): wire codec plus a .proto reader. Encodes and decodes ordinary class instances; or load a .proto at runtime and get the classes built for you - no codegen, no compiler. Scalars, repeated/packed, maps, oneof, nested and recursive messages, service/rpc descriptors, unknown-field passthrough, and the ten standard google/protobuf well-known types built in. Canonical proto3 JSON both ways, so a message written here reads in Go, Java or TypeScript. Verified against the Go protobuf runtime.
import { Pb, PbWriter, PbReader } from library("https://www.flaris-lang.org/libs/Protobuf.flx", "1.0");
import { Pb, PbWriter, PbReader } from library("Protobuf", "1.0");
QRCode Graphics & Media Pure-Flaris QR code generator - versions 1–10, error correction L/M/Q/H, SVG and PNG output.
import { QRCode } from library("https://www.flaris-lang.org/libs/QRCode.flx", "1.0");
import { QRCode } from library("QRCode", "1.0");
Redis --unsafe Data & Storage Redis client via native FFI - strings, hashes, lists, pub/sub. Requires redis_ffi.c and --unsafe flag.
import { Redis } from library("https://www.flaris-lang.org/libs/Redis.flx", "1.0");
import { Redis } from library("Redis", "1.0");
Router --unsafe Web & Network HTTP server router with middleware pipeline - path params, method matching, path-safe static file serving, JWT/CORS/rate-limit helpers. Requires --unsafe flag.
import { Router, Response, JwtMiddleware, JwtSign, LoggerMiddleware, CorsMiddleware, RateLimitMiddleware } from library("https://www.flaris-lang.org/libs/Router.flx", "1.0");
import { Router, Response, JwtMiddleware, JwtSign, LoggerMiddleware, CorsMiddleware, RateLimitMiddleware } from library("Router", "1.0");
Signals Graphics & Media Digital signal processing - FFT, filters, synthesis, statistics. Float arrays in [-1.0, 1.0]. Base class for Audio.
import { Signals } from library("https://www.flaris-lang.org/libs/Signals.flx", "1.0");
import { Signals } from library("Signals", "1.0");
SQLite --unsafe Data & Storage SQLite client via native FFI - query, params, transactions. Requires sqlite_ffi.c and --unsafe flag.
import { SQLite } from library("https://www.flaris-lang.org/libs/SQLite.flx", "1.0");
import { SQLite } from library("SQLite", "1.0");
StringBuilder Text & Encoding Efficient incremental string construction - append, prepend, replace, join.
import { StringBuilder } from library("https://www.flaris-lang.org/libs/StringBuilder.flx", "1.0");
import { StringBuilder } from library("StringBuilder", "1.0");
Template Text & Encoding Mustache-style template engine - compile once, render with variables, conditionals, and loops.
import { Template } from library("https://www.flaris-lang.org/libs/Template.flx", "1.0");
import { Template } from library("Template", "1.0");
Test Tooling & Async Unit test framework - suites, beforeEach/afterEach, assertions (eq, deepEq, throws), skip support.
import { Test } from library("https://www.flaris-lang.org/libs/Test.flx", "1.0");
import { Test } from library("Test", "1.0");
Treemap Collections Sorted key-value map - keys in ascending order, O(log n) lookup/insert/delete, range queries O(log n + k).
import { TreeMap } from library("https://www.flaris-lang.org/libs/Treemap.flx", "1.0");
import { TreeMap } from library("Treemap", "1.0");
Util Text & Encoding Encoding, identifiers and comparison helpers in pure Flaris: Base64 / Base64url / Base32 / hex codecs (JIT-compiled byte kernels), RFC 4122 v4 and RFC 9562 v7 UUIDs, Nanoid, three-way and semantic-version comparison, npm-style version ranges, and Coalesce. Class: Util.
import { Util } from library("https://www.flaris-lang.org/libs/Util.flx", "1.0");
import { Util } from library("Util", "1.0");
WebSocket --unsafe Web & Network WebSocket client (RFC 6455) - text/binary frames, ping/pong, clean close. ws:// and wss:// (built-in TLS). Requires --unsafe flag.
import { WebSocket, Ws } from library("https://www.flaris-lang.org/libs/WebSocket.flx", "1.0");
import { WebSocket, Ws } from library("WebSocket", "1.0");
XML Data & Storage XML parser and builder - parses to node tree, elements, attributes, CDATA, and entity references.
import { XML } from library("https://www.flaris-lang.org/libs/XML.flx", "1.0");
import { XML } from library("XML", "1.0");
Zip Compression ZIP archives - read and write. Container (local headers, central directory, EOCD) built in Flaris; entry payloads use the built-in Compress DEFLATE codec. Interoperates with standard ZIP tools. Classes: Archive, ZipReader, ZipWriter.
import { Archive } from library("https://www.flaris-lang.org/libs/Zip.flx", "1.0");
import { Archive } from library("Zip", "1.0");