Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

xbintsc

Latest version: v0.7.10

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: zy445566
48 Stars
3 Forks
73 Versions
4.7K Downloads
C++ Repo language

Scan summary

xbintsc was last scanned on 28 Nov 2026 at version 0.7.10. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 73 versions; the latest 4 were published within 7 days (22–28 Nov 2026).
  • Findings: No rules fired in version 0.7.10.
  • Downloads: 4,723 downloads.

Versions

73 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.7.10 LATEST 28 Nov 2026 No rules fired
0.7.9 24 Nov 2026 No rules fired
0.7.8 23 Nov 2026 No rules fired
0.7.7 22 Nov 2026 Not shown
0.7.6 19 Nov 2026 Not shown

No rules fired in 0.7.10

Findings

Findings for v0.7.10. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.7.10; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

xbintsc

语言 / Language:简体中文 | English

xbintsc 把 TypeScript 的一个实用子集直接编译为原生二进制。 它自身解析 TypeScript,进行名字绑定,把程序下降为 LLVM IR 文本, 再把 IR 交给 clang,链接一个小型 C 运行时,产出独立可执行文件。

设计目标是:

  1. 增量编译 —— 构建以内容寻址,没有变化时直接跳过。
  2. 模块划分清晰 —— 词法、语法、绑定、代码生成、驱动、扩展各自独立目录,并有各自的测试。
  3. 测试充分 —— 每个模块单元测试,外加真正编译并运行二进制的端到端测试。
  4. 可插拔扩展 —— Node fs、gui HTML/CSS 渲染器 等是可选的编译模块,而非核心代码。
  5. 自举(self-hosting) —— 编译器可编译自身:src/cli/main.ts 能构建为原生 xbintsc 二进制,其产出的 LLVM IR 跨代达到不动点。CI 会为各平台构建这些二进制,Release 则附上这些产物。
  6. 多平台 —— 在 x64 与 arm64(Apple Silicon / AArch64)上支持 macOS、Linux 与 Windows,并由 GitHub Actions 在各自架构的原生 runner 上验证。

工作原理

source.ts
   │  词法分析  src/lexer
   ▼
 tokens
   │  语法分析  src/parser        → AST (src/ast)
   ▼
 AST
   │  名字绑定  src/binder        → 作用域、符号、闭包
   ▼
 bound AST
   │  代码生成  src/codegen       → LLVM IR 文本 (src/codegen/llvm.ts)
   ▼
 module.ll ──clang──► module.o ──链接──► 可执行文件
                                  ▲
                          runtime/(C 运行时,NaN-boxing 值)
值模型

JavaScript 值统一为一个 64 位字(xt_value)。double 不做装箱直接存放; 其它类型是带标签指针:高 16 位 tag 加 48 位 payload。该表示法在 src/codegen/values.ts 与 runtime/rt.h 中定义一次,编译器与运行时共享。

调用约定

所有编译期函数使用统一 ABI:

xt_value fn(xt_value env, int32_t argc, xt_value *argv);

env 通过 box 以引用方式线程化捕获变量,因此直接调用与闭包调用共用同一条 代码路径。不易内联的 JavaScript 语义(+ 隐式转换、属性访问、打印)委托给 @xt_* 运行时调用。数值算术与比较是例外:两个操作数都是 double 时,codegen 直接内联硬件运算,只有需要隐式转换的情况才回退到运行时。

运行时

runtime/ 实现字符串、对象、数组、闭包、算术、比较、异常与类 Node 的 console.log 打印。C 代码按功能拆分到多个翻译单元(xt_alloc.c、xt_values.c、 xt_containers.c、xt_stdlib.c、xt_builtins.c、xt_io.c),共享私有头 runtime/rt_internal.h。堆对象由 xt_alloc 分配,由非移动标记-清扫回收器回收: 根包括显式值槽(模块全局、原型缓存)、运行时根提供者(事件循环、Promise 微任务队列) 与对活动 C 栈的保守扫描。存活堆超过阈值后自动回收(XT_GC_THRESHOLD 可固定阈值), 也可按需触发;每次回收后阈值变为存活堆的两倍(下限 1 MiB),XT_GC_TRACE=1 会为 每次回收打印一行。错误对象会从生成代码维护的影子调用栈采集 JS 级堆栈(函数名、源文件 与函数级行号);原生致命信号也会打印同一组帧。函数符号保留源码名称(如 xt_fn_3_add),原生调试器与崩溃报告同样可读。

