caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Brandon J. Van Every" <vanevery@indiegamedesign.com>
To: "caml" <caml-list@inria.fr>
Subject: RE: [Caml-list] Wish List for Large Mutable Objects
Date: Sat, 31 Jul 2004 20:36:33 -0700	[thread overview]
Message-ID: <OOEALCJCKEBJBIJHCNJDGEPHHFAB.vanevery@indiegamedesign.com> (raw)
In-Reply-To: <003301c4772c$5435b9d0$0201a8c0@dylan>

David McClain wrote:
>
> Something I would like to see appear in the OCaml libraries,
> and I don't have it yet myself, is the use of Copy-on-Write
> and Scatter-Gather applied to large mutable objects such as
> BigArrays.
>
> [and some other things in other posts]

OCaml is not a lazy language.  Is it reasonable to expect Bigarray to
perform lazy copies, under any permutation of complexity you have in
mind?

It seems like what you really want is to design the memory management of
an Operating System.  If your files are so huge that they don't fit in
main memory, why aren't you willing to use virtual memory?
Scatter-Gather DMA is a device driver level capability that's hardware
dependent.  I don't see why a high level language like OCaml should be
exposing that kind of functionality, and I'm not entirely sure if it
should be doing it under the hood either.  If your OS doesn't have the
kind of memory management you want, maybe you should modify an open
source OS, like Linux or BSD Unix, to do what you want?

You ask why Array1, Array2, Array3 should be special cases.  Well,
clearly because they're the most common, and you can perform access
optimizations for each of these common cases.  It seems that you are
only thinking of ***BIG*** arrays, i.e. your problems and nobody else's.
Lotsa people don't have your notion of 'big'.  Indeed, I don't
personally care about arrays being particularly big.  100MB would be
pretty darn big for what I do in game development right now.  I do care
about their contents being unboxed.  If someone wanted to rename
Bigarray to UnboxedArray, that would suit my own priorities just fine.

I don't understand the "starting from zero" complaint, with respect to
arbitrary file formats.  If the file format is arbitrarily structured,
it is not an array.  You will have to read it some other way.  Arrays
are, generally speaking, composed of uniform elements.  At least, that's
how all of us pedal-to-the-metal guys view them.  I suppose high level
language guys often define the word 'array' to mean anything they want,
like a list or a hash table or a map or whatever, but I don't think they
should.

I don't see why your Scientific notion of an 'infinite array' should be
a basic language interface.  What would be so difficult about building
your favorite array windowing scheme on top of the basic fixed length
components, and calling that a library?  Like 'InfiniteArray' or
something.  Then you'd write some access functions in some syntax you
like, it would behave the way you like, and for your problems you'd be
good.  I've done similar things to perform addressing on icosahedrons,
to try to regularize the mathematics of a tiling of it.  I don't bother
the user about it, my functions just do some computing to make it all
work under the hood.

I do wish Bigarray handled heterogeneous C structures.  Homogeneous
arrays impose some design and interop constraints.

Finally, I'm told that the "%" in the names of called functions in the
sources means that ocamlopt generates different, better code.  The C
routines are ignored, they're only used for ocamlc.


Cheers,                         www.indiegamedesign.com
Brandon Van Every               Seattle, WA

20% of the world is real.
80% is gobbledygook we make up inside our own heads.

-------------------
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-08-01  3:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-31 18:29 David McClain
2004-08-01  3:36 ` Brandon J. Van Every [this message]
2004-08-02  5:28   ` Brandon J. Van Every
2004-08-01  4:06 ` Brandon J. Van Every
2004-08-02  2:38   ` David McClain
2004-08-02  3:20     ` Brandon J. Van Every
2004-08-02  3:32       ` David McClain
2004-08-02  5:14         ` Brandon J. Van Every
2004-08-02  8:00           ` Ville-Pertti Keinonen
2004-08-02  9:12             ` David McClain
2004-08-04  7:24     ` Alex Baretta

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=OOEALCJCKEBJBIJHCNJDGEPHHFAB.vanevery@indiegamedesign.com \
    --to=vanevery@indiegamedesign.com \
    --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).