Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Grower
ブラウザ上で稼働する言語ランタイムのためのライブラリ(**G**eneral **R**untime **O**n **WE**b browser**R**s)
Grower: **G**eneral **R**untime **O**n **WE**b browser**R**s

A Library for development language runtimes that run on Web Browsers.

## Structures

### grower-rs

言語ランタイムのうち,WebAssembly コードとして動作する部分を実装するための Rust クレート.
A Rust crate to implement parts of Language Runtimes running as WebAssembly codes.

### grower-js

言語ランタイムのうち,JavaScript コードとして動作する部分を実装するための Rust クレート.
A npm library to implement parts of Language Runtimes running as JavaScript codes.
34 changes: 34 additions & 0 deletions grower-rs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Grower
Grower: **G**eneral **R**untime **O**n **WE**b browser**R**s

A Library for development language runtimes that run on Web Browsers.


## Features

### core::jsni

An implementation of JSNI (JavaScript Native Interface). JSNI is a FFI for a linear-memory between WebAssembly Runtimes and JavaScript Runtimes. You may use this API to call JavaScript functions from Rust.

For example:

```rust
use grower::core::jsni::*;

let ni = JavaScriptNativeInterface::new();

let return_values: Vec<JSNIValue> = ni.call("hogeFunc".to_string(), vec![
JSNIValue::from(2 as i8),
JSNIValue::from(1 as i16),
JSNIValue::from(1 as i32),
JSNIValue::from(1 as i64),
JSNIValue::from(8 as u8),
JSNIValue::from(16 as u16),
JSNIValue::from(32 as u32),
JSNIValue::from(64 as u64),
JSNIValue::from(0.5 as f32),
JSNIValue::from(6.4646464 as f64),
JSNIValue::from("hoge".to_string()),
JSNIValue::from(vec![1, 2, 3, 4, 5, 6, 7, 8]),
]).await;
```