worm.sex | Gay.jl

proposed SPI

+++ title = “Welcome to Gay.jl Blog” template = “main” description = “Referentially transparent, stable colors powered by Gay.jl and Bartholomew WASM” enable_shortcodes = true +++

Welcome to Gay.jl Blog

This blog worlds referentially transparent and referentially stable color generation using Gay.jl integrated with Fermyon Bartholomew.

What is Referential Transparency?

A function is referentially transparent if you can replace a function call with its result without changing the program’s behavior. Gay.jl’s color generation is referentially transparent:

gay_color("hello") → #A7B3C9  (always, forever)

The same input always produces the same output, across:

Live World

Here’s a color palette generated from this page’s title:

{{gay_palette “Welcome to Gay.jl Blog” 8}}

And here’s the GF(3) status of this content:

{{gay_badge “Welcome to Gay.jl Blog”}}

The Three Primitives

Gay.jl is built on exactly three irreducible primitives:

  1. sm64 - SplitMix64 mixing function (the dynamics)
  2. ⊻ (XOR) - Composition operator (the algebra)
  3. GF(3) - Three-element Galois field (the constraint)

{{gay_block “sm64” “The SplitMix64 bijection transforms any 64-bit integer into a well-distributed output. It’s fast, deterministic, and has excellent statistical properties.”}}

{{gay_block “XOR” “XOR is associative, commutative, and self-inverse (a ⊻ a = 0). This makes fingerprints order-independent and enables ancestor cancellation in merges.”}}

{{gay_block “GF(3)” “Three colors (0, 1, 2) are sufficient for coloring most DAGs. They map to semantic states: verified, proposed, speculative.”}}

Why WASM?

Bartholomew runs as a WebAssembly module, which means:

The Gay.jl Rhai scripts are evaluated at render time, generating colors that are:

  1. Content-addressed: Color derived from content hash
  2. Stable: Same content → same color forever
  3. Verifiable: XOR fingerprint proves content integrity

Get Started

Check out the blog posts for more examples, or dive into the source code!