GithubHelp home page GithubHelp logo

cryze / rust-webplatform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rust-webplatform/rust-webplatform

0.0 3.0 0.0 717 KB

Rust library for Emscripten-compiled JS apps.

Makefile 0.02% Rust 0.69% Shell 0.10% JavaScript 98.73% HTML 0.16% CSS 0.31%

rust-webplatform's Introduction

rust-webplatform

let body = HtmlNode::query("body").unwrap();
body.html_set("<h1>HELLO FROM RUST</h1> <button>CLICK ME</button>");
let mut button = HtmlNode::query("button").unwrap();
button.on("click", || alert("WITNESS ME"));

Thanks to the high heavens for tomaka and then AerialX for making this possible.

Running Rust in your Browser

To use rust-webplatform and Rust in your browser, you'll need a very particular setup. This is based off an older approach of cross-compilation; see this thread the status of merging Emscripten support into latest Rust.

Note: The version of Rust used is from March 12, which is a 1.0.0 beta. Some APIs are slightly changed and not yet stable in this version, and features in newer version of Rust will require modification.

  • First, install multirust.
  • Create a new folder. In that folder, save the setup.sh file.
  • Run source setup.sh. It will download and install all the dependencies for the cargo-build setup.
  • Clone this repository into your folder, cd into it, and run make.

You should run source setup.sh in the root directory each time you have a new terminal session to make building this project work.

License

MIT/Apache-2.0

rust-webplatform's People

Contributors

aerialx avatar tcr avatar tcr3dr avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.