Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Motivation
Every repo using Flow discovers the same compiler limitations and workarounds
independently. There is no standard mechanism for a Flow project to declare its
conventions, known-bad patterns, build commands, and preferred idioms in a way
that tools and agents pick up automatically.
Developers and AI agents hitting these limitations waste significant time
debugging silent failures (see #413) before discovering workarounds that other
projects already documented.
Proposal
Add support for a project-level conventions file that the Flow CLI and
downstream tools can read automatically. Suggested name: flow.toml or
.flowconfig, placed at the project root.
Fields
[project]
name = "flow-scikit"
version = "0.3.0"
[build]
host = "python"
test_command = "FLOW_HOST=python flow run tests/test_new_features.flow"
test_all = "for f in tests/test_*.flow; do FLOW_HOST=python flow run $f; done"
[conventions]
# Patterns to avoid, with the reason and workaround
avoid = [
{ pattern = "reverse for loop", reason = "generates incorrect step direction (#410)", workaround = "use while with explicit decrement" },
{ pattern = "return StructLiteral { field: func() }", reason = "fails to compile (#409)", workaround = "assign to locals first" },
{ pattern = "escaped quotes in strings", reason = "memory corruption (#408)", workaround = "avoid embedded quotes" },
{ pattern = "string concatenation with +", reason = "not supported (#412)", workaround = "use sequential print() calls" },
{ pattern = "scientific notation", reason = "parse error", workaround = "use 0.0000000001" },
]
[patterns]
# Preferred idioms for this project
math = "use fabs((x) as f64) as f32, sqrt((x) as f64) as f32, log((x) as f64) as f32"
structs = "passed by value; mutating functions must return the struct"
allocations = "use generous sizes (64+ bytes per struct) on arm64"
exports = "use export struct and export function for public API"Behavior
flow initcreates a template conventions file in the current directory.flow runandflow buildread the file for build settings (e.g. default
host).flow checkorflow lintwarns when source code matches anavoid
pattern.- Tools and AI agents can read the file to understand project conventions
without manual discovery.
Benefits
- New contributors and agents learn the project's Flow patterns immediately.
- Known compiler bugs are documented per-project with workarounds, so the same
debugging does not repeat across repos. - Build and test commands are standardized and discoverable.
- The lint step catches problematic patterns before runtime.
Alternatives considered
- A global Flow wiki page: not project-specific, does not cover custom
conventions or build commands. - Relying on AGENTS.md / CLAUDE.md: these are agent-specific and not read by
the Flow CLI itself. - Embedding conventions in source comments: not machine-readable, easy to miss.
Related issues
- Bug: Escaped quotes in string literals cause memory corruption / bus error #408: Escaped quotes cause memory corruption
- Bug: Direct return of struct literal with embedded function calls fails to compile #409: Struct literal return fails to compile
- Bug: Reverse for loops (high to low) generate incorrect step direction #410: Reverse for loops generate incorrect step
- Bug: export const from imported module not visible to downstream importers #411: export const not visible through import chain
- Feature: Support string concatenation with + operator #412: String concatenation not supported
- Bug: FLOW compilation failed suppresses all error diagnostics #413: Compilation failed suppresses diagnostics
- Bug: Vectorization pragmas generate incorrect code in sensitive loops #414: Vectorization pragmas generate incorrect code
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
feat: project-level conventions file and flow check (#415)
fix: multiple compiler bugs and project conventions (#419)
godofecht commentedon Aug 11, 2026
Fixed in PR #419 (merged).
feat(flowc): scientific notation, attribute skip, type aliases (#438)
docs: check that every part of the language has a documented home (#543)