Skip to content

Tools

Fid ships a toolchain, not just a compiler. Native builds need no other tools; the C backend needs a C compiler. See Installation.

Fides: the compiler

Fides is the Fid compiler; its command is fid. It is written in Fid and builds itself to a byte-identical fixpoint. It is also the test runner, formatter, linter, language server, unsafe-code auditor, safety-evidence report and notebook renderer, and runs the companion tools (fid ark, fid scribe, fid veil). fidesc, the earlier compiler in Rust, is frozen: it builds stage 1 of the bootstrap, runs the test suite and keeps a few extra tools (watch, debug, replay, sbom, spdx).

CommandWhat it does
fid runThe interpreter: no build step.
fid emitNative executable with no assembler, linker or C compiler: Windows x64, and Linux with --target (partly tested).
fid ccompileThrough C (needs a C compiler); fid build does this on Linux.
fid testRuns every test_* function in a file.
fid check / fid fmt / fid lintType, borrow and effect checks only; formatting; lints.
fid auditLists every unsafe block a program reaches.
fid qualifySafety evidence as JSON, always marked NOT_QUALIFIED.
fid wasm / fid gpuWebAssembly (runs under WASI) and SPIR-V (does not validate yet), both experimental.
fidesc watchRebuild and rerun on save (Linux; frozen compiler).

The full list, with every flag, is in the CLI Reference.

Developer experience, built in

  • Language server: fid lsp speaks JSON-RPC over stdio: diagnostics, completion, hover, go-to-definition, rename. See Editor Setup for VS Code and other editors.
  • Formatter: fid fmt.
  • Linter: fid lint: unused functions and imports, unwrap() outside tests; fid lint --perf warns about loop hazards.
  • Benchmarks and profiling: fid bench (mean, median, stddev) and fid profile (per-function timing).
  • Memory checks: fid run --leaks reports memory never freed, by where it was allocated; fid run --checked-alloc catches use after free and writes past a block’s end. fid emit --checked-alloc (guard pages for native builds) is written and not yet tested. Native builds report stack overflows and invalid accesses with a stack trace.
  • Debugger (in fidesc): fidesc debug with breakpoints, stepping and locals; fidesc replay replays a recorded trace.
  • Notebooks: fid notebook file.fd -o out.html renders a literate program: /// comment blocks become markdown cells and each code block is evaluated with its output inlined.
  • Introspection: dump-tokens, dump-ast, dump-ir, dump-pir, dump-c, codegen: every stage of the pipeline is a command away. The playground exposes the same views in the browser.
  • Safety evidence: fid qualify file.fd -o evidence.json lists the 17 safety rules, their tests and the program’s annotated functions. It is evidence for review, not a certificate.
  • Supply chain (in fidesc): fidesc sbom and fidesc spdx export a software bill of materials.

Companion tools

ToolRole
arkPackage manager: init, add --path / --git, install, remove, list, lock, update. Manifest in ark.toml, lock file in ark.lock. A registry (search, publish) is on the roadmap.
scribeDocumentation generator: /// doc comments to styled HTML or Markdown. The Standard Library reference is produced with it.
veilCoverage: function, line, and instruction coverage as annotated text or HTML.

Editors

The VS Code extension provides highlighting for .fd files (keywords, f-strings, effect and safety annotations, doc comments) and connects to the built-in language server; the same TextMate grammar powers the code blocks on this site. Any editor with an LSP client can use fid lsp. Setup for VS Code, Neovim, and others is in Editor Setup.

The browser

The playground is fidesc compiled to WebAssembly, running in your browser. Nothing you type leaves your machine, and a share link encodes the program in the URL. fidesc is frozen, so features new in fid (generic bounds, turbofish, @cfg, borrowed strings, the newer borrow and safety checks) may not run there.