[Mono-list] PHP# - feasibility study so far - for comment

Fergus Henderson fjh@cs.mu.oz.au
Mon, 16 Dec 2002 22:00:36 +1100

On 15-Dec-2002, Miguel de Icaza <miguel@ximian.com> wrote:
> * Optimizing dynamic typed languages
>         It has been debated that the CIL is a language that is good for
>         statically typed languages, but a poor choice for dynamic
>         languages.  I think that this is a gross miss-representation.

I agree, especially because CIL has problems (as far as optimization is
concerned) for some statically typed languages.

>         In fact every computer architecture works better with statically
>         typed languages than dynamic languages (ie, the x86 is not an
>         architecture for "hosting" dynamically typed languages), but
>         clever tricks can be used to host any language on them. 

This is true.  But if the important clever tricks that are typically
used on x86 and other common hardware architectures can't be expressed
in the intermediate language, then this makes it difficult to get good
performance.  For example, many dynamically typed language implementations
make significant use of tagged values (e.g. tagged integers, tagged
pointers, etc.) for representing objects.  This can reduce memory usage
and substantially improve performance.  But the garbage collector needs
to know about tagged pointers.  Thus this technique can't be used in
(standard-conforming) CIL.  In theory it might be possible for CIL
implementations to apply such tagging optimizations automatically,
but AFAIK none of them currently do, and these sorts of optimizations
may not be suitable for a JIT compiler.

Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.