Company
Date Published
Author
Sean Smith
Word count
979
Language
English
Hacker News points
None

Summary

GlareDB is evolving to include a WebAssembly-compiled version of its execution engine, aiming to enable high-performance, serverless analytics directly in web browsers without the need for downloads. WebAssembly provides a binary format that supports major programming languages, allowing applications to run efficiently in browsers. The development of this feature required significant architectural changes to accommodate WebAssembly's limitations, such as the lack of threading and blocking code. GlareDB introduces a "runtimes" concept, utilizing a PipelineRuntime for executing queries and a FileSystem abstraction for data fetching, with network I/O managed by Tokio. To adapt to WebAssembly, GlareDB employs JavaScript Promises for non-blocking execution, ensuring a single-threaded but interleaved CPU and I/O process. Dependencies are carefully selected to avoid compatibility issues with WebAssembly, and a custom shell was developed for a consistent user experience across platforms. Future improvements aim to enhance WebAssembly-specific features and expand support for data formats and external catalogs.