Densing
Densing
categorySoftware
contextpersonal
collaborationsolo

Densing

Library for numeric level (de)compacting of objects based on a schema. Iteration on my experience with url-safe-bitpacking, aiming for a nicer developer experience, more performance and more scalable data types.

The key technical differences to url-safe-bitpacking is that reading and writing of data is done through a big-int intermediary. For programming purposes: a shape can be defined once as a template and referenced from anywhere, even from within itself, allowing for arbitrary AST definitions. Numeric ranges can be shared in the same way, with presets (say mm and m) of which every payload picks one.

Since 0.4 the schema itself can also be packed into a string, rather shorter than its JSON. The biggest trade-off of url-safe-bitpacking, namely that without the object definition the state is illegible, can therefore be sidestepped by just sending the definition along.

Logo rendered with SVG SDF, settings packed with densing↗
Logo rendered with SVG SDF, settings packed with densing

Densing Builder

Visual schema builder for the library. A schema is put together as a tree and every field shows what it costs in bits. The ribbon on top shows every bit the preview data encodes to, grouped by the character it ends up in.

No backend used at all! Schema and preview data are both stored in the link, feel free to share one with a friend.

Device Config - what a field costs↗
Device Config - what a field costs
Recursive template - (5 + 3) × 2↗
Recursive template - (5 + 3) × 2
Shared numbers with mm and m presets↗
Shared numbers with mm and m presets
CITA building definition + qr-code↗
CITA building definition + qr-code

In Use

The projects below all keep their state in the url. SVG SDF is the first one running on densing, most of the others still rely on url-safe-bitpacking.

SVG SDF↗
SVG SDF
Home Lamp Configurator↗
Home Lamp Configurator
Lucerna Lecto↗
Lucerna Lecto
GSL Ray Marching↗
GSL Ray Marching
A Merry FX Mesh↗
A Merry FX Mesh
Santini at Home↗
Santini at Home

Predecessors

url-safe-bitpacking, and State to Function, the POC to store simple math in a url.