‹ BackHN Continuity

Thread

Testing WebGPU data layouts with Facet

90 points · 7 comments · luu

  1. genxy · · focus · HN ↗
    > facet is a library for Rust which provides run-time reflection. By annotating your struct with #[derive(facet::Facet)], you get a SHAPE associated type which can be inspected at runtime.

    <a href="https:&#x2F;&#x2F;github.com&#x2F;facet-rs&#x2F;facet" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facet-rs&#x2F;facet

    &gt; The core crates give types a SHAPE associated constant with their kind, layout, fields, documentation, attributes, and type-specific operations. facet-reflect builds, reads, and mutates values through those shapes while preserving their invariants.

    &gt; Serialization and integration crates build on that reflection layer: JSON, TOML, YAML, MessagePack, Postcard, ASN.1, XDR, CSV, XML, URL-encoded forms, SQLite, Axum, schema generation, structural diffing, and more.

    Side by side comparison with SERDE <a href="https:&#x2F;&#x2F;facet.rs&#x2F;guide&#x2F;serde&#x2F;" rel="nofollow">https:&#x2F;&#x2F;facet.rs&#x2F;guide&#x2F;serde&#x2F;

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.