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).
| Command | What it does |
|---|---|
fid run | The interpreter: no build step. |
fid emit | Native executable with no assembler, linker or C compiler: Windows x64, and Linux with --target (partly tested). |
fid ccompile | Through C (needs a C compiler); fid build does this on Linux. |
fid test | Runs every test_* function in a file. |
fid check / fid fmt / fid lint | Type, borrow and effect checks only; formatting; lints. |
fid audit | Lists every unsafe block a program reaches. |
fid qualify | Safety evidence as JSON, always marked NOT_QUALIFIED. |
fid wasm / fid gpu | WebAssembly (runs under WASI) and SPIR-V (does not validate yet), both experimental. |
fidesc watch | Rebuild 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 lspspeaks 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 --perfwarns about loop hazards. - Benchmarks and profiling:
fid bench(mean, median, stddev) andfid profile(per-function timing). - Memory checks:
fid run --leaksreports memory never freed, by where it was allocated;fid run --checked-alloccatches 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 debugwith breakpoints, stepping and locals;fidesc replayreplays a recorded trace. - Notebooks:
fid notebook file.fd -o out.htmlrenders 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.jsonlists 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 sbomandfidesc spdxexport a software bill of materials.
Companion tools
| Tool | Role |
|---|---|
ark | Package 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. |
scribe | Documentation generator: /// doc comments to styled HTML or Markdown. The Standard Library reference is produced with it. |
veil | Coverage: 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.