一种系统编程语言,优先考虑可验证的正确性、确定性和性能。
通用系统语言及生产工具链,具有默认内存安全的已发布安全语言表面、可验证的正确性、确定性执行以及内置的以重放优先的调试功能。
fzy 提供一个生产 CLI fz,用于编译工作流和确定性验证。正确性、确定性、重放、事件工件和生产证据是正常工作流的一部分,而非事后补救。如需快速了解语言的可视化概览,请在浏览器中打开随附的 FZL 展示:open fzl-showcase.html。关于为何选择它的简短论证,请参阅 WHYFZY.md。
仓库架构策略在内部是类型化的,在真实边界处仅使用 JSON。
INSTALL.mdUSAGE.mdWHYFZY.mdCODE.mddocs/production-workflow-v1.mddocs/gpu-v1.mddocs/system-safety-trust-model-v1.mddocs/unsafe-contract-authoring-v1.mddocs/language-stability-v1.mddocs/workspace-policy-v1.mddocs/operational-insights-v1.mdfzyllm:saint0x/fzyllm推荐安装方式:
curl -fsSL https://raw.githubusercontent.com/saint0x/fzy/main/install.sh | sh
这会安装 fz 到 ~/.local/bin,如需自动更新 PATH,并验证安装(fz version 和 fz env)。
源码回退方式:
curl -fsSL https://raw.githubusercontent.com/saint0x/fzy/main/install.sh | sh -s -- --from-source
想要最快的概述?用 open fzl-showcase.html 打开 fzl-showcase.html,快速浏览 WHYFZY.md 了解产品论证,然后将下面的示例作为紧凑的可执行草稿。
use core.log;
use core.path;
use core.process;
use core.time;
enum Mode {
Fast,
Safe,
}
trait Scorer {
fn score(endpoint: Url) -> i32;
}
struct HttpScorer {}
impl Scorer for HttpScorer {
fn score(endpoint: Url) -> i32 {
discard endpoint;
return 7;
}
}
struct Config<TEndpoint> {
retries: i32,
endpoint: TEndpoint,
mode: Mode,
}
fn weight(mode: Mode) -> i32 {
match mode {
Mode::Fast => return 3,
Mode::Safe => return 1,
_ => return 1,
}
}
async fn boost(v: i32) -> i32 {
checkpoint()
return v + 1
}
fn normalize<T: Scorer>(cfg: Config<Url>) -> i32 {
return weight(cfg.mode) + T.score(cfg.endpoint)
}
async fn run_once(cfg: Config<Url>) -> i32 {
let base = normalize<HttpScorer>(cfg)
return await boost(base)
}
fn main() -> i32 {
let cfg = Config { retries: 4, endpoint: url.parse("https://example.test"), mode: Mode::Fast }
let now = time.now()
let out_path = path.join("tmp", "score.log")
let mode = process.argv_or(1, "showcase")
let score = normalize<HttpScorer>(cfg)
log.info("snippet.run", out_path)
discard mode
discard run_once
if score + now > 0 then return score
return score
}
更广泛的语言覆盖请使用 CODE.md、examples/ 以及浏览器友好的 FZL 展示。
框架包遵循普通包规则:在 fozzy.toml 的 [deps] 下声明它们,然后在源码中用 use fzbounds;、use fzweb; 等包名导入。直接源码检查(例如 fz check src/services/mod.fzy --json)现在通过所属包上下文进行验证,因此依赖导入和同级模块的行为与完整项目检查中相同。
fz:编译器 CLI,用于构建、运行、测试、验证、文档、IR、RPC、头文件、ABI 检查等fz fmt、fz doc gencrates/parser、crates/ast、crates/hir、crates/fircrates/verifiercrates/runtimecrates/drivertests/*.fozzy.json目前已实现并验证:
alloc(...) / free(...) 选择加入的手动内存管理unsafe { ... } 孤岛中都有真正的运行时 defer 语义,从而强制确定性清理而非仅仅文档记录alloc(...) / free(...) 流程和验证器可见的生命周期检查fifo、random、coverage_guidedrpc_send、rpc_recv、rpc_deadline、rpc_canceltest 块生成语言原生场景mod 声明递归加载多文件模块pubext c fn 签名生成 C 头文件fz rpc gen 生成 RPC 模式、客户端和服务器存根core.crypto 和 core.security 提供的生产加密/安全表面,包括安全随机、哈希、HMAC、常量时间比较和 URL 安全编码fzweb 生产级 Web 框架模块,用于应用路由、cookie、会话、多部分上传、持久化、SSE、WebSocket 和 OpenAPI 导出fz run 直接执行原生输出,支持实时文本流或 JSON 捕获python3 scripts/direct_memory_architecture_gate.pypython3 scripts/direct_memory_perf_gate.pycore.gpu 的生产 GPU 表面,在 Apple 上支持实时 Metal 执行,并共享 spirv/nvptx 适配器约定fzy 目前已设定支持以下生产声明:
alloc(...) / free(...) 保持在安全代码中fzweb 以及将会话/cookie/auth 流程保持在支持的运行时表面内的安全原语,实现生产级 Web/服务覆盖另见:
docs/system-safety-trust-model-v1.mddocs/production-memory-model-v1.mddocs/production-workflow-v1.mdcargo check --workspace
cargo test --workspace
# 在当前目录或目标路径中搭建项目
fz init [path] [--name package] [--template minimal|rust|ts] [--with run,fuzz,explore,memory,host|all] [--force]
# 构建源码/项目
fz build [path] [--release] [--lib] [--threads N] [--backend llvm|cranelift] [--pgo-generate|--pgo-use file] [-l lib] [-L path] [-framework name] [--json]
# 运行源码/项目或 .fozzy 场景
fz run [path] [--det] [--strict-verify] [--seed N] [--record path] [--host-backends] [--backend llvm|cranelift] [--max-seconds N] [--exit-on-healthcheck URL] [--smoke-http URL] [-- <args>] [--json]
# 测试源码/项目或 .fozzy 场景
fz test [path] [--det] [--strict-verify] [--sched fifo|random|coverage_guided] [--seed N] [--record path] [--backend llvm|cranelift] [--filter substring] [--json]
# 验证/检查/文档/工具
fz fmt [path ...] [--check] [--json]
fz check [path] [--json]
fz verify [path] [--json]
fz lint [path] [--tier production|pedantic|compat] [--json]
fz dx-check [project] [--strict] [--json]
fz spec-check [--json]
fz emit-ir [path] [--json]
fz perf [--artifact artifacts/bench_core_rust_vs_fzy.json] [--json]
fz stability-dashboard [--json]
fz parity [path] [--seed N] [--json]
fz audit unsafe [path] [--workspace] [--json]
fz vendor [project] [--json]
fz abi-check <current.abi.json> --baseline <baseline.abi.json> [--json]
fz debug-check [path] [--json]
fz pgo merge [path] [--out file] [--json]
fz lsp diagnostics [path] [--json]
fz lsp definition <path> <symbol> [--json]
fz lsp hover <path> <symbol> [--json]
fz lsp rename <path> <from> <to> [--json]
fz lsp smoke [path] [--json]
fz lsp serve [--path <workspace>] [--json]
fz map suites [--root dir] [--scenario-root dir] [--profile pedantic|production|compat] [--json]
fz artifacts ls latest [--json]
fz report show latest [--format json|text] [--json]
fz usage [--json]
fz env [--json]
fz version [--json]
fz inspect stdlib <module> [--json]
fz schema [--json]
fz validate <scenario> [--json]
fz trace verify <trace> [--strict] [--json]
fz replay <trace> [--json]
fz shrink <trace> [--json]
fz ci <trace> [--json]
fz trace-native <trace.fozzy> [--out path] [--json]
# FFI / RPC / 文档输出
fz headers [path] [--out path] [--json]
fz rpc gen [path] [--out-dir dir] [--json]
fz doc gen [path] [--format json|html|markdown] [--out path] [--reference path] [--json]
VS Code 集成位于 tooling/vscode,目标为 fz lsp serve。
运行时默认值和暴露的行为:
127.0.0.18787listen 时打印有效的绑定目标.env 或 FZ_DOTENV_PATH 在环境/HTTP 操作之前加载一次log.set_json(1) 选择加入core.process、core.term、core.thread、core.log、core.text、core.io、core.path 和 core.utilcore.crypto 和 core.security 涵盖安全随机、摘要、HMAC、URL 安全编码和常量时间比较,用于生产级认证/会话流程fzweb 提供按关注点分组的内置框架模块以及内置路由,用于健康检查、就绪、指标、检查、搜索、cookie、会话、上传、事件、WebSocket、项目 CRUD、OpenAPI 和静态资产使用 fz test <file.fzy> --det --record artifacts/name.trace.json --json 时,驱动会生成: