Skip to content

mvolkmann/wasm-rust-linear-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wasm-rust-linear-memory

This demonstrates sharing memory between Rust and JavaScript using WASM.

The steps followed to create this were:

  1. Create the project with cargo new --lib wasm-rust-linear-memory

  2. Modify Cargo.toml to contain:

    [lib]
    crate-type = ["cdylib"]
    
    [dependencies]
    wasm-bindgen = "0.2.70"
  3. Modify src/lib.rs

  4. Build the project with wasm-pack build --target web

  5. Create index.js

  6. Create index.html

To run this:

  1. Start a local HTTP file server. One approach is to install Deno and then enter these commands:

    deno install --allow-net --allow-read https://deno.land/std@0.87.0/http/file_server.ts
    file_server .
  2. Browse localhost:{port} where port is the port on which the local server is listening.

  3. See the output in the DevTools console.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published