npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wabic

v0.0.1

Published

WebAssembly Binary Interface

Downloads

2

Readme

WABI

WebAssembly Binary Interface

Usage

npm install -g wabic
wabic /path/to/header.h

Mission

WABI is a tool to generate a stable WebAssembly binary interface for libuv. As a side effect, it can also generate the same binary interface for anything that has an exposed C header file.

Artifacts of WABI tool is a single .h file and a single .cc file, containing all the abstractions needed for a WebAssembly binary to talk to native binaries.

Support

WABI uses CastXML under the hood to parse the C header file. From the parser's side, anything that is supported by CastXML, should also be supported by WABI.

WABI has a generator that abstracts 64 bit types, strings, and pointers from the WebAssembly module. The generator only supports as much needed for libuv, but extending it should not be difficult.

Example

input header file:

// input.h
void* example_function();

output header file:

// input-wabi.h
typedef int Quark;
Quark wabi_example_function();

output header implementation:

// input-wabi.cc
extern "C" {
Quark wabi_example_function() {
  // ...
} // !wabi_example_function
} // !extern "C"

You may notice that void* is no longer exposed in the final interface. This is an intentional behavior. WABI borrows the idea of Quarks from GTK and wraps your return types and arguments in Quarks. Quarks allow data to safely pass through a WebAssembly runtime and back into native land.

WABI currently tries to wrap everything that is not an integer, into a Quark.

Dependencies

WABI currently relies on C++17's std::any. Alternatives exists for older C++.