[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80543":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":13,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},80543,"pipa","restsend\u002Fpipa","restsend","A fast, minimal ES2023 JavaScript runtime built in Rust.","",null,"Rust",59,3,56,0,1,39.61,false,"main",true,[22,23,24],"javascript","rust-library","script-engine","2026-06-12 04:01:29","# pipa (枇杷) - A fast, minimal ES2023 JavaScript runtime built in Rust.\n\n## Features\n\n- **ES2023 compliant** — implements the ECMAScript 2023 specification\n- **Async\u002Fawait built-in** — first-class async\u002Fawait support without transpilation\n- **Bytecode support** — compile JavaScript to `.jsc` bytecode files for fast loading and execution, with configurable optimization levels (`-O0` through `-O3`)\n- **Fast** — outperforms QuickJS in benchmarks\n- **Small** — ~5.2 MB binary (with `repl` feature)\n- **Zero-dependency** built-in implementations for:\n  - Regex\u002FJSON\u002FBase64\u002FBigInt\n  - Unicode\n  - `fetch` (HTTP client), `rusttls` required \n  - WebSocket\n  - Server-Sent Events (SSE)\n\nNo external C libraries or system dependencies for the above — everything is implemented from scratch in Rust.\n\n## Benchmarks (2026-05-24)\n\nV8 benchmark suite comparison (higher is better):\n\n| Benchmark              |   qjs |   node |   boa |  pipa | vs qjs |\n|------------------------|-------|--------|-------|-------|--------|\n| Richards               |   966 |  46846 |   133 |   967 |  +0.1% |\n| DeltaBlue              |   948 |  94979 |   140 |   975 |  +2.8% |\n| Crypto                 |  1097 |  60072 |   125 |  1073 |  -2.2% |\n| RayTrace               |  1467 |  79697 |   315 |   896 | -38.9% |\n| EarleyBoyer            |  2127 |  95129 |   281 |  1333 | -37.3% |\n| RegExp                 |   330 |  12703 |  41.6 |   956 | +189.7% |\n| Splay                  |  2428 |  48609 |   536 |  2901 | +19.5% |\n| NavierStokes           |  1807 |  56392 |   288 |   618 | -65.8% |\n| **SCORE (total)**      | **1208** | **53836** | **184** | **1254** | **+3.8%** |\n\nRanking: **#1 node** (53836) · **#2 pipa** (1254) · **#3 qjs** (1208) · **#4 boa** (184)\n\n## test262 Compatibility (2026-05-24)\n\nTested against [tc39\u002Ftest262](https:\u002F\u002Fgithub.com\u002Ftc39\u002Ftest262) (excluding `intl402` and `annexB`).\n\n| Category | Pass Rate | Notes |\n|----------|-----------|-------|\n| **Core Operators** | | |\n| Addition, Coalesce, Comma, Grouping, Logical-And\u002FOr, Strict-Equals\u002FNot-Equals, Void, Bitwise-Not, Relational | **100%** | Fully compliant |\n| Subtraction, Division, Multiplication, Modulus, Exponentiation | **64–82%** | Mostly compliant |\n| **Control Flow** | | |\n| `if` | **100%** (69\u002F69) | ✅ |\n| `switch` | **100%** (111\u002F111) | ✅ |\n| `while` | **100%** (38\u002F38) | ✅ |\n| `do-while` | **100%** (36\u002F36) | ✅ |\n| `for-in` | **98%** (113\u002F115) | ✅ `let` as identifier, TDZ, completion values, enumeration order, `Object.defineProperty` attribute preservation, MemberExpression targets, per-iteration binding, scope (except destructuring in head)\u003Cbr>⏳ 1 scope test |\n| `for` | **~100%** | ✅ |\n| `try\u002Fcatch\u002Ffinally` | **~97%** | ✅ completion values, break\u002Fcontinue through finally\u003Cbr>⏳ 5 exception propagation through finally tests |\n| `const`\u002F`let` | **73–74%** | |\n| **Functions** | | |\n| Function declarations\u002Fexpressions | **66–73%** | |\n| Arrow functions | **80%** | |\n| Generators | **65–67%** | |\n| **Builtins** | | |\n| Math | **49%** | |\n| JSON | **23%** | |\n| Boolean | **59%** | |\n| Promise | **7%** | Limited async support |\n| Proxy\u002FReflect | **0–19%** | Not yet implemented |\n| Set\u002FMap\u002FWeakMap\u002FWeakSet | **6–23%** | Partial implementation |\n\n**Overall sampled pass rate: ~52%** (5327 tests sampled across all categories above)\n\n## Usage\n\n```bash\ncargo install pipa-js\n# Run a script\npipa script.js\n\n# Run precompiled bytecode\npipa script.jsc\n\n# Compile JavaScript to bytecode\npipa -compile input.js output.jsc\n\n# Disassemble bytecode (debugging)\npipa -diss script.jsc\n\n# Specify optimization level (default: -O2)\npipa -O3 script.js\n\n# Start REPL (requires the repl feature)\npipa\n```\n\n## Embedding in Rust\n\nUse pipa-js as a library to embed JavaScript in your Rust project:\n\n```toml\n[dependencies]\npipa-js = \"0.1.2\"\n```\n\n### Evaluate JavaScript\n\n```rust\nuse pipa::{JSRuntime, eval};\n\nlet mut rt = JSRuntime::new();\nlet mut ctx = rt.new_context();\n\nlet val = eval(&mut ctx, \"1 + 2\").unwrap();\nassert_eq!(val.get_int(), 3);\n```\n\n### Read strings & values from JavaScript\n\n```rust\nuse pipa::{JSRuntime, eval};\n\nlet mut rt = JSRuntime::new();\nlet mut ctx = rt.new_context();\n\neval(&mut ctx, r#\"\n    function greet(name) {\n        return \"Hello, \" + name + \"!\";\n    }\n\"#).unwrap();\n\nlet val = eval(&mut ctx, r#\"greet(\"world\")\"#).unwrap();\nassert!(val.is_string());\nlet s = ctx.get_atom_str(val.get_atom());\nassert_eq!(s, \"Hello, world!\");\n```\n\n### Call custom Rust functions from JavaScript\n\n```rust\nuse pipa::{JSRuntime, eval, JSValue};\n\nfn js_print(ctx: &mut pipa::JSContext, args: &[JSValue]) -> JSValue {\n    for arg in args {\n        if arg.is_string() {\n            print!(\"{}\", ctx.get_atom_str(arg.get_atom()));\n        } else if arg.is_int() {\n            print!(\"{}\", arg.get_int());\n        }\n    }\n    println!();\n    JSValue::undefined()\n}\n\nlet mut rt = JSRuntime::new();\nlet mut ctx = rt.new_context();\n\nctx.register_global_builtin(\"print\", 1, js_print);\neval(&mut ctx, r#\"print(\"hello from Rust!\")\"#).unwrap();\n```\n\n### Async\u002Fawait with event loop\n\n```rust\nuse pipa::{JSRuntime, eval, eval_async};\n\nlet mut rt = JSRuntime::new();\nlet mut ctx = rt.new_context();\n\neval_async(&mut ctx, r#\"\n    var result = null;\n    (async () => {\n        result = await fetch(\"https:\u002F\u002Fhttpbin.org\u002Fjson\");\n    })();\n\"#).unwrap();\n\nlet val = eval(&mut ctx, \"JSON.stringify(result)\").unwrap();\nprintln!(\"{}\", ctx.get_atom_str(val.get_atom()));\n```\n\n> Requires the `fetch` feature (enabled by default). `eval_async` is `eval` + `run_event_loop` in one call.\n\n### Bytecode compilation\n\n```rust\nuse pipa::{JSRuntime, eval, compile_to_register_bytecode};\n\nlet mut rt = JSRuntime::new();\nlet mut ctx = rt.new_context();\n\n\u002F\u002F Compile JavaScript to register-based bytecode\nlet (code, constants) = compile_to_register_bytecode(\n    &mut ctx,\n    \"function fib(n) { return n \u003C 2 ? n : fib(n-1) + fib(n-2); } fib(20)\",\n).unwrap();\n\n\u002F\u002F code: Vec\u003Cu8>, constants: Vec\u003CJSValue>\nassert!(!code.is_empty());\n```\n\n## Build\n\n```bash\n# Default build (includes REPL, fetch, and process support)\ncargo build --release\n\n# Minimal build (no REPL, no fetch, no process)\ncargo build --release --no-default-features\n```\n\n> If using pipa as a library dependency and you don't need REPL\u002Ffetch\u002Fprocess features, add it with `default-features = false`:\n> ```toml\n> [dependencies]\n> pipa-js = { version = \"0.1.1\", default-features = false }\n> ```\n\n## License\n\nMIT\n","pipa是一个用Rust编写的快速、轻量级的ES2023 JavaScript运行时。它完全符合ECMAScript 2023标准，内置了async\u002Fawait支持，无需转译，并且能够将JavaScript编译为字节码文件以实现快速加载和执行。pipa在基准测试中表现出色，超越了QuickJS，在V8基准测试套件中的总分仅次于Node.js。此外，pipa具有零外部依赖性，所有核心功能如正则表达式、JSON处理、WebSocket等都直接使用Rust实现。该项目适用于需要高性能且资源占用小的JavaScript执行环境，特别适合嵌入式系统或对启动时间和内存使用有严格要求的应用场景。",2,"2026-06-11 04:01:10","CREATED_QUERY"]