You might like this paper: http://www.cs.utah.edu/plt/publications/macromod.pdf -- http://www.neilvandyke.org/