Giter Club home page Giter Club logo

Comments (4)

ibaryshnikov avatar ibaryshnikov commented on May 31, 2024

Here is an example how it may look like
https://github.com/ibaryshnikov/wasm_game_of_life/blob/master/src/lib.rs#L170
If you like an idea, I'll submit a pr

from wasm_game_of_life.

fitzgen avatar fitzgen commented on May 31, 2024

I think it is valuable to show off how to have JS and Rust/Wasm interact with each other. While the whole game of life could definitely be implemented in Rust/Wasm without any hand-written JS, it wouldn't help people learn the skills necessary for incrementally replacing some JS module with Rust and having them work well with each other.

from wasm_game_of_life.

ibaryshnikov avatar ibaryshnikov commented on May 31, 2024

@fitzgen sounds reasonable

from wasm_game_of_life.

tyt2y3 avatar tyt2y3 commented on May 31, 2024

Hi all! I am new to the rust community. I tried to reimplement all javascript in pure rust, including click handling and play/pause. Below is my code. I can't create a pull request though (because cannot request a new branch).

I can also share my experience. I think it is somewhat cleaner and actually produces less hassle to implement whole app in rust, because I don't have to concern too much about the rust-javascript interface and the efficiency.

On the other hand, handling javascript objects in rust is a pain in the butt, especially dealing with HTML5 APIs and event listeners.

I think we may consider extending the tutorial to discuss this matter further, or dedicate a new tutorial about implementing HTML5 apps in pure rust.

https://github.com/tyt2y3/wasm_game_of_life/tree/pure-rust

from wasm_game_of_life.

Related Issues (20)

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.