Mickey Petersen wrote nice piece about compile feature in Emacs - something I use a lot and I recommend the read.

I like to have instant feedback, so I use it for almost everything after which run recompile that replays last compile command. recompile can be bound to the key, but my favorite trick is to use Local Variables.

Ready recipe:

## Local Variables:
## eval: (add-hook 'after-save 'recompile nil t)
## End:

It works with any file and thanks to that I get recompile every single time I save the file.

Note: nil t params are very important because they ensure that hook is buffer-local. Otherwise you might end up running hook on every single save!

+1 - dir-locals

Local variables leave footprint at the file (something I don't care if I'm working on single-file application or quick script) but t shouldn't be commited into source control.

Alternative would be using .dir-locals.el file and ignoring it, which is slightly more complicated and better suited with more complex pieces.

Impatient mode

Extra-extra is impatient-mode, which I absultelly love but it require result to be rendered as HTML. Unfortunatelly Safari is leaking memory, which doesn't seem to happen in Chromium.