Feels like more and more of these sorts of things are popping up. For example there's TidalCycles which is a Haskell version of the idea, which also exists as https://strudel.cc/ which is I believe a webasm version of it.
Really? Color me corrected I only ran into TC after SonicPi.
Though this entire discussion reminds me I need to fix my TidalCycles setup, had it working on Linux with vscode but I tried it out again a month or two ago and it wasn't playing anymore.