Live data from Hacker News

Perspective: Streaming pivot visualization via WebAssembly

github.com

31–40 of 141 posts

Re: Perspective: Streaming pivot visualization via WebAssembly

#31

Earlier quoted context omitted.

in that case, its actually a good naming choice, as this existed (in a closed source form) for much longer than that.

I'm not knocking the code...I think it's brilliant. I just think you're going to cross wires with Google here. Will perspective mean "filtering troll comments" or will it mean "displaying analytics in web assembly" is an unfortunate set of choices.

The name had been in place internally since 2013, so the naming ship had sailed a long time ago.

Re: Perspective: Streaming pivot visualization via WebAssembly

#32

@dman Cool, but I'm curious why WebAssembly was chosen for this project. What was the value of using it here versus just using the Web API?

The C++ probably wasn't written for a browser. More likely it was written for a native frontend and has been ported to the browser via WebAssembly.

Re: Perspective: Streaming pivot visualization via WebAssembly

#33
post #13
post #2

I wrote the C++ part of this codebase, would be happy to answer any questions about it here.

Is Emscripten the only game in town for WebAssembly C/C++ toolchains, or are there other contenders?

Even outside of C/C++, Emscripten seems to be required in some fashion for just about every "compile X to webasm". Which i'm not that happy about as it's quite heavy and takes a long time to compile, which makes it harder for newcomers to try it out because it requires a fairly large time investment to even compile hello world.

Re: Perspective: Streaming pivot visualization via WebAssembly

#35
post #13

Earlier quoted context omitted.

Is Emscripten the only game in town for WebAssembly C/C++ toolchains, or are there other contenders?

Even outside of C/C++, Emscripten seems to be required in some fashion for just about every "compile X to webasm". Which i'm not that happy about as it's quite heavy and takes a long time to compile, which makes it harder for newcomers to try it out because it requires a fairly large time investment to even compile hello world.

Rust’s wasm32-unknown-unknown target does not use emscripten at all. The tool cargo-web will handle the js module shims for you.

Re: Perspective: Streaming pivot visualization via WebAssembly

#36
post #13

Earlier quoted context omitted.

Is Emscripten the only game in town for WebAssembly C/C++ toolchains, or are there other contenders?

Even outside of C/C++, Emscripten seems to be required in some fashion for just about every "compile X to webasm". Which i'm not that happy about as it's quite heavy and takes a long time to compile, which makes it harder for newcomers to try it out because it requires a fairly large time investment to even compile hello world.

> Even outside of C/C++, Emscripten seems to be required in some fashion for just about every "compile X to webasm".

One exception to this is Rust's new "wasm32-unknown-unknown" target, which uses LLVM to directly generate wasm files without going through emscripten: https://www.hellorust.com/news/native-wasm-target.html

The easiest way to use it for larger projects is probably via https://github.com/koute/cargo-web, which handles a lot of packaging very nicely.

It's really nice to use, assuming you already know Rust.

Re: Perspective: Streaming pivot visualization via WebAssembly

#38
post #2

I wrote the C++ part of this codebase, would be happy to answer any questions about it here.

Did you experiment with doing it JS-only prior to the C++ version? If so, what kind of performance increase did you see with WebAssembly?

No, when I first prototyped it I had written a Python version initially. From memory the first C++ build was ~80x faster than the Python prototype.

Re: Perspective: Streaming pivot visualization via WebAssembly

#39
post #11

Earlier quoted context omitted.

I believe you'd need to port Python to WebAssembly to make much use of pandas - unaware of any projects attempting the former. The grid is just a plugin for the excellent [Hypergrid]( https://github.com/openfin/fin-hypergrid ), which is editable, but you'd need to manually push those edits back to the engine for now.

which answers my other question, so it's canvas?

The frontend is actually pure JS/HTML - the WebAssembly part is just the data engine, and runs in a WebWorker for CPU isolation.

Hypergrid is a canvas-based renderer, yes.

Re: Perspective: Streaming pivot visualization via WebAssembly

#40
post #10

This is great. Finance people especially love this sort of thing - they do want to browse through entire datasets vs seeing higher level metrics in a lot of cases.

> Finance people especially love this sort of thing - they do want to browse through entire datasets vs seeing higher level metrics in a lot of cases

To expand on this, a lot of finance is searching out and understanding, normalizing or exploiting edge cases.

Post reply on HN