使用方法

使用前请先确认: 各平台的运行前置条件见 使用前置要求。xbintsc 不再自带编译器,每个平台 都需要安装兼容 clang 的工具链(macOS:Xcode Command Line Tools;Linux: clang+lld;Windows:LLVM + Visual Studio C++ 生成工具)。

预编译独立发布包

每个 GitHub Release 都会附上 各平台的发布归档,并在旁边附 .sha256 校验文件:

平台 归档
Windows x64 / arm64 xbintsc-<version>-win32-x64.tar.zst / xbintsc-<version>-win32-arm64.tar.zst
Linux x64 / arm64 xbintsc-<version>-linux-x64.tar.zst / xbintsc-<version>-linux-arm64.tar.zst
macOS x64 / arm64(Apple Silicon) xbintsc-<version>-darwin-x64.tar.zst / xbintsc-<version>-darwin-arm64.tar.zst

(仅当构建机没有 zstd 时才会回退为 .tar.gz。)

<version> 是发布版本号(例如 0.3.8),会写入归档文件名,避免不同版本的下载文件相互覆盖。

每个归档解压后都是一个 xbintsc-<os>-<arch>/ 目录,其中包含编译器 (bin/xbintsc[.exe])与 C 运行时。它无需 Node.js,但你需要先安装对应平台 的工具链(见 使用前置要求)。解压后把 bin/ 加入 PATH(或直接调用 bin/xbintsc)即可,xbintsc 本身无需安装步骤。

macOS / Linux 示例 —— 此处以 xbintsc-<version>-darwin-arm64.tar.zst 为例(请按你的平台 换成 -linux-x64 等):

# 1. 校验哈希(可选,但推荐)
shasum -a 256 -c xbintsc-<version>-darwin-arm64.tar.zst.sha256   # Linux:sha256sum -c

# 2. 解压
tar -xf xbintsc-<version>-darwin-arm64.tar.zst

# 3. 编译并运行 hello.ts(见下)
./xbintsc-darwin-arm64/bin/xbintsc run ./hello.ts

# 4. ...或产出独立的二进制
./xbintsc-darwin-arm64/bin/xbintsc build ./hello.ts --out ./build
./build/hello

Windows 示例 —— 先安装 LLVM 与 Visual Studio C++ 生成工具(见 使用前置要求),再从 Releases 页面 下载对应归档 (此处为 xbintsc-<version>-win32-x64.tar.zst;Windows on ARM 请用 -arm64), 然后在 x64 Native Tools Command Prompt for VS 2022(Windows on ARM 用 ARM64 Native Tools)中执行以下命令 —— Windows 11+ 自带 tar:

# 1. 校验哈希(可选,但推荐)
(Get-FileHash .\xbintsc-<version>-win32-x64.tar.zst -Algorithm SHA256).Hash
Get-Content .\xbintsc-<version>-win32-x64.tar.zst.sha256

# 2. 解压
tar -xf .\xbintsc-<version>-win32-x64.tar.zst

# 3. 编译并运行 hello.ts(见下)
.\xbintsc-win32-x64\bin\xbintsc.exe run .\hello.ts

# 4. ...或产出独立的 hello.exe
.\xbintsc-win32-x64\bin\xbintsc.exe build .\hello.ts --out .\build
.\build\hello.exe
// hello.ts
console.log("Hello from xbintsc!");

提示:把 xbintsc-win32-x64\bin 加入 PATH,即可直接用 xbintsc 命令。

通过 npm 使用

编译器也发布为 npm 包 xbintsc。对 Node 项目来说这是最短的路径:装成开发依赖, 然后通过 npx 或 npm 脚本调用。

npm install --save-dev --save-exact xbintsc
npx xbintsc doctor
npx xbintsc build src/main.ts --out build

它需要 Node.js 22+ 与 clang 16+ 工具链。安装时还会带上宿主平台对应的 @xbintsc/<os>-<arch> 包,其中包含预编译运行时归档(core、ext_node,以及 发布为其构建的 gui/media),所以首次构建直接链接归档而不编译 C。如果 npm 跳过了这个可选包,才会从随包源码编译运行时并缓存到 .xbintsc/。完整指南、CI 配置与注意事项见通过 npm 包使用 xbintsc。

作为开发者(从源码)

在源码检出中,通过 tsx 直接运行 TypeScript 源码(或使用 npm run xbintsc)。 bin 启动器在这里同样可用:没有 dist/ 构建时会自动回退到 tsx。

