logo       

Re: Array interface: msg#00112

Subject: Re: Array interface
On Fri, Jun 20, 2003 at 03:58:38PM -0500, Brian Hurt wrote:
> 
> First off, an apology.  I was grumpy this morning about things completely 
> irrelevent to the list- and thus responded a lot more hotly than was 
> called for.  Sorry.  And thank you for being rational enough not to flame 
> in return.
> 
> Unless I'm missing something (which is possible), there are three possible
> implementations of Dynarray that I can see working:
> 
> 1) Have the internal array be a 'a option array, and not a 'a array as it 
> is currently.  This means we are going through at least one, maybe 2 
> references for every element, need it or not.  If I understand things 
> correctly, in this case a dynarray of booleans takes up 3 words per entry, 
> and retrieving on takes two or three dereferences.

I just did some mini-tests, and it seems that compiler uses one Some
true and Some false value for all entries, i.e. one boolean takes one
word in bool option array.

However for ints it takes 3 words per array entry (if int's are all
different, when setting all the array to Some 3, it took one word per
entry).

> 2) Use the null value kludge.  I agree that this is far from optimal- but 
> it allows me to avoid options were not needed, and still write in Ocaml.

Maybe use first value put into array as null value, and maybe provide
way of setting null value as additional interface? This would have one
drawback, that this first value might be complex object with references
that would otherwise got GC-ed.

> WRT to unboxed floats, I myself wouldn't be horrified.  The only data 
> structure in which floats are unboxed (to my knowledge) is arrays.  

Records with only-floats fields also use unboxed floats.

However my idea about unboxed floats in ocaml, is that floats are
extensively used in benchmarks :-)

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: When in doubt, use brute force. -- Ken Thompson : {E-,w}-- {b++,e}>+++ h



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe