JavaScript 解释器 MuJS

码农软件 · 软件分类 · 浏览器/JS引擎 · 2019-04-05 14:12:59

软件介绍

MuJS 是一个轻量级的 JavaScript 解释器,用于嵌入到其他的软件中提供脚本执行功能。使用可移植 C 编写,实现了 ECMA-262 规定的 ECMAScript 标准。

开发 MuJS 的原因是 V8、SpiderMonkey 和 JavaScriptCore 都太大太复杂了,MuJS 提供一个非常精简、无错和简单的实现。

示例代码:

#include <stdio.h>
#include <mujs.h>

static void hello(js_State *J)
{
  const char *name = js_tostring(J, 1);
  printf("Hello, %s!\n", name);
  js_pushundefined(J);
}

int main(int argc, char **argv)
{
  js_State *J = js_newstate(NULL, NULL);

  js_newcfunction(J, hello, 1);
  js_setglobal(J, "hello");

  js_dostring(J, "hello('world');", 0);

  js_freestate(J);
}

本文地址:https://www.codercto.com/soft/d/2916.html

Python for Everyone

Python for Everyone

Cay S. Horstmann、Rance D. Necaise / John Wiley & Sons / 2013-4-26 / GBP 181.99

Cay Horstmann's" Python for Everyone "provides readers with step-by-step guidance, a feature that is immensely helpful for building confidence and providing an outline for the task at hand. "Problem S......一起来看看 《Python for Everyone》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具