make-moonbit-c-bindings
Installation
SKILL.md
Make MoonBit C Bindings
Use this skill for end-to-end binding projects. Also read moonbit-c-binding
before implementation for low-level FFI syntax, ownership annotations, and
moonbit.h details.
Quick Start
- Clone or inspect the upstream C/C++ project in a temporary directory.
- Identify the public header(s), generated config headers, source layout, allocator API, and build-time type widths.
- Decide the safe MoonBit API surface; do not mechanically expose every C API.
- Vendor sources with
templates/prepare.pyor link to a system library only when that is explicitly desired. - Write a thin C wrapper, private MoonBit externs, and safe public MoonBit wrappers.
- Validate with
moon check, native tests, ASan,moon info, and vendoring script idempotency.