Is there a spec, whitepaper, anything at all out there, regarding what a slug is in the Heroku context? I've always noticed how Heroku compiles Rails apps into slugs, increasing performance, at least within their proprietary environment.
Is there a way to do this outside of Heroku, and/or take advantage of it within a different environment?
As pointed out by John Beynon above, the 'compilation' is another name for the build pack process. When you push your code to Heroku we resolve all depedencies and TGZ the resulting package into a "slug".
The process is open source, with full documentation and links to the various supported buildpacks on our devcenter. If you want the technical details of exactly what goes on, refer to the buildpack api doc.
We have already seen some other platforms start to adopt buildpacks. It would be great to see anyone who likes adopt them and provide feedback.