There’s a whole sub-culture out there around “livecoding”, using programming (or code) interactively to create performances, typically musical and/or visual. Some folks write their own applications, some use applications created specifically for allowing dynamic creation of visuals or art. Those that do write their own typically use dynamic languages – perl, python, ruby scheme etc from what I’ve found on the net.
There’s a whole bunch of stuff on livecoding at toplap.
Of the applications/environments that specifically allow or promote livecoding, I’ve tried ChucK, SuperCollider and fluxus. The first two let you do livecoding of music (or sounds). Fluxus let’s you create visuals.
Fluxus uses opengl to create/display graphics and lets you manipulate it using scheme (mzscheme).
One of my todo’s is to create something like fluxus, just a minimal set of bindings using clojure, java and jogl while learning clojure.