{"id":47664767,"url":"https://github.com/rlch/jolt","last_synced_at":"2026-04-02T11:52:28.856Z","repository":{"id":346483020,"uuid":"1189496385","full_name":"rlch/jolt","owner":"rlch","description":"Rust-powered JavaScript runtime for Flutter — JSC on Apple, QuickJS elsewhere, host JS on web","archived":false,"fork":false,"pushed_at":"2026-03-24T07:10:53.000Z","size":375,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T04:00:24.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rlch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-23T11:32:53.000Z","updated_at":"2026-03-24T07:10:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rlch/jolt","commit_stats":null,"previous_names":["rlch/jolt"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/rlch/jolt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fjolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fjolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fjolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fjolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rlch","download_url":"https://codeload.github.com/rlch/jolt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fjolt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-02T11:52:28.340Z","updated_at":"2026-04-02T11:52:28.849Z","avatar_url":"https://github.com/rlch.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jolt (JavaScript on lots of targets)\n\nRust-powered JavaScript runtime. Picks the best JS engine for each platform — use standalone in Rust, or with Flutter via [`flutter_jolt`](https://github.com/rlch/flutter_jolt).\n\n[![CI](https://github.com/rlch/jolt/actions/workflows/ci.yml/badge.svg)](https://github.com/rlch/jolt/actions/workflows/ci.yml)\n[![crates.io](https://img.shields.io/crates/v/jolt_rs.svg)](https://crates.io/crates/jolt_rs)\n[![docs.rs](https://img.shields.io/docsrs/jolt_rs)](https://docs.rs/jolt_rs)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n## Why\n\nFlutter has no built-in JS engine. Existing packages either bundle a single engine everywhere (wasting binary size on Apple platforms that ship JSC for free) or only target one platform. Jolt gives you:\n\n- **Zero-cost JS on Apple** -- JavaScriptCore is already on device\n- **Tiny JS everywhere else** -- QuickJS adds ~1 MB, no JIT required\n- **Native speed on web** -- delegates straight to the browser's JS engine via `wasm-bindgen`\n\nOne API, three engines, every platform.\n\n## Engine matrix\n\n| Platform | Engine | Crate | Notes |\n|---|---|---|---|\n| iOS / macOS | JavaScriptCore | [`rusty_jsc`](https://docs.rs/rusty_jsc) | Native framework, zero bundle cost |\n| Android / Linux / Windows | QuickJS | [`rquickjs`](https://docs.rs/rquickjs) | ~1 MB, embeddable, no JIT |\n| Web (WASM) | Host JS | [`js-sys`](https://docs.rs/js-sys) / [`wasm-bindgen`](https://docs.rs/wasm-bindgen) | Calls through to browser engine |\n\n## Quick start\n\nThe Rust crates are independent and can be used outside Flutter. Pick the backend for your target or use the `jolt` facade crate which selects automatically:\n\n```rust\nuse jolt::{create_runtime, JsRuntime, JsValue};\n\nlet mut rt = create_runtime().unwrap();\n\n// Evaluate JS\nlet result = rt.eval(\"1 + 1\").unwrap();\nassert_eq!(result, JsValue::Int(2));\n\n// Globals\nrt.set_global(\"name\", JsValue::from(\"world\")).unwrap();\nlet greeting = rt.eval(\"`Hello, ${name}!`\").unwrap();\n\n// Call functions defined in JS\nrt.eval(\"function add(a, b) { return a + b; }\").unwrap();\nlet sum = rt.call_function(\"add\", \u0026[JsValue::Int(2), JsValue::Int(3)]).unwrap();\n\n// Register Rust functions callable from JS\nrt.register_function(\"double\", |args| {\n    let n = args[0].as_i64().unwrap();\n    Ok(JsValue::Int(n * 2))\n}).unwrap();\nlet doubled = rt.eval(\"double(21)\").unwrap();\n```\n\nOr use a specific backend directly:\n\n```rust\n// QuickJS — Android, Linux, Windows, or anywhere\nuse jolt_quickjs::QuickJsRuntime;\nuse jolt_core::{JsRuntime, JsValue};\n\nlet mut rt = QuickJsRuntime::new().unwrap();\nlet result = rt.eval(\"1 + 1\").unwrap();\n\n// JavaScriptCore — macOS, iOS\nuse jolt_jsc::JscRuntime;\nlet mut rt = JscRuntime::new().unwrap();\nlet result = rt.eval(\"1 + 1\").unwrap();\n```\n\nFor Flutter/Dart usage, see [`flutter_jolt`](https://github.com/rlch/flutter_jolt).\n\n## Architecture\n\n```\n┌──────────────────────────────────────────────┐\n│  jolt_rs (facade crate)                      │\n│  cfg-gates the correct backend:              │\n│    ios/macos  → jolt_jsc                     │\n│    wasm32     → jolt_web                     │\n│    otherwise  → jolt_quickjs                 │\n├──────────────────────────────────────────────┤\n│  jolt_core                                   │\n│  JsRuntime trait + JsValue / JoltError types │\n└──────────────────────────────────────────────┘\n```\n\n### Crates\n\n| Crate | Use case | Dependency |\n|---|---|---|\n| `jolt_core` | `JsRuntime` trait, `JsValue`, `JoltError` | None (pure types) |\n| `jolt_quickjs` | Embed QuickJS in any Rust app | `rquickjs` |\n| `jolt_jsc` | Use JavaScriptCore on Apple platforms | `rusty_jsc` |\n| `jolt_web` | Use host JS engine in WASM apps | `wasm-bindgen` |\n| `jolt_rs` | Auto-select backend per target | One of the above |\n\n### Workspace layout\n\n```\ncrates/\n  core/     — JsRuntime trait, JsValue, JoltError\n  quickjs/  — QuickJS backend\n  jsc/      — JavaScriptCore backend\n  web/      — WASM/browser backend\n  jolt/     — Facade (re-exports correct backend per target)\n```\n\n## Building \u0026 testing\n\nPrerequisites: Rust toolchain, [`just`](https://github.com/casey/just) (optional).\n\n```bash\n# Run all native Rust tests (QuickJS + JSC + facade)\ncargo test --workspace -- --test-threads=1\n\n# Run WASM tests (requires wasm-pack + Node.js)\ncd crates/web \u0026\u0026 wasm-pack test --node\n\n# Individual crates\ncargo test -p jolt_quickjs\ncargo test -p jolt_jsc -- --test-threads=1\ncargo test -p jolt_core\n```\n\n\u003e JSC tests must run single-threaded (`--test-threads=1`) due to JavaScriptCore's threading model.\n\n## Status\n\n| Feature | QuickJS | JSC | Web |\n|---|---|---|---|\n| `eval` | Yes | Yes | Yes |\n| `eval_async` (promises) | Yes | Yes (via drainMicrotasks) | Yes (via JsFuture) |\n| `call_function` | Yes | Yes | Yes |\n| `set_global` / `get_global` | Yes | Yes | Yes |\n| `register_function` | Yes | Yes | Yes |\n| `eval_module` | Yes | Falls back to eval | Falls back to eval |\n| Tests | 26 | 30 | 15 (wasm-pack) |\n\nCurrent limitations:\n\n- `eval_module` on JSC/Web falls back to `eval()` (no module semantics)\n\n## Documentation\n\n- **Rust API docs**: [docs.rs/jolt_rs](https://docs.rs/jolt_rs) (facade) | [docs.rs/jolt_core](https://docs.rs/jolt_core) (trait \u0026 types)\n- **Backend docs**: [jolt_quickjs](https://docs.rs/jolt_quickjs) | [jolt_jsc](https://docs.rs/jolt_jsc) | [jolt_web](https://docs.rs/jolt_web)\n- **Flutter plugin**: [flutter_jolt](https://github.com/rlch/flutter_jolt) | [pub.dev](https://pub.dev/packages/flutter_jolt)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlch%2Fjolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frlch%2Fjolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlch%2Fjolt/lists"}