FractalPark
FRM language and compatibility

Understand FRM in FractalPark

Learn how canonical FRM-like v1 Definitions power published Standard formulas, then use the separate Classic-compatible Editor examples without confusing the two source contracts.

01

What Is FRM

FractalPark FRM-like v1 is the canonical, typed source language behind published Standard Definitions. A Definition pins its language, standard library, NumericProfile, parameters, initial state, repeated orbit step, and continue-iteration predicate.

Classic .frm grew out of the Fractint ecosystem and remains the source contract used by the Classic-compatible standalone Editor and import pipeline. FractalPark scans and diagnoses that dialect separately; Classic source and frmSemanticsVersion 1 or 2 are not alternate spellings of canonical FRM-like v1.

For the wider project's origins and history, see the Fractint project site.

02

FRM Support in FractalPark

This compatibility table describes the Classic-compatible Editor and import path. Canonical published Standard Definitions use the separately versioned FRM-like v1 parser, typed IR, standard32 backend, and fixed Safety Envelope.

LevelMeaningVerified scope
SupportedCovered by compiler tests and usable without a semantic qualification.
  • One formula declaration per source document
  • init, loop, and bailout sections
  • Assignments and user variables
  • Real and complex literals; arithmetic, comparison, logical, unary, and magnitude expressions
  • if / elseif / else / endif branches
  • z, c, pixel, zPrev, p1–p5, constants, and tested built-in functions
  • FRM comments
  • Structured diagnostics and FRM-to-GLSL source mapping
AdaptedAccepted with a documented semantic difference or as a FractalPark extension.
  • ismand maps to FractalPark's current Mandelbrot/Julia runtime mode
  • fn1–fn4 use compile-time function dispatch
  • @mode: native, @default-view, and @default-coloring are FractalPark extensions; default directives apply only in native mode
UnsupportedNot preserved by the current compiler or file workflow; rejected rather than silently rewritten.
  • Selecting among multiple formulas in one file
  • Automatic conversion of classic Fractint dialects
  • Arbitrary source directives
  • Non-ASCII identifiers
  • User-defined functions or macros
  • Preprocessor features
  • Any construct rejected by the current compile pipeline

This is a tested Classic compatibility baseline, not a claim of full Fractint compatibility. It is separate from the Standard publication ledger.

Verified compatibility

These Classic-import capability counts come from the versioned compatibility manifest: 588 target entries comprise 579 strict-v2 passes and 9 documented waivers; 117 separate entries are excluded with stable reasons. They do not count published FRM-like v1 Definitions.

Target entries
588
Strict-v2 passes
579
Documented waivers
9
Excluded with reasons
117
Bailout descriptor kinds
4
Built-in functions
20

Bailout descriptors

  • C1
  • C2
  • C4R
  • C5

Stable reject reasons

  • unknown-predicate
  • unknown-magnitude-form
  • threshold-not-loop-invariant
  • chained-logical

Built-in functions

  • sin
  • cos
  • tan
  • sinh
  • cosh
  • tanh
  • exp
  • log
  • sqrt
  • abs
  • sqr
  • conj
  • flip
  • recip
  • cabs
  • real
  • imag
  • atan2
  • cosxx
  • cotanh

Parameters: p1, p2, p3, p4, p5 · Function slots: fn1, fn2, fn3, fn4

Capability manifest v1 · strict semantics v2

03

Formula Anatomy

Canonical FRM-like v1 and the current Classic Editor examples share a named formula and the init, loop, and bailout ideas, but their complete grammars are different. In v1, semantic directives and an optional typed parameters section are also part of the Definition.

01

init:

Runs once for a pixel. Set the initial orbit value and any helper variables here.

02

loop:

Runs once per iteration. Update z and any state that the next iteration needs.

03

bailout:

Returns the condition for continuing the orbit. When it becomes false, the point has escaped.

The section names are structural, not comments: omitting or misspelling one produces a diagnostic.

04

Syntax Guide

Both surfaces stay deliberately small. The summaries below are shared concepts; use a published Formula Record's Source action for canonical directives and typed parameters, and use the Editor diagnostics for Classic source.

Declaration and sections
Wrap one named formula in braces, then write init:, loop:, and bailout: in that order.
Values and variables
Use real numbers such as 0.15, complex pairs such as (0.05, -0.02), built-in orbit values, or your own assigned variables.
Expressions
Arithmetic, powers, comparisons, logical operators, unary operators, |z| magnitude syntax, and tested complex functions can be combined.
Control flow
Use if, elseif, else, and endif when an orbit update depends on a condition. Blocks must be balanced.
Built-ins
Core names include z, c, pixel, zPrev, p1–p5, pi, e, maxit, ismand, fn1–fn4, and the functions covered by compiler tests.
Comments and directives
Semicolon comments document source. Recognized @ directives configure FractalPark native behavior; unknown directives are not silently ignored.
05

