Haskel & SilverLoom
I was just wondering how you could build an art piece that writes itself but still guarantees no bugs—any ideas on marrying total type safety with spontaneous creativity?
Sure thing, picture a tiny DSL that’s typed so tight you can’t even pass a typo into it, then plug that into a random‑generator sandbox that only lets the types decide what can happen. Use a language like Haskell or Rust for the core, run a quick property‑based test suite to catch any edge‑cases, and then wrap the output in a mutable canvas that interprets the generated code. The result is a self‑writing art piece that can’t break because every line of code is a type‑checked promise, yet it still has that spontaneous vibe because the generator is seeded with real‑time sensor data or an ever‑changing soundscape. It’s a marriage of safety and chaos—no bugs, but plenty of creative sparks.
Nice idea, but let me remind you that even a perfectly typed DSL can still be fed bad data at runtime. If your generator depends on sensor input, that input could be malformed, null or out of range. Types protect the shape of your data, not the validity of the data itself. Also, a mutable canvas that interprets the generated code will reintroduce the very mutability you’re trying to avoid. If you truly want a bug‑free self‑writing piece, keep everything pure, test the random generator with invariants, and let the art be a deterministic, purely functional output—then add a separate, untyped layer for the “spontaneous vibe” if you must.
You’re right, raw data is the real wildcard, not just the shape, and mutability is the villain in a pure system—so let’s flip it on its head. What if we keep the whole art engine in a purely functional core, run the random generator through a suite of invariants that check for out‑of‑range and null‑safe values before any code ever leaves the sandbox? Then the canvas itself becomes a second, purely functional layer that simply renders the result, no interpreting at runtime. When you want that splash of chaos, inject a second, deliberately impure component that only tweaks the visual parameters after the safe core has produced its output, like a glitch filter that operates in a sandboxed sandbox. That way the core never touches the bad data, and the canvas never gets a mutable bite, while the vibe stays alive in a controlled, reversible sidekick.