Microsoft Roslyn - compiler as a service is a nice addition to the .NET stack; I was looking for something similar in the Java world. I believe Scala has something similar in the form of compiler plugins but not sure how flexible it is.
The problem I am trying to solve in the Java world is allowing users to write some custom syntax and internally it would get re-wired into a different syntax.
Scala will have support for macros in the next release (2.10). You can already play with the milestone releases to check how it works. Basically, they allow to modify AST at compile time. So you can rewrite any piece of Scala in another piece of scala. Check the scalamacros website for examples and doc.
If you want to compile Scala source at runtime, you can look for Eval
in the twitter/util project.