Skip to content

rustscript-lang/rustscript-compat-frontends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pd-vm Compatibility Frontends

pd-vm-compat-frontends on crates.io

JavaScript and Lua compatibility frontends for pd-vm.

This crate owns the compatibility-language pieces that are intentionally outside the core rustscript repository:

  • JavaScript parser dialect configuration and lowering rewrites
  • Lua parser/lowering helpers
  • JavaScript and Lua import scanning / import stripping for source-file loading
  • compatibility frontend tests and fixtures

Usage

pd-vm = "0.22.2"
pd-vm-compat-frontends = "0.1.0"
use vm::compile_source_file_with_options;

let options = pd_vm_compat_frontends::compile_options();
let compiled = compile_source_file_with_options("examples/example.js", options)?;

The crate also ships a CLI binary with the same entry surface as pd-vm-run, but with the JavaScript and Lua source plugins pre-registered:

cargo run --bin pd-vm-compat-run -- examples/example.js
cargo run --bin pd-vm-compat-run -- examples/example.lua
pd-vm-compat-run fmt --check examples/example.js
pd-vm-compat-run --emit-vmbc out.vmbc examples/example.lua

Supported extensions

  • .js -> JavaScript compatibility frontend
  • .lua -> Lua compatibility frontend

Core RustScript (.rss) remains in the pd-vm crate.

Development

cargo test --workspace 
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings

About

Compile JavaScript and Lua to run in RustScript VM

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages