caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Eric Dahlman <edahlman@atcorp.com>
Cc: caml-list <caml-list@inria.fr>,
	Nicolas Cannasse <warplayer@free.fr>,
	David MENTRE <dmentre@linux-france.org>
Subject: Re: [Caml-list] unused function detection
Date: 23 Jun 2004 05:18:38 +1000	[thread overview]
Message-ID: <1087931918.29427.23.camel@pelican.wigram> (raw)
In-Reply-To: <525AEC07-C47B-11D8-A9FD-000393914EAA@atcorp.com>

On Wed, 2004-06-23 at 04:38, Eric Dahlman wrote:
>  The name for this process was "tree shaking" if 

... camlshake .. is that a drink .. or a warning
to hide under the nearest park bench and quiver in fear?

> anyone is interested in looking into what was involved.

The problem is well understood -- it's just garbage collection
after all. The hard part is getting at the internals of the
Ocaml compiler, so as to avoid reinventing the wheel in
terms of parsing, lookup, etc but at the same time not
reporting generated garbage (compilers often generate
junk because it might be useful and optimise it away later).

----

Actually there is a modification of the original
problem which is slightly more interesting theoretically:
I personally often write:

let rec f x = ..
and g x = ...
and h x = ...

i.e. a huge chain of not necessarily mutually recursive
functions at the top level. It would be interesting
to see how one's scope control could be refined to make
the actual dependencies more evident. I also often
write:

let f x = .. in
let g x = .. in 
..

when there is no dependency -- it just looks cleaner than

let
  f x = .. and
  g x = .. and
..
in

Obviously let[rec] [and] in can't express everything you want
in terms of scope control, so I doubt there is an 'ideal'
way to combine a set of functions .. which is what makes
the problem of re-writing them to better express the
dependencies interesting. [Of course there is a perfect
solution using modules]

-- 
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


  reply	other threads:[~2004-06-22 19:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-22 17:08 skaller
2004-06-22 17:31 ` David MENTRE
2004-06-22 17:59   ` Nicolas Cannasse
2004-06-22 18:32     ` skaller
2004-06-22 18:33     ` Michael Furr
2004-06-22 19:27       ` skaller
2004-06-22 19:46         ` Michael Furr
2004-06-22 18:38     ` Eric Dahlman
2004-06-22 19:18       ` skaller [this message]
     [not found] <fa.edndqci.a2eggi@ifi.uio.no>
2011-02-08 10:52 ` Radu Grigore
2011-02-08 12:30   ` Gabriel Scherer
2011-02-09  0:02     ` Jerome Benoit

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=1087931918.29427.23.camel@pelican.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=dmentre@linux-france.org \
    --cc=edahlman@atcorp.com \
    --cc=warplayer@free.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).