Skip to content Skip to footer
0 items - $0.00 0

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

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

14 Comments

  • Post Author
    mritchie712
    Posted April 22, 2025 at 1:58 pm

    This is a DuckDB feature that's incredibly hard for Snowflake (or anyone else) to copy. Running the same database client-side (WASM) and server-side can make for a pretty magical experience.

    Queries that normally take 1s to 2s can run in 25ms, so you get under the "100ms rule" which is very uncommon in analytics applications.

    We DuckDB server side and have experimental support for DuckDB WASM on the client-side at https://www.definite.app/ and sometimes I don't trust that a query ran because of how fast it can happen (we need some UX work there).

  • Post Author
    xnx
    Posted April 22, 2025 at 1:58 pm

    Impressive project, the subhead might attract even more attention: "Building a SQL-Powered Doom Clone in the Browser"

  • Post Author
    robertclaus
    Posted April 22, 2025 at 2:00 pm

    This is great! I did a similar project a while back to do image processing in a SQL database with pixels being individual records. It's amazing what SQL can do with the right table structures.

  • Post Author
    adornKey
    Posted April 22, 2025 at 2:13 pm

    Finally somebody did it! Back in the day my attempts to write a game in SQL were thwarted by buggy query-optimizers. They cached my calls to rand() way too often although documentation promised not to do that.

  • Post Author
    nonethewiser
    Posted April 22, 2025 at 2:14 pm

    Given the first post in the blog says "not made by a [ROBOT EMOJI]", should I assume this one which does not have this message, is made by a [ROBOT EMOJI]?

    https://www.hey.earth/posts

  • Post Author
    enescakir
    Posted April 22, 2025 at 2:14 pm

    Like running Doom on a printer, but now it’s in the same engine powering your BI dashboards. Peak 2025 energy.

  • Post Author
    cess11
    Posted April 22, 2025 at 2:28 pm

    Nice project. Reminds me of one of my favourite demos, a MySQL raytracer:

    https://www.pouet.net/prod.php?which=83222

  • Post Author
    datadrivenangel
    Posted April 22, 2025 at 2:29 pm

    Abusing databases is the way. I'm building a SQLite agent using triggers.

  • Post Author
    dkga
    Posted April 22, 2025 at 2:44 pm

    Very interesting!

    You know it gets wild when you read "… Here's the core of the raycasting algorithm in SQL"!

  • Post Author
    gitroom
    Posted April 22, 2025 at 2:58 pm

    i think this is super wild honestly, cant believe sql is doing graphics now

  • Post Author
    karmakaze
    Posted April 22, 2025 at 3:53 pm

    I'd like to see something like this done in SpacetimeDB which was made specifically for game backends. I haven't looked into it yet, only seen the 1.0 announcement on HN and in my YT feed, and curious how its feature set makes this sort of thing easier or more natural.

  • Post Author
    pjot
    Posted April 22, 2025 at 3:54 pm

    Author here, wild to see this at the top of HN!

    You can play it here:
    https://patricktrainer.github.io/duckdb-doom/

    Pressing “L” enables (very) verbose logging in the dev console and prints much of the sql being executed.

  • Post Author
    r3tr0
    Posted April 22, 2025 at 3:57 pm

    We use duck db wasm to make live system performance dashboards based on eBPF.

    It really is magic!

    You can check it out here.

    https://yeet.cx/play

Leave a comment

In the Shadows of Innovation”

© 2025 HackTech.info. All Rights Reserved.

Sign Up to Our Newsletter

Be the first to know the latest updates

Whoops, you're not connected to Mailchimp. You need to enter a valid Mailchimp API key.