Mustache (http://mustache.github.com/) has implementations in 20+ languages including javascript. The templates themselves are entirely declarative - any logic is contained within a separate object.
If you don't need any custom logic at all, you can easily use JSON to pass that object between client and server with no further changes. If you do need some custom logic, it'd be slightly more work, but then again you could just opt to use javascript for any small pieces of logic, as there are V8 and/or Spidermonkey wrappers for most or all of the languages supported by Mustache.
Jade (very HAML/Slim-like) can do both client- and server-side rendering, and it can also precompile your template into pure JavaScript so users don't need to download a bulky template engine for it to work.
Re:Modern Web Applications are Here
by pilgrim689 on Tuesday November 15, 2011 @07:28AM
(#3237988)
Zappa with CoffeeKup can do server and client template sharing. Or jsdom and jsviews if you find Zappa too fancy.
Not that I know of any yet.