flame.toml Configuration
Every Flame application is configured using a flame.toml manifest file in the package root. It defines application or package metadata, compiler options, package dependencies, Rust plugins, and native crate bindings.
[package]name = "my_app"version = "0.1.0"type = "executable"
[options]closure-types = "default"rust-plugins = "default"
[dependencies]flamer = "https://github.com/sohamglx/flamer"local_helper = "./packages/helper"
[plugins]fast_hash = "./native/hash"
[native-dependencies]serde = "1.0"1. Package Metadata ([package])
Section titled “1. Package Metadata ([package])”Defines the core identity of the package.
| Field | Type | Description |
|---|---|---|
name |
String |
The unique name of your package or application. |
version |
String |
Semantic version string (e.g. "0.1.0"). |
type |
String |
"executable" for standalone executables, or "pkg" for distributable packages. |
authors |
Array<String> |
Optional list of package authors. |
target |
String |
Optional compilation target override. |
2. Compiler & Toolchain Options ([options])
Section titled “2. Compiler & Toolchain Options ([options])”The [options] section configures compiler checks, type strictness, and security boundaries.
closure-types
Section titled “closure-types”Controls the strictness of closure signature type checking:
[options]closure-types = "default" # "strict" | "default""default": Flexible type checking at call sites for closure signatures. Allows passing closures without rigid function-pointer type errors while still providing full IDE autocomplete and parameter type inference."strict": Enables strict compile-time signature checks. Verifies parameter count, parameter types, and return types, raising compile-time errors on any mismatch.- CLI Flag Equivalent: Pass
--strict-closurestoflame run,fmp run, orflame build.
rust-plugins
Section titled “rust-plugins”Controls whether Rust plugins, native crates, and C-ABI dependencies can be installed, imported, or executed:
[options]rust-plugins = "default" # "default" | "warn" | "deny"| Mode | Installation (fmp add) |
Import (import native...) |
Build & Execution |
|---|---|---|---|
"default" |
Allowed | Allowed without warnings | Full native compilation & linking |
"warn" |
Allowed with warning | Emits compiler warning | Permitted with warnings |
"deny" |
Blocked with error | Emits compile-time error | Completely blocked & skipped |
"default": Standard mode. Allows adding, downloading, importing, and compiling native Rust plugins and dependencies from crates.io or local workspaces."warn": Permissive audit mode. Allows native plugins to be imported and executed, but issues explicit compiler warnings whenever native code is imported or added:Useful when migrating codebases, auditing third-party code for native dependencies, or transitioning to pure Flame scripts.⚠ warning: importing native plugin 'native.bridge': rust-plugins is set to "warn" in flame.toml [options]"deny": Strict sandboxed mode. Fully disallows any native Rust dependencies, plugins, and imports:- Attempting to import any native module (e.g.
import native.bridgeorimport <plugin>) produces a compile error:✖ error: cannot import native plugin 'native.bridge': rust-plugins is set to "deny" in flame.toml [options]--> src/main.fm:1:1|1 | import native.bridge| ^^^^^^^^^^^^^^^^^^^^ native plugin import denied|= help: change `rust-plugins` in flame.toml [options] to "default" to allow Rust plugins fmp add --pluginandfmp add --nativeare blocked with an immediate error.- Native plugin compilation and linkage in
flame buildandflame runare skipped completely.
- Attempting to import any native module (e.g.
3. Flame Dependencies ([dependencies])
Section titled “3. Flame Dependencies ([dependencies])”The [dependencies] table lists pure Flame packages consumed by your application.
[dependencies]# GitHub repo URLflamer = "https://github.com/sohamglx/flamer"
# Relative local directoryutils = "./lib/utils"
# Pinned or wildcard versionhttp = "*"Managing Dependencies with fmp / flame
Section titled “Managing Dependencies with fmp / flame”fmp add https://github.com/sohamglx/flamerfmp remove flamerfmp install4. Native Rust Plugins ([plugins])
Section titled “4. Native Rust Plugins ([plugins])”Plugins provide high-performance, C-ABI native Rust extensions without linking collisions.
[plugins]server_native = "./native/server"Adding a Plugin
Section titled “Adding a Plugin”fmp add --plugin ./native/server# orfmp add -p ./native/serverWhen added:
fmpwrites the entry under[plugins].- Inspects
Cargo.tomlin the plugin directory. - Automatically compiles the Rust shared library and generates
.fmiinterface files.
5. Native Cargo Crates ([native-dependencies])
Section titled “5. Native Cargo Crates ([native-dependencies])”You can also bind directly to crates from crates.io under [native-dependencies]:
[native-dependencies]serde = "1.0"sha2 = "0.10"Adding a Native Crate
Section titled “Adding a Native Crate”fmp add --native serde# orfmp add -n serde