/gwasm-dispatcher-cpp

gWASM dispatcher API for C++

Primary LanguageC++GNU Lesser General Public License v3.0LGPL-3.0

gwasm dispatcher cpp

gwasm_dispatcher_cpp is a library that makes it easy to run an application with gwasm_runner.

There is also a similar library for rust: gwasm-dispatcher.

Usage

#include <gwasm.hpp>

std::vector<std::tuple<gwasm::Blob, int, gwasm::Output>>
my_splitter(int argc, char* argv[], gwasm::SplitContext& context);

std::tuple<int, gwasm::Blob>
my_executor(gwasm::Blob&& blob, int i, gwasm::Output&& output);

void
my_merger(int argc,
          char* argv[],
          std::vector<std::pair<std::tuple<gwasm::Blob, int, gwasm::Output>,
                                std::tuple<int, gwasm::Blob>>>&& results);

int main(int argc, char* argv[])
{
    return gwasm::run(argc, argv, my_splitter, my_executor, my_merger);
}

See docs/more_detailed_readme.md for more details.

You can run the executable manually, according to the gwasm runner_interface, or compile to wasm and run with gwasm-runner itself.

Dependencies

For using the library:

Additionally, For running the test suite: Boost.

Installation

Use meson for building and installing.

See example_app/README.md for usage with example application.

Code style

Code style is managed by clang-format.

Testing

meson setup . build
ninja -C build test

License

LGPLv3 or later