English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Why must types be always defined at the top level?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-23 (14:45)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Why must types be always defined at the top level?
On Wed, 2004-06-23 at 22:01, Andreas Rossberg wrote:

> I believe the presence of syntactic names for all generative types is 
> essential for the theoretical underpinnings of OCaml's type and module 
> system.

This may be so, but I still don't quite understand it.
In Felix generatives types all have fresh integers
assigned to them that act as fresh names: there's no 
separate compilation though. Does that have something
to do with it?

> > Topic ---------------------Language X ------------ Language Y
> > Intermodule fun calls         Yes                       No
> > Intermodule type recursion    Yes                       No
> > Nest everything (excl funcs)  Yes                       No
> > Nest funcs                    No                        Yes
> > Full sep compil               Yes                       No
> > Platform indep code           No                        Yes
> How did you arrive at that table? 

With a sense of humour.. :)

> AFAICS, the right column contains too 
> many No entries (intermodule function calls, full sep compilation), 

Oh? Ocaml does not support forward calls of named functions
across compilation unit boundaries. C/C++ do. Ocaml does not
support arbitrary order of compilation. C/C++ do. I agree
it is not really right to call the C/C++ header file mechanism
true separate compilation though (since interfaces are recompiled
multiple times), but the fact is using the 'advertised' mechanism
you just don't have to worry about compilation order in C/C++.
You can 'chunk' your source as you see fit. In Ocaml you cant.

> while the left contains too many Yes entries (nest everything, or rather 
> compositionality is definitely not given for C/C++, 

You are probably right. The table indicates this: working in 
C++ it is extremely annoying not having functions and their
scopes as first class .. such a relief to work with Ocaml.
But then suddenly things that 'just work' in C++ that you 
take as a 'given' turn out *not* to work in Ocaml.

Please note the table was not intended to be taken
seriously on a technical front. I have no doubt whatsoever
which language I prefer to work with :))

John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners