Giter Club home page Giter Club logo

arrow-wasm's Introduction

WASM Arrow .github/workflows/test.yml npm version

This package compiles the Rust library of Apache Arrow to WebAssembly. This might be a viable alternative to the pure JavaScript library. Right now, this library is incomplete and the API will change so we recommend using JavaScript library.

You can try this library in Observable at https://observablehq.com/@domoritz/apache-arrow-in-webassembly.

Documentation

Coming later. The API is somewhat similar to the Rust version (https://docs.rs/arrow/3.0.0/arrow/) although there are some differences to make the API more familiar to JavaScript users.

Building and testing

Node

Run with wasm-pack build --target nodejs && node examples/flights.js.

To use a debug build, run wasm-pack build --target nodejs --dev && node examples/flights.js.

Browser

Build with wasm-pack build --target web. Then run python3 -m http.server and open http://localhost:8000/examples/.

Publishing

Run npm publish to build a bundle and release it to NPM.

Linting

Run cargo fmt && cargo clippy before committing.

Check file size

We can check how large the WASM file is after compression (which every web server probably does).

gzip -9 <pkg//arrow_wasm_bg.wasm | wc -c

arrow-wasm's People

Contributors

cscheid avatar dependabot-preview[bot] avatar dependabot[bot] avatar domoritz avatar marcprux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

arrow-wasm's Issues

Add multiple bundles to package

Right now, we only release an UMD bundle for browsers. It would be good to also add ESM support as well as a commonjs module for node.

Interested in any PRs?

๐Ÿ‘‹ I've become convinced that there's a use for a library like arrow-wasm... not designed to be used directly from JavaScript (assuming no perf gain over JS) but instead to be used as a building block library for rust-wasm applications that want to use Arrow but don't want to manage wrapping core Arrow data structures to wasm themselves. And especially to simplify FFI between JS and Rust.

I started on a library at https://github.com/kylebarron/arrow-wasm using parts of your code as inspiration, but thought I should check if you were interested in any upstream PRs to this project ๐Ÿ™‚

Support data transformations

What I really miss in the Arrow JS lib, that I have to write row based accumulators or lookups in JS to achieve synthetic accumulators (sum, avg, cumsum). As DataFusion and Polars already support this, I assume it's available on the base Arrow (Rust) too. Could you add a few examples in this area (sort, groupby, sum).

p.s. While I understand that Datafusion capabilities (SQL engine) could be cumbersome and overkill, did you consider exposing @ritchie46's lazy Polars API?

Support Safari

Right now, we get arrow = ReferenceError: Can't find variable: BigInt64Array.

Benchmarks

How much slower/ faster is wasm compared to raw js?

List of things we want to compare with Arrow js and native typed arrays or js arrays:

  • Serializing a list of record batches
  • Creating a table from CSV/JSON/IPC
  • Creating a record batch from a schema and typed js arrays
  • Scanning a vector
  • Converting a vector into a typed array
  • Aggregations
  • ... more? Add a comment below!

Automatically cast vectors

We already have the schema information so we should be able to write a method (at least in JS) that automatically casts a vector for a record batch to the right type.

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.