New animation protocol / bytecode

I have developed a little programming language for controlling GPIOs, gpioASM.

Now I am thinking about how something like this could be created for encoding animations.

The idea is that everything animation-related could be programmed in this language instead of C, so it could be reused elsewhere (provided the runtime is widely available).

If Home Assistant or any other integration would like to play an animation, it could just compile and upload a snippet of said language atomically, and it would be executed by a specialized runtime engine on-chip, without requiring a stream of UDP frames.

Long-running animations could also be encoded in said language.

Yes, this would require a specialized execution engine (like a lightweight VM).

Just as food for thought, an Idea that came to me were pixel shaders, which take in x and y coordinates and spit out an RGB color:

// display a red wave
RGBA pixel(x, y){
  float progress = (sin(x / 10) + 1) / 2;
  return RGBA(progress, 0, 0, 1);
}

This could then be compiled to some bytecode, sent to WLED, which would the execute and display it. That way, the animation would not have to be hardcoded in C, and reused in other projects.

What does the community think of this?

Check WASM and preliminary (unfinished) work by Aircoookie.

There’s also Ewoud’s proprietary language available in WLED-MM (never ported upstream).