Array Programming the Mandelbrot Set
Years ago, when I was learning the J programming language I wrote the mandelbrot set:
As is often the case with array programming, I revisited this last week only to realize I couldn’t read it. I considered revisiting it to brush up on J, but in more recent times I’ve been doing my array programming in Uiua. While I’m also rusty at Uiua these days, I thought that a translation would be a more interesting project than just remembering how J works. After brushing up on Uiua’s documentation (and rediscovering that LLM’s are useless with Uiua because it’s such a strange language and so far out-of-distribution) I did finally manage a translation:
The fact that Uiua is not only an array language, but a stack-based array language really changes how some of the program reads. J also evaluates right-to-left, but it has much less native support for doing things like manually coordinating the stack. Plus, while dyadic verbs in J are kind of neat, I much prefer the signatures of Uiua, which look much like signatures in other stack-based languages (i.e. will this function remove things from the stack, or push things to the stack, or leave the stack the same depth as when it was called?).
There is one other thing to note about Uiua’s implementation: when executed in an interactive environment Uiua automatically turns that data into a GIF.

This is just such a cool feature. The advantage of array languages in my experience has always been their immediacy. When a complex transformation is only a few keystrokes away you can cover a lot of intellectual distance very quickly. Uiua takes that to a new extreme by also figuring out the best way to display your output to you automatically. This is such a basic idea in some ways, but to me, as someone who spends a few minutes every time I want to start a new visual arts project remembering how to just render some pixels to the screen, it feels like living in the future.
.png)
