一个非常小的 v8 javascript 运行时,仅适用于 Linux。
在Techempower第21回测试中,获得第一名!!!
github地址:https://github.com/just-js/just
构建和运行
目前正在x86_64上开发现代linux(debian/ubuntu和alpine tested)
# download and run the build script
sh -c "$(curl -sSL https://raw.githubusercontent.com/just-js/just/current/install.sh)"
# install just binary to /usr/local/bin
make -C just install
# export the just home directory
export JUST_HOME=$(pwd)/just
export JUST_TARGET=$JUST_HOME
# if you don't want to install, add JUST_HOME to SPATH
export PATH=$PATH:$JUST_HOME
# run a shell
just
创建新应用程序
# initialise a new application in the hello directory
just init hello
cd hello
# build hello app
just build hello.js --clean --static
./hello
命令行选项
运行 Just shell/repl
just
通过管道将脚本传送到 stdin
cat hello.js | just --
评估一些作为参数传递的Javascript
just eval "just.print(just.memoryUsage().rss)"
运行脚本
just hello.js
初始化新项目并构建它
just init hello
cd hello
just build
清理已建项目
just clean
理念/目标
- 适用于 Linux 的小型、安全、健壮且高性能的 js 运行时
- 小代码库。易于理解和破解
- 系统调用,v8和c / c ++标准库之上的非常简单的层
- 最少使用类/函数模板和 OO - JavaScript 中的“c”
- 支持返回代码而不是异常
- 用于在 Linux 上以 javascript 构建系统软件的平台
- 尽可能接近本机性能
- 默认安全
- 尽可能避免抽象。抽象可以在用户空间中构建
- commonjs 模块,不支持 ES 模块
- 默认情况下非异步 - 可以执行阻塞调用,而不使用事件循环
- JS-land 中的事件循环。完全控制 epoll api
- 小型标准库 - 尽可能多地留给用户空间。专注于构建更高级别抽象所需的基元
- 作为Linux系统编程的教学/学习平台很有用,并学习更多关于javascript和v8内部
- 少量源文件
- 最小依赖关系 - g++ 和 make only
- 保持 LOC 尽可能小< 5k
- 在 v8 堆上尽可能少地分配