Skip to content

An implementation of nucleus-js using duktape and libuv implemented in rust

License

Notifications You must be signed in to change notification settings

nucleus-js/rustyduk

Repository files navigation

rustyduk

This is an implementation of the nucleus-js design spec written in Rust and using the duktape JavaScript engine.

The rustc compiler and the cargo package manager are necessary in order to build this project. The best way to install Rust on Unix is probably to use rustup.rs.

Note: This repo also uses git submodules to manage it's dependencies. As such, cloning this repo must be done with git clone --depth=1 ....

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Building

make

or

cargo build

Examples

Single-file:

// hello.js
print('hello world')
./target/debug/nucleus --no-bundle hello.js
> hello world

Bundle: (main.js)

// bundle/main.js
print('hello world')
./target/debug/nucleus bundle -o hello-app
./hello-app
> hello world

Tests

Manual tests:

make test

Currently, each test should have output that looks similar to this. In the future, it will use the design repo's automated tests.

Hello World!
nucleus:  [object Object]
cmd:  target/debug/nucleus
rawArgs:  target/debug/nucleus,--no-bundle,test.js,--,0,5,10
rawArgs[0]:  target/debug/nucleus
rawArgs[1]:  --no-bundle
rawArgs[2]:  test.js
rawArgs[3]:  --
rawArgs[4]:  0
rawArgs[5]:  5
rawArgs[6]:  10
engine:  duktape
versions:  [object Object]
versions.duktape:  v1.5.0
envkeys:  SHELL, <... etc>
envkeys(true): SHELL, <... etc>
readfile('test-error.js')  print('hi')

nucleus.exit('aaaa')

print(":/")

throw new Error('error!!')

print('noooo')

exit:  function () {"native"}

License

rustyduk is licensed under the Apache 2.0 License.

About

An implementation of nucleus-js using duktape and libuv implemented in rust

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •