Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] bigarrays and toplevel on Win32?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Rogoff <bpr@b...>
Subject: Re: [Caml-list] bigarrays and toplevel on Win32?
On Mon, 5 Mar 2001, Chris Hecker wrote:
> >The party line on unsafe array accesses is unclear: on the one hand,
> >we do not want to encourage their use, as it can break type safety and
> >dramatically reduce the safety of the programs; on the other hand,
> >they are handy when benchmarking against C or Fortran :-)
> 
> I'd like to have the choice.  I prefer unsafe_get/unsafe_set to -unsafe
> because it lets me choose where to be risky.  

It puts the annotation directly in the source code, so if you change your
mind or want to experiment you have to change the source. You have control 
over where to be risky by using top level modules. With extra work, you
could recover the same level of control using this approach. 

I think it's cleaner to push this issue as much as possible to the
compiler and rely on compiler options, otherwise the language will need to
have unsafe_everything operations for every possible op that you want fast. 

On a related issue, it might be nice to put Obj.magic in all it's guises
into a suitably disgustingly named module (Unsafe_operations?) so people
aren't tempted to use it just to pass the typechecker ;-)

-- Brian


-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr