kremlin

KreMLin is a tool for extracting low-level F* programs to readable C code

Github星跟蹤圖

KaRaMeL

Linux
Build and Deploy

KaRaMeL (formerly known as KReMLin) is a tool that extracts an F* program to
readable C code: K&R meets ML!

If the F* program verifies against a low-level memory model that talks about
the stack and the heap; if it is first-order; if it obeys certain restrictions
(e.g. non-recursive data types) then KaRaMeL will turn it into C.

The best way to learn about KaRaMeL is its work-in-progress
tutorial. Pull requests and
feedback are welcome!

  • DESIGN.md has a technical overview of the different
    transformation passes performed by KaRaMeL, and is slightly out of date.

This work has been formalized on paper. We state that the compilation of
such F* programs to C preserves semantics. We start from Low*, a subset of
F*, and relate its semantics to CompCert's Clight.

  • the ICFP 2017 Paper provides an overview of KaRaMeL as well
    as a paper formalization of our compilation toolchain

We have written 120,000 lines of Low* code, implementing the TLS
1.3
record layer. As such, KaRaMeL is a
key component of Project Everest.

  • [HACL*], our High Assurance Crypto Library, provides numerous cryptographic
    primitives written in F*; these primitives enjoy memory safety, functional
    correctness, and some degree of side-channel resistance -- they extract to C
    via KaRaMeL.

Trying out KaRaMeL

KaRaMeL requires OCaml (>= 4.10.0), OPAM, and a recent version of GNU make.

Regarding GNU make: On OSX, this may require you to install a recent GNU
make via homebrew, and invoke gmake instead of make.

Regarding OCaml: Install OPAM via your package manager, then:

$ opam install ppx_deriving_yojson zarith pprint "menhir>=20161115" sedlex process fix "wasm>=2.0.0" visitors ctypes-foreign ctypes

Next, make sure you have an up-to-date F*, and that you ran make in the
ulib/ml directory of F*. The fstar.exe executable should be on your PATH
and FSTAR_HOME should point to the directory where F* is installed.

To build just run make from this directory.

Note: on OSX, KaRaMeL is happier if you have greadlink installed (brew install coreutils).

If you have the right version of F* and fstar.exe is in your PATH then you
can run the KaRaMeL test suite by doing make test.

Installing through OPAM

KaRaMeL is also available on OPAM, by running opam install karamel.

If you installed the latest version of F* through OPAM, using opam pin add fstar --dev-repo,
you can also install the most up-to-date version of KaRaMeL by running opam pin add karamel --dev-repo.

File a bug if things don't work!

Documentation

The --help flag contains a substantial amount of information.

$ ./krml --help

License

KaRaMeL is released under the Apache 2.0 license; see LICENSE for more details.

主要指標

概覽
名稱與所有者FStarLang/karamel
主編程語言OCaml
編程語言Makefile (語言數: 13)
平台
許可證Apache License 2.0
所有者活动
創建於2016-05-27 23:29:05
推送於2025-04-24 23:02:10
最后一次提交2025-04-23 09:20:17
發布數2
最新版本名稱v1.0.0 (發布於 )
第一版名稱v0.9.6.0 (發布於 )
用户参与
星數442
關注者數41
派生數65
提交數4.2k
已啟用問題?
問題數177
打開的問題數42
拉請求數376
打開的拉請求數10
關閉的拉請求數27
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?