Skip to content

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.


Flame provides several built-in global functions and assertion utilities available in every scope without importing any modules:

// Console Output
print("Hello ")
println("Flame!")
eprint("Error logged to stderr\n")
// Assertions & Testing Utilities
assert(1 + 1 == 2)
assertTrue(true)
assertFalse(5 < 3)
assertEq("flame", "flame")
assertNe(10, 20)

File System (std.fs)

File reading, writing, copying, path verification, and recursive directory manipulation.


Production Ready

Byte Manipulation (std.byte)

Read, write, append, and seek raw binary byte streams directly from the filesystem.


Production Ready

Network Toolkit (std.net)

Complete async networking (TCP, UDP, HTTP, WebSockets, MQTT), DNS resolution, and native JSON parsing/serialization capabilities.


Production Ready

Process & OS (std.process, std.os, std.env)

Sub-process execution, working directory management, environment variables, and OS introspection.


Production Ready

Threading, Math & Time (std.thread, std.math, std.time)

Lightweight concurrency, message passing channels, high-precision timing, and trigonometric/math utilities.


Production Ready

Hardware & Automation (std.hardware, std.desktop)

System CPU/memory telemetry, cross-platform simulated mouse control, keyboard input, and hotkey execution.


Production Ready

Platform Devices (std.camera, std.bluetooth, std.hid, std.serial)

Webcam frame capture, Bluetooth LE scanning, raw USB HID streams, and serial port device listing.


Production Ready

Formatting (std.fmt)

String formatting and manipulation utilities including positional and keyword arguments.


Production Ready

Standard modules are imported using the std. namespace. Top-level expressions execute directly without requiring an entry point function:

import std.net.http
import std.json
import std.fs
import std.byte
import std.os
import std.thread
import std.math
import std.time
import std.hardware
import std.desktop
import std.fmt
println($"Running Flame on {os.name()} ({os.arch()})")