Since you're here, I would love to know what you think of adding function definition as a language feature to Sporth (in the style of Forth, or even better, Joy). As you know I've used Sporth a lot, and I think it would be pretty useful to have this kind of feature, but perhaps implementation would be a bit challenging right now.
I agree it would be a cool feature. Unfortunately, you'd have to basically rewrite everything in order to do it.
I actually kind of did that. Soundpipe[0], Patchwerk[1], and Runt[2] used together builds something that syntactically resembles Sporth, sounds virtually identical, and is usually way faster. In Runt, you can add new words and build abstractions that way. In practice, I tend to avoid doing this and will tend to generate Runt code using higher level languages like Scheme.
That definitely looks cool. I remember looking at these when you mentioned them before, but then I got lost looking for example audio scripts. I just looked a bit harder and I think I found them:
I guess the documentations is in-progress, but the language seems like it has exactly the improvements over Sporth I was thinking of. Compared to Sporth, though, the development model seems less open to community involvement. It would be great to have a "contributing" guide of some sort, or a repo open to pull requests.
Due to life circumstances, I have been unable to write any real intro documentation.
> Compared to Sporth, though, the development model seems less open to community involvement
The biggest reason for this is because I'm actually using Fossil for source control instead of git, and this is a git export for visibility and convenience. Fossil also is built around a cathedral model rather than the bazaar model [0], so it it indeed harder to make one-off commits to the repo. It should be possible to have bidirectional git/fossil support, but I haven't explored it for now.
> It would be great to have a "contributing" guide of some sort, or a repo open to pull requests.
There's no guide yet because I'm not ready for any random stranger to be able to make a contribution.
However, if you (or anyone reading) are interested in using developing Patchwerk, please email me at this is paul batchelor at gmail dot com (no spaces).
In acidforth, I implemented "functions" in a way that it can be handled very early in the compilation process and not have any impact on the execution environment. They look like forth colon definitions but are just macros that get expanded immediately during compilation.
Perhaps that is an approach that would work for Sporth? If nothing else it could be implemented as a separate source to source pre-processor.
the author also wrote an interactive tutorial here:
https://audiomasher.org/learn
this is based on the sporth cookbook, found here:
http://paulbatchelor.github.io/proj/cook/