Bun C Compiler

Compile and run C from JavaScript with low overhead

9 stars 1 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add jarle/bun-skills --skill Bun C Compiler
Manual install
git clone --depth 1 https://github.com/jarle/bun-skills.git /tmp/bun-skills
mkdir -p ~/.claude/skills
cp -r /tmp/bun-skills/skills/bun-runtime-c-compiler ~/.claude/skills/Bun-C-Compiler

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# C Compiler

> Compile and run C from JavaScript with low overhead

`bun:ffi` has experimental support for compiling and running C from JavaScript with low overhead.

***

## Usage (cc in `bun:ffi`)

See the [introduction blog post](https://bun.com/blog/compile-and-run-c-in-js) for more information.

JavaScript:

```ts hello.ts icon="file-code" theme={"theme":{"light":"github-light","dark":"dracula"}}
import { cc } from "bun:ffi";
import source from "./hello.c" with { type: "file" };

const {
  symbols: { hello },
} = cc({
  source,
  symbols: {
    hello: {
      args: [],
      returns: "int",
    },
  },
});

console.log("What is the answer to the universe?", hello());
```

C source:

```c hello.c theme={"theme":{"light":"github-light","dark":"dracula"}}
int hello() {
  return 42;
}
```

When you run `hello.js`, it will print:

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun hello.js
What is the answer to the universe? 42
```

Under the hood, `cc` uses [TinyCC](https://bellard.org/tcc/) to compile the C code and then link it with the JavaScript runtime, efficiently converting types in-place.

### Primitive types

The same `FFIType` values in [`dlopen`](/runtime/ffi) are supported in `cc`.

| `FFIType`   | C Type         | Aliases                     |
| ----------- | -------------- | --------------------------- |
| cstring     | `char*`        |                             |
Read the full skill on GitHub

Details

Skill name
Bun C Compiler
Path
skills/bun-runtime-c-compiler/SKILL.md
License
MIT
Repo updated
24 February 2026

FAQ

What does the Bun C Compiler skill do?

Compile and run C from JavaScript with low overhead

How do I install the Bun C Compiler skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add jarle/bun-skills --skill Bun C Compiler. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Bun C Compiler popular?

It lives in jarle/bun-skills, which has 9 GitHub stars and 1 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.