caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Chris Hecker <checker@d6.com>
To: Jean-Christophe.Filliatre@lri.fr (Jean-Christophe Filliatre)
Cc: caml-list@inria.fr
Subject: Re: practical functional programming
Date: Mon, 06 Nov 2000 10:15:30 -0800	[thread overview]
Message-ID: <4.3.2.7.2.20001106100700.00c447b0@shell16.ba.best.com> (raw)
In-Reply-To: <14854.44822.43851.623717@pc803>


>This is a very silly example  but there are many real situations where
>persistence is needed  (I encountered many of them  in practice).

That may be a silly example, but it makes a lot of sense to me and I could see making use of that property.

I guess my next question then would be related to efficiency: isn't there a lot of copying going on if you've got to make a new instance of your symbol table just to add an element?  How does this work out in practice?

Again, I'm not saying efficiency is the only metric for software, but it does concern me when I see a large datastructure copied.  Is there some sort of reference counted sharing going on, or are there actually two copies of the data in memory if you wrote your example in caml?

I guess my hope would be that in the case where you didn't reference the old datastructure ever again you would get performance close to the equivalent imperative datastructure.  In the case where you did reference both old and new you'd get performance similar to writing an "undo-able" imperative datastructure from scratch, possibly with an optimization for not accessing the old datastructure until the new one had been undone (like in your example, and I would assume that's the common case for using persistence).

Chris




  reply	other threads:[~2000-11-06 22:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-03 22:44 Chris Hecker
2000-11-04 18:48 ` Chet Murthy
2000-11-05 14:25 ` John Max Skaller
2000-11-06 22:26   ` Michael Hicks
2000-11-06  6:55 ` Francisco Reyes
2000-11-06 13:16 ` Jean-Christophe Filliatre
2000-11-06 18:15   ` Chris Hecker [this message]
2000-11-07  7:54     ` Stephan Houben
2000-11-11 14:32       ` John Max Skaller
2000-11-12 13:17         ` Ken Wakita
2000-11-12 20:09           ` John Max Skaller
2000-11-13  0:19             ` Ken Wakita
2000-11-13  7:45         ` STARYNKEVITCH Basile
2000-11-07  9:06     ` Xavier Leroy
2000-11-07 10:13       ` Chris Hecker
2000-11-09 10:56         ` Stephan Houben
2000-11-09 21:56           ` Chris Hecker
2000-11-07 18:05     ` Thorsten Ohl
2000-11-07 19:19     ` Marcin 'Qrczak' Kowalczyk
2000-11-06 23:10 Hao-yang Wang
2000-11-06 23:24 Hao-yang Wang

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=4.3.2.7.2.20001106100700.00c447b0@shell16.ba.best.com \
    --to=checker@d6.com \
    --cc=Jean-Christophe.Filliatre@lri.fr \
    --cc=caml-list@inria.fr \
    /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).