#web-kit #javascriptcore #jsc #javascript #ffi

sys otter-jsc-sys

Raw FFI bindings to JavaScriptCore

2 releases

Uses new Rust 2024

0.1.1 Jan 15, 2026
0.1.0 Jan 15, 2026

#1254 in Web programming


Used in 5 crates (2 directly)

MIT license

32KB
638 lines

otter-jsc-sys

Raw FFI bindings to JavaScriptCore C API.

Overview

This crate provides low-level unsafe bindings to JavaScriptCore (JSC), the JavaScript engine used by WebKit and Safari. It supports multiple platforms:

  • macOS: Uses the system JavaScriptCore framework
  • Linux: Uses pre-built bun-webkit binaries (statically linked)
  • Windows: Uses pre-built bun-webkit binaries (statically linked)

Usage

This crate is intended for use by higher-level wrappers. For safe Rust APIs, use the otter-jsc-core or otter-runtime crates instead.

use otter_jsc_sys::*;

unsafe {
    let ctx = JSGlobalContextCreate(std::ptr::null_mut());
    // ... use JSC APIs
    JSGlobalContextRelease(ctx);
}

Platform Support

Platform Architecture Method
macOS x86_64, ARM64 System framework
Linux x86_64, ARM64 bun-webkit (static)
Windows x86_64 bun-webkit (static)

Build Requirements

macOS

No additional dependencies required.

Linux & Windows

The build script automatically downloads pre-built bun-webkit binaries from oven-sh/WebKit.

Environment Variables

  • BUN_WEBKIT_VERSION: Override the default bun-webkit version

License

MIT

Dependencies

~0–2.4MB
~42K SLoC