caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Camlp4 3.01 released
@ 2001-03-11  5:04 Daniel de Rauglaudre
  2001-03-12 11:52 ` [Caml-list] Caml 3.01 : pb with include Christophe Raffalli
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel de Rauglaudre @ 2001-03-11  5:04 UTC (permalink / raw)
  To: caml-list

Hi evribody,

Camlp4 3.01 compatible with OCaml 3.01 has been released
      http://caml.inria.fr/camlp4/

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [Caml-list] Caml 3.01 : pb with include
@ 2001-03-21 13:25 Dave Berry
  2001-03-21 16:15 ` Judicael Courant
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Berry @ 2001-03-21 13:25 UTC (permalink / raw)
  To: Xavier Leroy, Andreas Rossberg; +Cc: caml-list, Christophe Raffalli

I can add a little background to Xavier's remark about SML'97.  One of
the main changes in SML'97 from SML'90 was the removal of the
"stamp-based" notion of structure sharing (where two structures were
shared only if they were exactly the same structure).  In an early draft
this change went so far as to remove the structure sharing syntax
entirely.  

After some discussion, the syntax was retained, and interpreted purely
as a shorthand for sharing all the (flexible) types in the structures.
This was partly for backwards compatibility, which is why the SML'97
standard didn't add a "where structure" form analogous to "where type".
(SML/NJ allows this as an extension to the language, and I think other
implementations may have picked this up).

I find the structure sharing syntax genuinely useful.  As an example, if
you have a module containing all the (recursive) datatypes of an
abstract syntax, and you use this file in many other modules, it's
useful to specify that the types are shared using a single line instead
of having to add a sharing constraint for each type.  The risk of
keeping the syntax is that people might interpret it in a way that is
subtly different from what is intended -- witness the confusion in this
case.  But I think the gain outweighs the cost, provided that the
intended definition is clearly explained.

Dave.

-----Original Message-----
From: Xavier Leroy [mailto:Xavier.Leroy@inria.fr]
Sent: Tuesday, March 13, 2001 10:32
To: Andreas Rossberg
Cc: caml-list@inria.fr; Christophe Raffalli
Subject: Re: [Caml-list] Caml 3.01 : pb with include

I agree with you that the most natural interpretation of the "with
module" constraint is to stand for a bunch of "with type" constraints
on the type components of the modules.  With this interpretation, the
current behavior is a bug.  SML'97 also interprets sharing constraints
between structures as the implied sharing constraints between the type
components of these modules.
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [Caml-list] Caml 3.01 : pb with include
@ 2001-03-23 12:02 Dave Berry
  2001-03-27  9:19 ` Judicael Courant
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Berry @ 2001-03-23 12:02 UTC (permalink / raw)
  To: Judicael Courant, caml-list
  Cc: Xavier Leroy, Andreas Rossberg, Christophe Raffalli

Do you have a real-life example where you need module equality of the
sort you suggest?  One of the reasons that SML'97 dropped this notion of
module equality was that it wasn't used in practice.  Also, you can
simulate it if necessary by adding an abstract type to the module.

Removing this in SML'97 hugely simplified the semantics of modules, and
made them easier to implement. (I think MLWorks was the only SML
compiler that implemented all the nooks and crannies of the SML'90
modules language, although I may be wrong about that.  From an
engineering point of view, that was a mis-use of resources, IMO).

Clearly there is potential for a better way of specifying this equality,
if you need it.  I hope your calculus is a good step down that road.

Dave.


-----Original Message-----
From: Judicael Courant [mailto:Judicael.Courant@lri.fr]
Sent: Wednesday, March 21, 2001 16:16
To: caml-list@inria.fr
Cc: Dave Berry; Xavier Leroy; Andreas Rossberg; Christophe Raffalli
Subject: Re: [Caml-list] Caml 3.01 : pb with include


Hi,

I realized I missed an interesting discussion some time ago,
so I am adding a small comment now.

IMHO, the "with module" is a useful notion, but its current theoretical
interpretation is the wrong one: for instance when I write

module X = struct type t = int let compare x y = x-y end
module Y = struct type t = int let compare x y = y-x end

I would not like X and Y to be considered equal.

The problem with this comes from the status of equality of type 
expressions in a modular settings. The often cited paper of Harper,
Mitchell and Moggi about the phase distinction has IMHO been
misinterpreted as the fact that the equality should be extensionnal,
that is F(X).t and F(Y).t should be equal as soon as the types defined
in X and the types defined in Y are equal.

The previous condition indeed ensures that at run time F(X).t and F(Y).t
are equal but it is not restrictive enough: roughly, this is saying that
equality over modules is extensionnal whereas
what the developper need is an intentionnal equality (i.e. if I define
two modules X and Y, my intention is that are different, even if they
define the same types).

Consider the previous example with F = Map.Make. You certainly do not
want F(X).t and F(Y).t to be considered equal by the type-checker! And
in fact, in O'Caml, they are incompatible as the comparison of types
mixes intentionality and extentionality.
That stamp-based generative semantics was also a way to ensure that
F(X).t and F(Y).t are not considered equal by the type-checker.

I proposed a module system (called MC for "module calculus") in my
thesis in which equality is intentional. The semantics of module
equality is precisely defined --- although the thesis itself has been
said hard to read. BTW, Christophe Raffali's example seems to be correct
in MC.

The problem with MC is that, although useful on proof languages (in
which you can strongly normalize expression), it is probably of little
use on Turing-complete programming languages (as you can not decide the
equality of arbitrary expressions). However, I plan to design another
system, tailored for programming languages that would not have this
limitation (maybe soon at a Cristal-LogiCal-Moscova seminar ?). Stay
tuned...

Judicaël.
-- 
Judicael.Courant@lri.fr, http://www.lri.fr/~jcourant/
(+33) (0)1 69 15 64 85
"Montre moi des morceaux de ton monde, et je te montrerai le mien"
Tim, matricule #929, condamné à mort.
http://rozenn.picard.free.fr/tim.html
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-03-27  9:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-11  5:04 [Caml-list] Camlp4 3.01 released Daniel de Rauglaudre
2001-03-12 11:52 ` [Caml-list] Caml 3.01 : pb with include Christophe Raffalli
2001-03-12 17:13   ` Andreas Rossberg
2001-03-13 10:32     ` Xavier Leroy
2001-03-13 11:18       ` Andreas Rossberg
2001-03-13 11:23       ` Christophe Raffalli
2001-03-21 13:25 Dave Berry
2001-03-21 16:15 ` Judicael Courant
2001-03-23 12:02 Dave Berry
2001-03-27  9:19 ` Judicael Courant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).