Skip to content

Investigate replacing stdweb with wasm-bindgen ? #44

Open

Description

@jice-nospam

This is an exploratory issue. wasm-bindgen is making great progress and might be much faster than stdweb for passing data between Rust and js. That might be very interesting, especially for opengl buffers.
https://hacks.mozilla.org/2018/04/javascript-to-rust-and-back-again-a-wasm-bindgen-tale/

Maybe we could start investigating wasm-bindgen on some lower module, like uni_pad or uni_snd

Activity

  1. edwin0cheng commented on Apr 12, 2018

    @edwin0cheng
    Member

    Indeed, i had this idea before, but we should figure out how following items works :

    • What is the output of these lower module ? A wasm file + JS file (using wasm-bindgen) ? And how do we "link" these deliverables when the main engine ?
    • If cargo do support linking wasm file directly (i don't know), how can we run the game without cargo web ?

    Basically, i do not have the big picture about how JS and rust cooperate. Do you have any idea about it?

  2. jice-nospam commented on Apr 12, 2018

    @jice-nospam
    ContributorAuthor

    No idea so far but i'll start playing with it. In my idea, we should still have a single wasm, only replacing internal stdweb glue with wasm-bindgen. I don't now if this impacts cargo-web though.

  3. edwin0cheng commented on Apr 12, 2018

    @edwin0cheng
    Member

    On the other hand, if custom task is landed, we can write a custom task to build all the js glue code , html and other assets we need to run the game. But even this is not landed, we can still make a cargo sub-command to do so.

  4. edwin0cheng commented on Apr 12, 2018

    @edwin0cheng
    Member

    If we have a sub-command, we can go a lot of crazy stuff like preprocessing asset to an bundle, convert file format, etc. I start to think it is a very good idea. :)

  5. self-assigned this
    on Apr 12, 2018
  6. jice-nospam commented on Apr 12, 2018

    @jice-nospam
    ContributorAuthor

    A cargo unrust sub command ? This looks sexy !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions