Expand description
§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.
Modules§
Functions§
- build_
function_ from_ code - The function compile string to bytecode of Virtual Machone. If some erros happens, return it with errpr message in a Resut.
- dump_
function - Print all bytecode of Function object, whith internal data.
- new_
runtime - Create an new JsRuntime struct of ezjs, which execute byte of VMFunction. All internal members are open and defined in runtime.rs.
- run_
script - Run bytecode of VMFunction with a runtime, and return the result sharedvalue. See more info via repl example.