mquickjs
6,238
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
C
语言
创建时间
最近更新
项目能做什么
Micro QuickJS JavaScript 引擎的公开仓库。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
MicroQuickJS
============
## Introduction
MicroQuickJS (aka. MQuickJS) is a JavaScript engine targeted at
embedded systems. It compiles and runs JavaScript programs using as little
as 10 kB of RAM. The whole engine requires about 100 kB of ROM (ARM
Thumb-2 code) including the C library. The speed is comparable to
QuickJS.
MQuickJS only supports a [subset](#javascript-subset-reference) of JavaScript close to ES5. It
implements a **stricter mode** where some error prone or inefficient
JavaScript constructs are forbidden.
Although MQuickJS shares much code with QuickJS, it internals are
different in order to consume less memory. In particular, it relies on
a tracing garbage collector, the VM does not use the CPU stack and
strings are stored in UTF-8.
## REPL
The REPL is `mqjs`. Usage:
```
usage: mqjs [options] [file [args]]
-h --help list options
-e --eval EXPR evaluate EXPR
-i --interactive go to interactive mode
-I --include file include an additional file
-d --dump dump the memory usage stats
--memory-limit n limit the memory usage to 'n' bytes
--no-column no column number in debug information
-o FILE save the bytecode to FILE
-m32 force 32 bit bytecode output (use with -o)
-b --allow-bytecode allow bytecode in input file
```
Compile and run a program using 10 kB of RAM:
```sh
./mqjs --memory-limit 10k tests/mandelbrot.js
```
In addition to normal script execution, `mqjs` can output the compiled
bytecode to a persistent storage (file or ROM):
```sh
./mqjs -o mandelbrot.bin tests/mandelbrot.js
```
Then you can run the compiled bytecode as a normal script:
```sh
./mqjs -b mandelbrot.bin
```
The bytecode format depends on the endianness and word length (32 or
64 bit) of the CPU. On a 64 bit CPU, it is possible to use the option
`-m32` to generate 32 bit bytecode that can run on an embedded 32 bit
system.
Use the option `--no-column` to remove the column number debug info
(only line numbers are remaining) if you want to save some storage.
## Stricter mode
MQuickJS only supports a subset of JavaScript (mostly ES5). It is
always in **stricter** mode where some error prone JavaScript features
are disabled. The general idea is that the stricter mode is a subset
of JavaScript, so it still works as usual in other JavaScript
engines. Here are the main points:
- Only **strict mode** constructs are allowed, hence no `with` keyword
and global variables must be declared with the `var` keyword.
- Arrays cannot have holes. Writing an element after the end is not
allowed:
```js
a = []
a[0] = 1; // OK to extend the array length
a[10] = 2; // TypeError
```
If you need an array like object with holes, use a normal object
instead:
```js
a = {}
a[0] = 1;
a[10] = 2;
```
`new Array(len)` still works as expected, but the array elements are
initialized to `undefined`.
Array literals with holes are a syntax error:
```js
[ 1, ,
阅读完整原文
商业机会分析 AI 生成
嵌入式物联网(IoT)轻量化 JS 运行时与模块化 SDK
| 产品构想 | 基于 MQuickJS 构建适配主流微控制器(如 ESP32、STM32、RP2040)的现成 SDK,封装常见 GPIO、I2C、WiFi、MQTT 等外设接口,提供即插即用的低门槛 JS 开发套件 |
| 核心功能 | 外设硬件 C-JS 绑定封装、离线字节码预编译器、极简 REPL 串口调试工具、低功耗休眠事件循环 |
| 目标用户 | 智能家居、工业传感器及可穿戴设备方案商及创客团队 |
| 难度/周期 | 中等 · 1-3个月 · 成本:极低(开发板硬件采购、本地开发环境) |
| 收费模式 | 核心开源 + 闭源外设增强包/商业方案打包授权,配套开发板硬件溢价分成 |
| 竞争风险 | 底层引擎版权许可不明(NOASSERTION)可能阻碍企业客户直接购买;硬件生态支持碎片化 |
| 依据 | 已验证事实 |
边缘/MCU 脚本 OTA 热更新与轻量规则引擎
| 产品构想 | 利用 MQuickJS 内存消耗小(10KB RAM)及支持直接加载预编译字节码(-o / -b)的特性,打造端侧动态更新与离线业务规则配置方案 |
| 核心功能 | 字节码安全签名与增量分发机制、内存沙箱与超额熔断看门狗、端云联动规则引擎模板 |
| 目标用户 | 需要频繁变更业务逻辑但固件升级成本高/风险大的工业 IoT 企业 |
| 难度/周期 | 中等 · 2-4个月 · 成本:低(基础云服务测试、MCU 测试阵列) |
| 收费模式 | 企业级私有化部署实施费、按设备接入量授权或年费订阅(SaaS/PaaS) |
| 竞争风险 | MQuickJS 属于 JavaScript 的严格受限子集(无 holes array、严格全局 eval),客户现有 JS 代码无法直接平移(需重写) |
| 依据 | 数据支持的判断 |
面向桌面软件与游戏的极度轻量级插件/脚本扩展库
| 产品构想 | 为要求极端冷启动速度或极度控制安装包体积的客户端/移动端/游戏提供替代 Lua 的 JS 嵌入式解决方案(仅 ~100KB ROM) |
| 核心功能 | C++ 一键集成头文件、跨平台绑定代码生成器(Bindings Generator)、内存统计诊断面板 |
| 目标用户 | 独立独立游戏开发者、C/C++ 桌面小工具开发者、高频轻量插件系统设计者 |
| 难度/周期 | 较高 · 1-2个月 · 成本:极低(纯软件开发) |
| 收费模式 | 商业客户技术支持、增值插件生态分成、赞助与咨询服务 |
| 竞争风险 | Lua 在该领域生态极其成熟强势;MQuickJS 缺乏 ES6+ 语法糖,对普通前端开发者吸引力受限(推测) |
| 依据 | AI推测 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| mitchellh/zig-mquickjs | 中文介绍暂未生成 Zig build and bindings for Micro QuickJS |
90 | Zig |
| Valian/mquickjs_ex | 中文介绍暂未生成 Embedded JS runtime for Elixir based on MQuickJS |
55 | Elixir |
| Dunqing/mquickjs-rs | 中文介绍暂未生成 A Rust port of mquickjs, fully implemented by Claude |
11 | Rust |
| ad-si/mquickjs-hs | 中文介绍暂未生成 Haskell wrapper for the Micro QuickJS JavaScript Engine |
7 | C |
| chenshuang888/esp32-desktop-companion | 中文介绍暂未生成 ESP32-S3 + LVGL 9 + esp-mquickjs:开发主仓。固件不重烧即可装动态 App,自研 1005 |
4 | C |
| fcoury/mquickjs-rs | 中文介绍暂未生成 | 3 | Rust |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 ,最近推送 |
| 社区活跃 | Star 6,238 / Fork 0 / Issue 0(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
快速开始(以仓库 README 为准)
git clone https://github.com/bellard/mquickjs.git cd mquickjs # 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。