百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

eurydice

> 编程语言
开源

Eurydice 编译 (一个相当大的子集) Rust 为 C 语言。验证 Rust 中的程序,仍然可以获得用于旧环境的 C 代码。

399 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Eurydice 编译 (一个相当大的子集) Rust 为 C 语言。验证 Rust 中的程序,仍然可以获得用于旧环境的 C 代码。

Eurydice

Eurydice is a compiler from Rust to C. The purpose of Eurydice is to provide a backwards-compatibility story as the verification ecosystem gradually transitions to Rust. New programs can be written in Rust, in turn making them safer and easier to verify; but for legacy environments that cannot yet take a dependency on the Rust toolchain, Eurydice allows generating C code as a stopgap measure.

Guarantee

Eurydice's informal guarantee is: if the Rust program terminates without panicking, then the Eurydice-compiled C code computes the same result without undefined behavior. If the Rust program panics (e.g., on signed integer overflow, out-of-bounds array access), no guarantees are made about the behavior of the generated C code.

Currently (late 2023), the flagship example for Eurydice is Kyber, a Post-Quantum cryptographic algorithm authored and verified in Rust for the general public, and compiled to C via Eurydice for Mozilla's NSS library.

In terms of software architecture, Eurydice consumes Rust programs via the Charon infrastructure, then extracts Rust to KaRaMeL's internal AST via a type-driven translation. Once in the KaRaMeL AST, 30+ nano-passes allow going from Rust down to C code. About half of these passes were already implemented for KaRaMeL, the rest of the passes reuse the KaRaMeL infrastructure but were freshly written for Eurydice.

If you want to contribute or ask questions, we strongly encourage you to join the Zulip.

Install

We recommend using Nix to easily ensure you are running the right versions of the tools and libraries. With nix, you can run:

bash
$ nix run 'github:aeneasverif/eurydice#charon' -- [CHARON_OPTIONS]
$ nix run 'github:aeneasverif/eurydice' -- [EURYDICE_OPTIONS] 

Alternatively, you can do a local setup as follows.

…

Submitting a successful PR

The C output of the test suite is under version control, and your PR will fail CI if running make test generates a diff for the C files in out/. The reason for this is that we need to assess the impact of a PR on the shape of the generated C code. To make sure the output of the tests is up-to-date, you can run make -B test to force regeneration of the C files.

Our CI will also check that your OCaml and C files have proper formatting -- the target make format-apply reformats your source code to conform to our style guide. It might sometimes be difficult to have the exact right versions of ocamlformat and clang-format -- in case your PR still fails, we recommend running nix develop followed by make format-apply.

Issues· 40 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言