---

Slashdot: Transmeta Code Morphing != Just In Time

The recent Transmeta announcment crystalised something I’ve
been thinking about for a while.
It’s my belief that it should
be possible to make a compiler generate much better code in the
general case than someone writing hand coded assembler. Furthermore
it should be possible for a JIT (Just In Time) compiler to produce
better code than a conventional one time compiler.”

“Why should a compiler be better than an experienced assembler
programmer? Well,

  1. the compiler can know the target processor intimately (cycle
    times, impact of instruction ordering, etc.)
  2. the compiler gets to re-write the entire program each time it
    sees it.”

“The second point is critical: any programmer writing an assy.
language program of any significant size will write the code to be
maintainable. Of course, it makes sense to do things like defining
standard entry and exit sequences to routines, keep a few registers
spare (in those architectures that have more than a few) and other
practices that lead to maintainable code, but the compiler doesn’t
have to maintain the code it writes. It gets to write the whole
thing from scratch every time. This means that functions can be
inlined (and repeated code sequences turned into functions). Loops
can be unrolled then rolled back up at the next compile when the
programmer has decided that space is more important than
speed.”

Complete
Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis