Standard Library Overview
Flame comes with a rich standard library (std.*) implemented directly in native Rust for maximum speed, system compatibility, and deterministic safety. All standard modules are ready for import without requiring external third-party dependencies.
Global Built-in Functions
Section titled “Global Built-in Functions”Flame provides several built-in global functions and assertion utilities available in every scope without importing any modules:
// Console Outputprint("Hello ")println("Flame!")eprint("Error logged to stderr\n")
// Assertions & Testing Utilitiesassert(1 + 1 == 2)assertTrue(true)assertFalse(5 < 3)assertEq("flame", "flame")assertNe(10, 20)Standard Module Index & Status
Section titled “Standard Module Index & Status”Formatting (std.fmt)String formatting and manipulation utilities.
JSON (std.json)High-performance streaming JSON parsing, serialization, and file I/O.
Environment Variables (std.env)Read and write system environment variables.
File System (std.fs)File reading, writing, and path manipulation.
Networking (std.net)TCP, UDP, HTTP, WebSockets, MQTT and JSON parsing.
WebSockets (std.net.ws)Full-duplex WebSocket client and server networking.
Process (std.process)Sub-process execution and working directory management.
OS Introspection (std.os)Operating system details and host properties.
Byte Manipulation (std.byte)Raw binary byte streams and buffer operations.
Desktop Automation (std.desktop)Cross-platform mouse control and keyboard input.
Window Management (std.window)Cross-platform desktop application window control and manipulation.
Threading (std.thread)Lightweight concurrency and message passing channels.
Time (std.time)High-precision timing, sleeping, and timestamps.
Math (std.math)Trigonometric functions, random numbers, and math utilities.
Unit System (std.unit)Dimensional analysis, physical quantities, and math with units.
Annotations & Metaprogramming (std.annotation)Target reflection, function references, and dynamic transformations.
Camera (std.camera)Webcam frame capture and video stream processing.
Web Applications (std.web)Fine-grained reactive UI, direct JS compilation, and browser APIs.
Importing Standard Modules
Section titled “Importing Standard Modules”Standard modules are imported using the std. namespace. Top-level expressions execute directly without requiring an entry point function:
import std.net.httpimport std.jsonimport std.fsimport std.byteimport std.osimport std.threadimport std.mathimport std.timeimport std.desktopimport std.fmtimport std.unit
println($"Running Flame on {os.name()} ({os.arch()})")