Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: Compiler translation of array indexing
[ 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: Compiler translation of array indexing
> Instead of translating as in OCAML to Array.get and
> Array.set, they could be translated into some equivalent to
> 
> x.(n)  ->  module_of(type_of x).get(x, n)

There are strong theoretical difficulties to obtain a type_of function
embedded into a statically & strongly type checked language such as
Caml. A (limited) form of this type_of facility is the entire subject of
the following reserch paper:

ftp://ftp.inria.fr/INRIA/Projects/cristal/Pierre.Weis/generics.dvi.Z

This is also the subject of Jun Furuse's PHD: he is working since 1996
to implement this type-checking discipline into a working O'Caml
compiler. We also made some progress on the theoretical side, compared
to the above reference, and all these results will be reported in Jun's
thesis (strongly expected before this summer).

This work had also produced a safe value I/O system for Objective
Caml, that is a fully typechecked and safe polymorphic input/output
set of primitives for Objective Caml.
The design and implementation is described into the following
(forcoming) article : http://pauillac.inria.fr/~weis/articles/jfla2000.ps.Z
(Limited to those of you who can read french, since it has not yet
been translated into english, sorry for that.)

We also plan to distribute Jun's implementation in the near future, to
let you play with it.

Best regards,

Pierre Weis

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