Coder Social home page Coder Social logo

Comments (4)

Hanks10100 avatar Hanks10100 commented on July 18, 2024

Maybe not.

A more practical way is to encode your c++ data structure into binary and decode it in the javascript.

from wasm-examples.

signgitgit avatar signgitgit commented on July 18, 2024

Thank for your response.

You know my first problem was how to pass multiple variables in the same function but after some research i saw that is impossible and i wanted to try data structures.

I want to ask you if the encode and decode data structures is the best solution for my first problem or exist another solutions

from wasm-examples.

Hanks10100 avatar Hanks10100 commented on July 18, 2024

In my opinion, encode and decode the data in WebAssembly.Memory is the most efficient way (for now).

However, the Emscripten also provides the Embind and WebIDL Binder technology to bind C++ data structures to js, but it relies on extra IDL or js "glue" file to achieve that. It's convenient but seems expensive. Under the hood, I think it still based on encoding and decoding the WebAssembly.Memory (not confirmed).

from wasm-examples.

signgitgit avatar signgitgit commented on July 18, 2024

Thank you for your quick and helpful response and also for the links.

from wasm-examples.

Related Issues (7)

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.