Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: native code compiler and exceptions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Weis <Pierre.Weis@i...>
Subject: Re: native code compiler and exceptions

Hello,

> Is there a deep, "fundamental",  reason why certain exceptions (in particular
> those raised by array accesses out of bound) are not handled in same way
> by the bytecode compiler and the native compiler, or is it a temporary
[...]
> I've written an image processing module in ocaml. Some functions in this
> module (for example, convolutions, ...) relies heavily on bound-violation
> exceptions for handling clipping effect at image boundaries.

Wao! To ``rely heavily on array bounds violation'' is a very ugly style
of programming. I could not imagine why you need to use this style. I
would suggest that you just avoid these violations : this would rend
your program clearer and fully compatible with the optimizing
compiler. Then, you should gain the full benefit of a native code
compilation. Moreover, if your code is really array bound clear, you
could use the unsafe option of the compiler, that remove every array
bound test. (Waiting for an automatic array bound check removing pass
in the optimizing compiler...)

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis