@cella-lang/machine

中文文档
0.1.202611090959发布于 2026/11/09Apache-2.0零依赖近 30 天下载 1.1万

The language-neutral execution layer for Cella Lang: IEEE 754 binary floating point with correctly rounded operations, fixed-width two's complement integers, standard streams as a state, computations that stop with a reason, a small-step machine for struc

原始使用文档
文档目录3 节
  1. Modules
  2. Loading
  3. Changes

@cella-lang/machine

The language-neutral execution layer for the Cella proof checker, as a compiled module pack. Every language's semantics needs these pieces and none of them owns them: the C family (@cella-lang/cfamily, c, cpp, arduino) and Python (@cella-lang/python) are built on it, and so can the next language.

The package has no entry of its own; a language package exports its verdict, type query and debugger, built from these modules.

Modules

ModuleWhat it gives
machine.bitsFixed-width two's complement integers: wrapping into the signed or unsigned range of a width, with theorems that the result is in range; bitwise operations and shifts. Which widths a language has is the language's.
machine.floatIEEE 754 binary floating point: add, subtract, multiply, divide and square root compute the exact rational result and round it to nearest, ties to even, so results agree bit for bit with any conforming implementation.
machine.float.decimalCorrectly rounded decimal digits of a floating value (significant digits, or a fixed number of places).
machine.float.functionsCorrectly rounded pow, exp and log (Ziv's method).
machine.consoleStandard input and output as a state, not an effect: the input not read yet, the output written so far, and the flags a read raises. A debugger feeds input while the program waits.
machine.checkedComputations that may stop with a reason (Checked R A). A precondition is evaluated where the operation is reached; verification and execution are the same term.
machine.statementA small-step machine for structured statements: sequence, conditionals, loops with break and continue, switch with fallthrough, calls, try, and cleanup on every way out.
machine.debuggerA debugger driver for any language's machine: breakpoints, step in, over and out, fuel, waiting for input, and the kind of each stop (Stop.kind).
machine.dapThe JSON a Debug Adapter Protocol host reads at a stop: its kind, details, call stack and variables. The shapes are the same for every language, so a host needs no change for a new one.

Loading

The pack loads into the cella-lang build named by index.json (checkerHash, cbfVersion); the peerDependencies entry pins that version. Load the standard modules it needs first (index.requires["cella-lang"].modules, with load_module_pack), then its own modules in the order of index.modules.machine.deps (with load_library_pack, which refuses a pack with a reason if the checker or format does not match). A language package lists @cella-lang/machine in its index.requires.packages, and loads it the same way before itself.

Changes

See CHANGES.md.

版本与发布记录

@cella-lang/machine 共发布 53 个版本,首次发布于 2026/10/30;过去 12 个月发布了 53 个版本。

版本发布日期距今
0.1.202611090959latest2026/11/09今天
0.1.2026110909542026/11/09今天
0.1.2026110822132026/11/09今天
0.1.2026110809582026/11/081 天前
0.1.2026110805232026/11/081 天前
0.1.2026110804152026/11/081 天前

关于 @cella-lang/machine 的常见问题

@cella-lang/machine 是什么?

The language-neutral execution layer for Cella Lang: IEEE 754 binary floating point with correctly rounded operations, fixed-width two's complement integers, standard streams as a state, computations that stop with a reason, a small-step machine for struc

如何安装 @cella-lang/machine?

在项目目录运行 npm install @cella-lang/machine,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:cella-lang(0.1.202611090954)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cella-lang/machine 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cella-lang__machine 是否存在。

@cella-lang/machine 可以商用吗?

@cella-lang/machine 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@cella-lang/machine 的下载量有多少?

根据 npm 官方下载统计,@cella-lang/machine 在 2026/10/10 – 2026/11/08 这 30 天内被下载 11,306 次,日均约 377 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cella-lang/machine 还在维护吗?

最新版本 0.1.202611090959 发布于 2026/11/09(今天);至今共发布 53 个版本,其中过去 12 个月发布了 53 个;首次发布于 2026/10/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。