# 安装依赖
npm install

# 编译并运行程序
npm run xbintsc -- run examples/hello.ts
# 等价于
npx tsx src/cli/main.ts run examples/hello.ts

# 产出原生二进制
npx tsx src/cli/main.ts build examples/hello.ts --out build/examples
./build/examples/hello

# 查看生成的 LLVM IR
npx tsx src/cli/main.ts emit examples/hello.ts | head

# 使用可选扩展(这里为 Node 的 fs,通过 import 引入)
npx tsx src/cli/main.ts run examples/node/read.ts --ext node

CLI 选项:

-o, --output <path>   输出路径
    --out <dir>       输出目录(默认 build/)
    --emit <kind>     exe | obj | ir(默认 exe)
-O0..-O3              优化级别(默认 -O2)
    --ext <names>     逗号分隔扩展(如 node)
    --ext-native <m>  从 JSON manifest 注册 C++/Rust 扩展
    --force           忽略增量缓存
    --verbose         打印进度信息
    --time            打印各构建阶段耗时
    --debug           生成调试信息(DWARF/CodeView)并保留帧指针
    --check           运行语义检查(默认)
    --no-check        跳过语义检查,只擦除类型语法
编程接口
import { build, compileString } from "xbintsc";

const { ir } = compileString("console.log(1 + 1);");
const result = build("program.ts", { emit: "exe", outDir: "build" });

GUI 应用(HTML/CSS)

xbintsc 也能构建 界面用 HTML/CSS 编写的原生桌面应用。可选的 gui 扩展会把一个 自研的、GPU 加速的 HTML/CSS 渲染器(自有 HTML 解析器、CSS 层叠、布局与 SDL_GPU 合成器,不使用系统 WebView,也不内嵌浏览器)链接进可执行文件,并作为可 import 的模块暴露出来:

// app.ts
import { createWindow, run } from "gui";
// .html 资产加载器会把文档里的脚本提前编译(见下文)
import page from "./page.html";

const win = createWindow({ title: "Demo", width: 900, height: 600 });
win.on("click", (e: any) => console.log(e.x, e.y, e.target));
win.loadHTML(page);
run();                          // 主循环,直到所有窗口关闭
# 源码检出:先构建一次引擎归档(会获取并构建 SDL3、FreeType/HarfBuzz 与 glslang;默认文本使用内置 stb_truetype),
# 然后运行仓库自带示例
npm run gui
npx tsx src/cli/main.ts run examples/gui/hello.ts --ext gui

# 发布包或 npm 安装都已经内含该引擎:
xbintsc run app.ts --ext gui

# <video>/<audio> 解码是可选的链接特性:编译器从页面里扫到元素后只为本次构建
# 链接 FFmpeg 归档,因此只做界面的二进制不会链接 FFmpeg:
npm run media
xbintsc run examples/gui/media.ts --ext gui

文档里的 <script> 脚本会被 xbintsc **提前编译(AOT)**进二进制——内联脚本 (裸 <script> 本身就按 TypeScript 处理)与外部 <script src="./app.ts"> 文件 都是如此——因此运行时依然没有 JavaScript 引擎。元素句柄、DOM 变更、事件与脚本接口 见 doc/zh-CN/gui-scripts.md。

在项目里把扩展写进 xbintsc.config.json("extensions": ["gui"])即可省去 --ext gui,与 node 完全一样。设置 XT_GUI_AUTOCLOSE_MS=<ms> 可在指定毫秒后 自动关闭所有窗口,端到端测试正是用它无头运行示例。

仓库里的示例是 examples/gui/pelican-bike examples/gui/pelican-canvas ——一个可玩的 2D 游戏(分别使用dom和canvas绘制),它的同一份文档在浏览器里也能直接打开。 examples/gui/pelican-3d 更进一步:一个用九个 ES module 搭起来的 WebGL 2 低多边形鹈鹕骑车场景,并用 AudioContext 合成车铃、 风声和跳跃音效。

