Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Estimating the size of the ocaml community
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-04 (09:37)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Estimating the size of the ocaml community
On Fri, Feb 04, 2005 at 10:04:20AM +0100, Fr?d?ric Gava wrote:
> But this problem is a problem of the implementation and not a
> problem of language design. Maybe in the futur, this limitation
> would be deleted.

It's a problem of the implementation, but one which looks hard to
change.  The reason it arises is because each OCaml value has a 4
byte[*] header, divided into a 1 byte tag, 2 bits for the GC, and the
remaining 22 bits to store the size of the value in words.  Since
strings are stored directly in the value (which is very efficient),
they are limited to 4 * (2^22 - 1) bytes ~ 16 MB in size.  Any other
representation would penalise the common case (short strings) - for
example, having strings represented as a (length, pointer) tuple would
cause an extra indirection; and having long strings represented with a
special "all 1s" length would penalise the code all over the place.

So not easy to fix.


[*] On 32-bit platforms.

Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology -
Team Notepad - intranets and extranets for business -