Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
The option -rectypes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-11-24 (18:04)
From: Pascal Cuoq <Pascal.Cuoq@i...>
Subject: Re: The option -rectypes
> I have some code that compiled in 2.02, but in 2.03 I need the new option
> -rectypes of the compilers.
> - What is the background of this change?

I can't say much about your example, but maybe I can say a few
words about the context.  I was one of the people who lobbied
to have at least a compiler option to allow recursive types.

The application in which we needed recursive types in Caml is
Lucid Synchrone, a strongly typed, higher-order synchronous language
which uses Ocaml as its target language:

In this kind of application, the type system of Ocaml only can get in
the way, because Lucid Synchrone already type-checks the
Lucid Synchrone programs.  It happens to be that (roughly) a well-typed
Lucid Synchrone program is compiled in an Ocaml program which 
is well-typed if recursive types are accepted, and ill-typed if they

The Caml implementors will probably tell you that the use of this
flag is discouraged for hand-written programs.  This "feature" was
removed from Ocaml 1.05 for a good reason (the type-checker reports
errors too late) and it should not be used lightly.

This said, there must be another change in the objects systems
which explains that your program is rejected without -rectypes.