Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

inkwell

> AI 编程
Open source

It's a New Kind of Wrapper for Exposing LLVM (Safely)

3.0K stars0 likes2 views
WebsiteGitHub

About

It's a New Kind of Wrapper for Exposing LLVM (Safely)

Inkwell(s)

It's a New Kind of Wrapper for Exposing LLVM (Safely)

Inkwell aims to help you pen your own programming languages by safely wrapping llvm-sys. It provides a more strongly typed interface than the underlying LLVM C API so that certain types of errors can be caught at compile time instead of at LLVM's runtime. This means we are trying to replicate LLVM IR's strong typing as closely as possible. The ultimate goal is to make LLVM safer from the rust end and a bit easier to learn (via documentation) and use.

Requirements

  • Rust 1.85+
  • One of LLVM 12-23

Usage

You'll need to point your Cargo.toml to use a single LLVM version feature flag corresponding to your LLVM version as such:

toml
[dependencies]
inkwell = { version = "0.10.0", features = ["llvm23-1"] }

Supported versions: LLVM 12-23 mapping to a cargo feature flag llvmM-N where M and N correspond to the LLVM major and minor version, e.g. llvm18-1 for LLVM 18.1.x.

Please be aware that we may make breaking changes on master from time to time since we are pre-v1.0.0, in compliance with semver. Please prefer a crates.io release whenever possible!

Documentation

Documentation is automatically deployed here based on master. These docs are not yet 100% complete and only show the latest supported LLVM version due to a rustdoc issue. See #2 for more info.

Examples

Tari's llvm-sys example written in safe code1 with Inkwell:

…

1 There are two uses of unsafe in this example because the actual act of compiling and executing code on the fly is innately unsafe. For one, there is no way of verifying we are calling get_function() with the right function signature. It is also unsafe to call the function we get because there's no guarantee the code itself doesn't do unsafe things internally (the same reason you need unsafe when calling into C).

LLVM's Kaleidoscope Tutorial

Can be found in the examples directory.

Alternative Crate(s)

  • llvm-ir

Contributing

Check out our Contributing Guide

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustapicodegenjitllvm

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.