caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: qrczak@knm.org.pl
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] any way to "clear" the toplevel?
Date: Fri, 27 Apr 2001 09:50:33 +0900	[thread overview]
Message-ID: <20010427095033Q.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <slrn9eg65e.hco.qrczak@qrnik.zagroda>

From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
> Thu, 26 Apr 2001 10:05:02 +0900, Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp> pisze:
> 
> > The real solution would be to analyze dependencies between modules,
> > and only flush things that depend on a modified module. Promises
> > to be rather hard.
> 
> Glasgow Haskell Compiler 5.00 does this in its interactive toplevel.
> It maintains the dependency graph of loaded modules. Reloading
> checks time stamps and recompiles to in-memory bytecode or reloads
> object code of modules which changed or which depend on modules whose
> interface changed (or something like that).

As you have probably got to know by now, doing things automatically
for the user is very uncamlish. What I was talking about is in fact
even simpler than that: just trash modules that do not match their
signature anymore, and force the user to reload by hand all depending
code. It is not that hard, but of rather limited interest if you don't
go the full way to have automatic reloading also, like in GHC as you
say, and with SML/NJ's compilation manager also I suppose.

My next point was pointing at a more concrete problem, that you may
have to solve even if signatures did not change: values in ADT's.
Either you force ADT's to be different types everytime you reload a
module, which basically means all values whose type is related to an
ADT in the environment cannot be used anymore, or you need some very
clever tracing at the value level this time, and some way to know
whether the representation of an ADT changed or not. Hairy.
What is GHC doing about that? I suppose there is a way to represent
ADT's in Haskell. But I'm not sure whether you can define values at
toplevel, in the way you do in ML.
On this point Caml's policy at toplvel is unsafe: you can still use
all your values, and happily get core dumps. But this is much more
comfortable than flushing all values even when nothing was modified.

Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-04-27  0:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-25 20:35 Chris Hecker
2001-04-25 23:56 ` Chris Hecker
2001-04-26  1:05   ` Jacques Garrigue
2001-04-26  1:18     ` Chris Hecker
2001-04-26 12:46     ` Marcin 'Qrczak' Kowalczyk
2001-04-27  0:50       ` Jacques Garrigue [this message]
2001-04-27  4:03         ` Marcin 'Qrczak' Kowalczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010427095033Q.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=qrczak@knm.org.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).