There are several ways in which something like this could be implemented, but I can't help thinking that one should already know enough stuff to give a good description that they might as well just write the code anyway.
In any case, only formal languages for me, please.