Get the latest tech news

Abusing DuckDB-WASM by making SQL draw 3D graphics (Sort Of)


Personal blog and portfolio site

Spoiler: It kind of works, it was often painful, but I learned a ton about the surprising power (and quirks) of running an analytical database engine in the browser for tasks it was definitely not designed for. It performs a quick Z-buffer check in JS to see if a sprite is closer than the wall at its projected screen column, draws it onto the background frame if it is, and finally outputs the resulting text onto a<pre> tag. The Fix: Digging into the DuckDB-WASM docs revealed the more robust initialization pattern: using their helper functions ( getJsDelivrBundles) or explicitly selecting a bundle ( mvp for max compatibility), creating the worker via URL.createObjectURL(new Blob(...)), and using the+esm CDN endpoint for the main module import.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of wasm

wasm

Photo of 3D graphics

3D graphics

Related news:

News photo

Show HN: (bits) of a Libc, Optimized for Wasm

News photo

Show HN: Obelisk – a WASM-based deterministic workflow engine

News photo

Microsoft Announces Open-Source "Hyperlight Wasm" Project