#duktape #javascript #wrapper #low-level #interpreter #function #json

sys duktape_ffi

Unsafe, low-level wrapper for duktape JavaScript interpreter

1 unstable release

Uses old Rust 2015

0.0.1 Aug 4, 2015

#16 in #duktape

MIT license

4.5MB
82K SLoC

C 81K SLoC // 0.3% comments JavaScript 664 SLoC // 0.2% comments Rust 534 SLoC // 0.0% comments CoffeeScript 32 SLoC // 0.1% comments

Build Status

Documentation.

WORK IN PROGRESS.

A Rust wrapper for Duktape. Things to do before this is minimally useful:

  • Handle non-UTF-8 strings.
  • Call JavaScript functions by name.
  • Define functions.
    • Call specified Rust functions from JavaScript.
    • Return errors from Rust to JavaScript.
  • Convert to use Encodable/Decodable everywhere.
    • Convert parameters to use Encodable.
    • Replace Value with serialize::Json.
    • Convert return values to use Decodable.
  • Add nice macros.
    • Provide macro for calling functions.
    • Provide macro for defining functions.

lib.rs:

EXPERIMENTAL: Low-level, unsafe wrapper arround the duktape API.

Note that some of this code is generated based on the specific compiler, operating system and processor, so various details may change depending on the system you're targeting. Do not assume that constants or integer sizes are the same everywhere!

We do not yet provide replacements for duktape function macros, but pull requests are very welcome.

Dependencies