平台与完整说明:doc/zh-CN/gui.md 是引擎总览(架构与 路线图);按功能拆分的文档位于 doc/zh-CN/gui/ —— API、 DOM/CSS、布局、绘制、媒体、输入、动画、运行时、构建与已知问题。Linux 与 macOS 已在 CI 中构建 并实际运行,其发布包与可选的 @xbintsc/<os>-<arch> npm 包内含引擎(gui.a)与 可选的媒体归档(media.a);Windows x64 也会随发布包与 npm 平台包提供 gui.lib (通过 SDL_GPU 的 Vulkan 后端渲染)与 media.lib。媒体播放目前仅支持 POSIX:没有 media.a 或在 Windows 上,<video> 与 <audio> 会触发 error。

增量编译

驱动以入口源码哈希、编译器版本、编译选项、平台与启用的扩展集合作为每次构建的 键(src/driver/cache.ts)。如果所有记录的产物仍然存在,构建立即返回。C 运行时 与扩展源按同样的原则只编译一次并缓存。

扩展

扩展是一个普通对象(src/extensions/registry.ts)。内置扩展有三个:gui, 它贡献的是一个 GPU HTML/CSS 渲染器(见下文「GUI 应用(HTML/CSS)」一节与 doc/zh-CN/gui.md);media,基于 FFmpeg 的可选 <video>/<audio> 解码器,依赖 gui;以及 node,它本身按每个 Node 模块拆分目录,每个模块把它对外导出的绑定与实现它们的 C 源配对:

src/extensions/node/       runtime/ext_node/
  index.ts   # nodeExtension  fs/read_file.c   fs/write_file.c   fs/fs_ops.c
  fs/index.ts                path/path.c      os/os.c           process/process.c
  fs/read-file.ts
  path/index.ts
  os/index.ts
  process/index.ts
// src/extensions/node/index.ts
const modules: readonly NodeModule[] = [fsModule, pathModule, osModule, processModule];

export const nodeExtension: Extension = {
  name: "node",
  runtimeSources: () => [...new Set(modules.flatMap((m) => m.runtimeSources()))],
  modules: () => Object.fromEntries(
    modules.flatMap((m) => {
      const entry = { namespace: m.namespace, exports: m.exports?.() ?? m.builtins() };
      return [[m.name, entry], [`node:${m.name}`, entry]];
    }),
  ),
};

注册它会链接额外的 C 源,并通过 import 暴露 Node API: import { readFileSync } from "fs" 会解析到具有统一 (argc, argv) 调用约定的 C 符号。path、os 与 process 还会接入命名空间分发,因此 import path from "path"(或 import * as path from "path")会让 path.join(...) 与 process.cwd() 下降为各自的运行时入口。新增一个模块意味着在 src/extensions/node/ 下放入一个目录、并在 runtime/ext_node/ 下放入对应的 C 实现;核心编译器永不改动。

Node 模块覆盖情况:

  • Node 扩展:已实现
  • Node 扩展:未实现
原生扩展(C++ / Rust)

扩展并非只能用 C 或 TypeScript 编写。只要库以 extern "C" 暴露运行时 ABI 的 入口(xt_value fn(int32_t argc, xt_value *argv)),就可以被链接进来。把 C++ 或 Rust 代码编译为对象文件或静态库,用一个很小的 JSON manifest 描述它, 再通过 --ext-native 传入:

./examples/extensions/cpp/build.sh
xbintsc run examples/extensions/cpp/demo.ts \
  --ext-native examples/extensions/cpp/xbintsc.manifest.json
{
  "name": "mathx-cpp",
  "objects": ["build/mathx.o"],
  "linkerFlagsByPlatform": { "linux": ["-lstdc++", "-lm"], "darwin": ["-lc++"], "win32": ["-lmsvcprt"] },
  "builtins": { "cppClamp": { "symbol": "mathx_clamp" } },
  "modules": { "mathx": { "exports": { "add": { "symbol": "mathx_add" } } } }
}

之后 import { add } from "mathx" 会像 C 运行时绑定一样下降为 C++/Rust 符号。 可运行的 C++ 与 Rust 工程见 examples/extensions/,编写 辅助见 runtime/xt_ext.h / runtime/xt_ext.rs。

测试

npm run typecheck        # tsc --noEmit
npm test                 # 单元 + 端到端(存在 clang 时运行真实二进制)
npm run test:e2e         # 仅编译并运行的测试
npm run coverage         # TypeScript 编译器(src/)的 V8 覆盖率
npm run coverage:runtime # C runtime(runtime/)的 LLVM 覆盖率

测试在 tests/ 下按模块组织(lexer、parser、binder、codegen、driver、 extensions、cli、e2e)。

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm xbintsc

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Frame 2085668439 (1)
Group 1261154229