Over the last decade, I've made three major attempts to write programming languages for producing random text. Here's the first: Matzo, a simple dynamically typed language for random strings, which I've reimplemented somewhat more cleanly and released today: https://github.com/aisamanra/matzo
This is sort of a take on something like Tracery (https://tracery.io/) but approaching it as a programming language problem. I think it's a lot easier to do deep structure with Matzo, but also I made it, so of course it's a tool that fits my brain well.