FRM to AST to GLSL Pipeline

FractalPark never pastes source text into a shader. Canonical v1 source flows through its typed parser and CPU/GLSL backend; Classic Editor source flows through its scanner, selected-entry frontend, canonical formula model, and plugin compiler.

  1. 1

    FRM source

    The exact text from the editor, paste, or local file is the authoritative input.

  2. 2

    Lexer tokens

    The lexer recognizes names, numbers, operators, section markers, comments, and directives while retaining source locations.

  3. 3

    Parsed AST

    The parser builds a structured formula tree and reports malformed declarations, expressions, and control-flow blocks.

  4. 4

    Validation and canonical form

    The validator checks names, types, sections, and supported semantics before a canonical formula is created.

  5. 5

    GLSL and source map

    Code generation emits shader functions and records mappings from generated GLSL back to FRM source.

  6. 6

    Formula plugin

    A successful compile becomes the same formula-plugin contract used by the renderer and shader assembly system.

Each source contract has one implementation path of its own. Published Standard runtime uses FRM-like v1; the standalone Editor and current custom-formula examples use the Classic-compatible path. Neither silently falls back to the other.

06

Progressive Tutorials

These are Classic-compatible Editor examples, not canonical FRM-like v1 Definitions. They advance from a small quadratic formula to parameters and stateful feedback; every source block comes from the shared Editor registry and compiles during tests.

Lesson 1

Starter Mandelbrot

starter-brotOpen in FRM Editor

The smallest escape-time formula, useful for learning the init / loop / bailout structure first.

Focus: the declaration and the init / loop / bailout structure. Change the exponent or escape threshold only after this version compiles.

starter-brot.frm
StarterBrot {
init:
  z = 0
loop:
  z = z^2 + c
bailout:
  |z| < 4
}

Lesson 2

Parameter Drift

parameter-driftOpen in FRM Editor

Demonstrates p1 / p2 parameter slots and the difference between cabs and |z|.

Focus: p1 and p2 parameter slots, a complex literal, and cabs(z) as an explicit magnitude function.

parameter-drift.frm
ParameterDrift {
init:
  z = 0
loop:
  z = z^2 + c + p1 * 0.15 + p2 * (0.05, -0.02)
bailout:
  cabs(z) < 8
}

Lesson 3

Orbit Echo

Uses zPrev as feedback memory and pairs well with orbitEcho coloring for orbit envelopes.

Focus: zPrev as the previous orbit state. Feedback adds memory without introducing a second manually managed state variable.

orbit-echo.frm
OrbitEcho {
init:
  z = pixel
loop:
  z = sqr(z) + zPrev * (0.30, -0.12) + pixel * (0.85, 0.0)
bailout:
  |z| < 48
}

The standalone FRM Editor opens these Classic-compatible, compile-checked examples by stable ID. Formula source stays in the current tab until you save it to your cloud library and is never embedded in the URL. This does not activate canonical v1 import or writers.

07

Errors and Diagnostics

Compilation stops at the earliest unsafe stage and reports source-oriented messages. A rejected construct is never rewritten into something that merely looks similar.

Lexical errors

Unexpected characters and unsupported identifiers are reported with their line and column.

Parse errors

Malformed sections, expressions, or control-flow blocks are diagnosed before semantic validation.

Validation errors

Unknown variables, invalid assignments, type mismatches, and unsupported semantics prevent code generation.

Shader source mapping

Generated GLSL retains mappings that can point a shader compilation failure back to the originating FRM location.

When fixing an error, start with the first reported message: later diagnostics can be consequences of the same missing token or invalid expression.

08

Sharing and publishing

A formula you write is private until you choose otherwise. There are three ways it can travel — each explicit, none silent.

  • Private by default

    Formulas live in your cloud library, visible only to you. Artworks you save carry a copy of the formula source inside the draft, so they always open the way you left them.

  • Download the .frm file

    Your formula is plain text. Download it from My Formulas any time and keep your own copy — no export request, no waiting.

  • Publish an artwork, share the source

    Publishing an artwork that uses your formula makes the formula source public under the MIT License: anyone may read, copy, and build on it. The community page shows the formula name from its metadata and offers the source as a download. This cannot be undone for that publication.

The full MIT License text lives at opensource.org.

09

Examples, Next Steps, and References

See the renderer in context

Open Explore to compare built-in formula behavior, coloring, transforms, animation, and export controls before writing a custom formula.

Open Explore

Use the dedicated FRM Editor for the current Classic-compatible compile, preview, import, and download workflow. It does not accept canonical FRM-like v1 source; inspect published v1 source from a Formula Record and use that Record's Open or Remix action to run it.

References

Historical context and implementation details are linked separately so the guide can distinguish the Fractint lineage from FractalPark's current compiler contract.