Version française
Home     About     Download     Resources     Contact us    
Browse thread
overhead of GC in caml runtime?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Walid Taha <taha@c...>
Subject: Re: Imperative programming in Caml

Dear Pierre,

Thank you for you comments.

> Your problem seems to have something to do with elementary programming
> in Caml; you may have a look at the documentation, in particular the
> FAQ where basic indentation hints are given in the programming guide
> lines (http://pauillac.inria.fr/caml/FAQ/pgl-eng.html), and questions
> about imperative programming in Caml including the existence of
> imperative pointers and their encoding in Caml are discussed in
> details (http://pauillac.inria.fr/caml/FAQ/pointers-eng.html).

I took a quick look, and both seem to be very good pointers.  I like the
systematic translation suggested.

> Note: if you really do not want to use any kind of polymorphism, I'm
> afraid you will have a bad time to write and explain imperative
> programming examples in Caml, since you cannot use references ('a
> ref), nor arrays ('a array), nor options ('a option), nor lists ('a
> list); if you also consistently banish polymorphism from your function
> type schemes, what could you do without the basic predicates such that
> (=) (that has type 'a -> 'a -> bool), or even any comparison
> predicates (<, <=, <>, ...)  that are also polymorphic ?

This is a good point.  I had overlooked the fact that "ref" itself is a
polymorphic type constructor.

Best regards,

Walid.