News for hackers. Stuff that matters.
Re:Have Tracing JIT Compilers Won? by beagle3 on Wednesday March 10, 2010 @07:05AM (#1180699)
> C has even had fast interpreters for a while - see tinycc as an example. It doesn't use a tracing compiler, but a very straight forward direct translation compiler which happens to be faster than many interpreters.

How is tinycc an interpreter? It's a full-blown compiler, alas a very simple one with very little optimization. If it weren't faster than an interpreter, I'd be shocked. For well written code, it reaches 50%-70% of modern gcc speed from tests I did a couple of years ago. I think that's on par, or even slightly better, than gcc 1.x

Re:Have Tracing JIT Compilers Won? by barrkel on Wednesday March 10, 2010 @07:33AM (#1180742)
It helps that C is designed to have an almost one to one mapping between its native operators and machine operations and addressing modes.

For example, the pre and post increment operators are expressions with side effects, can be confusing and can provoke undefined behaviour with ease. Having two variants also seems redundant. But the two variants may have different optimal translations to underlying CPU addressing modes, while leaving the pre or post modified value in a register is often a side-effect of the CPU translation. If the language only permitted ++ as a statement, the usefulness of side-effect would be lost.

It's a cliche that C is little more than portable assembler, but at a design level there's a lot of truth to it. The length of the assembly translation of C code is usually pretty directly proportional to the source code token length. In more expressive languages with more powerful abstractions, that's frequently not the case.

Re:Have Tracing JIT Compilers Won? by andrewcooke on Wednesday March 10, 2010 @08:12AM (#1180810)
not arguing with your general point, but the difference between pre and post increment is very useful when writing things like stacks and queues with pointers. these days maybe people use libraries or templates, but i suspect they were introduced for ease of programming, not ease of translation.

[edit: really, it's two sides of the same coin. it's useful, so both c and cisc chips have it, so the two match up...]

Re:Have Tracing JIT Compilers Won? by eru on Wednesday March 10, 2010 @10:52AM (#1181137)
> not arguing with your general point, but the difference between pre and post increment is very useful when writing things like stacks and queues with pointers.

Of course this only applies to ephemeral variants of those data structures.