#javascript #run-time #bytecode #dsl

bin+lib ezjs

ezjs 是一个简单的 Rust 实现的微型 Javascript (ES5) 引擎

2 个版本

0.1.1 2021 年 5 月 11 日
0.1.0 2021 年 4 月 4 日

#941 in 编程语言

MIT 许可证

195KB
6K SLoC

ezjs

A easy Javascript (ES5) runtime by Rust. https://crates.io/crates/ezjs

A pure Rust implementation for Javascript (ES5 strict mode), including a simple bytecode virtual machine. Whole design is inspired from https://mujs.com/ .


lib.rs:

ezjs

A light Javascript (ES5 version) runtime library , you can use Javascript as DSL in your project. Whole design is inspired from https://mujs.com/, including including a simple bytecode virtual machine. You can added a extenstion hook type via Rust's generic features, and this hook type play key role in your DSL enviroment.

All implementation including tokenlizer, AST builder, compiler, optimizer(TODO), and VM executer is simple and easy to debug, so I called this library ezjs.

An completed example is a repl ( src/bin/repl.rs), which including a hookable extention struct.

No runtime deps