Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
es_runtime
es_runtime is a crate aimed at making it possible for rust developers to integrate an ECMA-Script engine in their rust projects
The engine used is the Mozilla SpiderMonkey engine (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey)
This project was started as a hobby project for me to learn rust. I hope some of you find it useful to learn about using spidermonkey from rust.
status
Nowhere near production ready, it is untested and i'm pretty sure i created some memory leaks in the unsafe sections...
It works with the mozjs crate version 0.10.1 which is already pretty old but there are no newer releases, when i get more comfortable with spidermonkey and mozjs i'll see about using a git pull of a newer version.
Please see the CHANGELOG for what's new.
Currently i'm working towards creating a 0.1 version which has a couple of goals
- Get a grip on when to use rooted values (Handle) and when to use Values (JSVal)
- Easy loading script files
- Error handling (get ES errors in rust with filename/linenumber etc)
- Adding rust function to the engine so they are callable from ECMA-Script
- Blocking
- Non-blocking (returns a Promise in script)
- Easy way to call ECMA-Script functions from rust
- By name (run_global_function())
- By object name and name (myObj.doSomething())
- Passing params from rust
- Getting data from engine as primitives or Vecs and Maps
- Primitives
- Objects from and to Maps
- Arrays as Vecs
- Working console (logging)
- Working Promises in Script
- Waiting for Promises from rust
- import/export statement support
- cache modules
- No more memory leaks
0.2 goals
- Use PersistentRooted instead of deprecated Add*Root and Remove*Root
- typedArrays from and to Vecs
future goals / todo's
- Interactive Debugging
- Profiling
- TypeScript support
- much more
Other plans
I'm also working on a more feature rich runtime with a commandline tool and also an application server based on this runtime
These are in a very early testing stage and may become available later as a separate project.
I'dd like to hear what you would want to see in this project, please drop me a line @ incoming+drfos-es-runtime-17727229-issue-@incoming.gitlab.com
examples
Cargo.toml
[]
= "0.0.5"
my_app.rs
a word on compiling
Currently I have only compiled this on and for a 64 bit linux machine (I use openSUSE)
Besides rust you'll need to install the following packages to compile the mozjs crate
- gcc-7
- autoconf2.13
- automake
- clang
- python
for more detailed info please visit https://github.com/servo/mozjs#building