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

yanked duktape_sys

Unsafe, low-level wrapper for duktape JavaScript interpreter

Uses old Rust 2015

0.0.2 Jan 28, 2015
0.0.1 Dec 7, 2014

#17 in #duktape


Used in duktape

MIT license

4.5MB
82K SLoC

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

Contains (ELF exe/lib, 13KB) src/generate

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:

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