#

Anarchy is a pixel shader programming language written in Rust!

Anarchy is very fast, and is designed to be portable, so it can run in a wide variety of different environments. For example, check out the live web demo!

The web editor provides a preview, which updates in real time as you modify the program

#
Usage

Anarchy is designed to have its execution be fairly deterministic. As a result, you will not find any support for unbounded loops or recursion.

With that said, there is a healthy feature set of:

  • Functions which cannot do recursion
  • Loops which can only be bounded by const expressions (preventing non-deterministic loops)
  • Tuples which cannot be modified, preventing reference cycles
  • If-Statements which provide for the only real non-deterministic behavior
Photo of the live web editor

Every script is called with an input tuple of x, y, time, and random.

  • x and y are the coordinates of the pixel on-screen
  • time is the time for the current frame being drawn
  • random is a random number between 0 and 1 shared between pixels and frames of the same "run" of the animation

Then, the program reads the values of r, g, and b to set the color of the pixel