Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You are not dead yet. But watch for further reports.


comp / comp.lang.tcl / Re: 2GB limitation

SubjectAuthor
* 2GB limitationalexandru
`* Re: 2GB limitationAndreas Leitgeb
 +- Re: 2GB limitationalexandru
 `* Re: 2GB limitationRich
  +* Re: 2GB limitationEmiliano
  |`* Re: 2GB limitationAndreas Leitgeb
  | `- Re: 2GB limitationEmiliano
  `- Re: 2GB limitationHarald Oehlmann

1
Subject: 2GB limitation
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Mon, 22 Jul 2024 06:17 UTC
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!panix!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: 2GB limitation
Date: Mon, 22 Jul 2024 06:17:09 +0000
Organization: novaBBS
Message-ID: <ca9ceb402172bc85450b5a9ac4e18715@www.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="4132011"; mail-complaints-to="usenet@i2pn2.org";
posting-account="0Z5XV6kwM7Cos/IbgWfXZAYsazigEecpjCfqz3CX7rU";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 916f90664d3de2199c7a6231aba6924e4b1593d3
X-Rslight-Site: $2y$10$.noPbI25kYd6Yd7JhVeeceSx5HYiBZhIOnVy7TV3lQ2X0tSuuurA2
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

Hi,

Will there be a fix for the 2GB size limit that a string representation
have in Tcl?
Maybe already fixed in Tcl 9.0?

Thanks
Alexnadru

Subject: Re: 2GB limitation
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 22 Jul 2024 08:31 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: 2GB limitation
Date: Mon, 22 Jul 2024 08:31:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <slrnv9s677.1l9n7.avl@logic.at>
References: <ca9ceb402172bc85450b5a9ac4e18715@www.novabbs.com>
Reply-To: avl@logic.at
Injection-Date: Mon, 22 Jul 2024 10:31:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ba8c0ad30804cf14c910ed6acde0efe0";
logging-data="610022"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fR+z3mOfqkQOdsSI1LjyQ"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:XKhGNGlUy/RhBCxpKun30Fex1bs=
View all headers

alexandru <alexandru.dadalau@meshparts.de> wrote:
> Will there be a fix for the 2GB size limit that a string representation
> have in Tcl?
> Maybe already fixed in Tcl 9.0?

Yes, that's one of the reasons for switching to tcl9 as soon as
possible.

Subject: Re: 2GB limitation
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Mon, 22 Jul 2024 17:06 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!panix!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: Re: 2GB limitation
Date: Mon, 22 Jul 2024 17:06:07 +0000
Organization: novaBBS
Message-ID: <db0284614c07c7d6b89a167cf3d8d8da@www.novabbs.com>
References: <ca9ceb402172bc85450b5a9ac4e18715@www.novabbs.com> <slrnv9s677.1l9n7.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="4185622"; mail-complaints-to="usenet@i2pn2.org";
posting-account="0Z5XV6kwM7Cos/IbgWfXZAYsazigEecpjCfqz3CX7rU";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$5oxHNA88YED6prc0YKXdT.q5xE9LSE7OOb/foyTt03ICzJTg8gdEW
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: 916f90664d3de2199c7a6231aba6924e4b1593d3
View all headers

Wow, that unexpected and cool!
Thanks

Subject: Re: 2GB limitation
From: Rich
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 22 Jul 2024 17:17 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: 2GB limitation
Date: Mon, 22 Jul 2024 17:17:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <v7m471$o8c0$1@dont-email.me>
References: <ca9ceb402172bc85450b5a9ac4e18715@www.novabbs.com> <slrnv9s677.1l9n7.avl@logic.at>
Injection-Date: Mon, 22 Jul 2024 19:17:21 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="29eb5f955e13a8d704edc989f2b069f2";
logging-data="795008"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HyxpT/hMnIUkhH33UF40U"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:gh/WksIQavD0WDcCifHXVd00mrs=
View all headers

Andreas Leitgeb <avl@logic.at> wrote:
> alexandru <alexandru.dadalau@meshparts.de> wrote:
>> Will there be a fix for the 2GB size limit that a string representation
>> have in Tcl?
>> Maybe already fixed in Tcl 9.0?
>
> Yes, that's one of the reasons for switching to tcl9 as soon as
> possible.

What is the new larger "limit" in Tcl9?

Subject: Re: 2GB limitation
From: Emiliano
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 23 Jul 2024 00:58 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: emiliano@example.invalid (Emiliano)
Newsgroups: comp.lang.tcl
Subject: Re: 2GB limitation
Date: Mon, 22 Jul 2024 21:58:03 -0300
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <20240722215803.631b2a665d03387d3129cbc1@example.invalid>
References: <ca9ceb402172bc85450b5a9ac4e18715@www.novabbs.com>
<slrnv9s677.1l9n7.avl@logic.at>
<v7m471$o8c0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 23 Jul 2024 02:58:04 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="45a2d7991c9624842e9536e3de8ef290";
logging-data="944734"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LeiAOYq/uHfUj5AZKzgXfCjDA61lJZOE="
Cancel-Lock: sha1:/0LcYnwRQk0IvPWRwJPTnP6Y8Os=
X-Newsreader: Sylpheed 3.5.1 (GTK+ 2.24.32; i686-pc-linux-gnu)
View all headers

On Mon, 22 Jul 2024 17:17:21 -0000 (UTC)
Rich <rich@example.invalid> wrote:

> Andreas Leitgeb <avl@logic.at> wrote:
> > alexandru <alexandru.dadalau@meshparts.de> wrote:
> >> Will there be a fix for the 2GB size limit that a string representation
> >> have in Tcl?
> >> Maybe already fixed in Tcl 9.0?
> >
> > Yes, that's one of the reasons for switching to tcl9 as soon as
> > possible.
>
> What is the new larger "limit" in Tcl9?

In 9.0 the type of the 'length' member of the Tcl_Obj struct (the number of
bytes at '*bytes' member, not including the terminating null) has changed
from int to ptrdiff_t, so it will remain (1<<31)-1 => 2147483647 bytes on
32 bit platforms (unsurprisingly) and (1<<63)-1 => 9223372036854775807
(9,22 exabyte) on 64 bit platforms.

IIUC that's also the (new) number of elements for a Tcl list. In practice
the number will be less, since the length of the string representation of
such list will hit the '*bytes' max length first.

--
Emiliano

Subject: Re: 2GB limitation
From: Harald Oehlmann
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 24 Jul 2024 07:07 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: 2GB limitation
Date: Wed, 24 Jul 2024 09:07:15 +0200
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <v7q972$1l4dk$1@dont-email.me>
References: <ca9ceb402172bc85450b5a9ac4e18715@www.novabbs.com>
<slrnv9s677.1l9n7.avl@logic.at> <v7m471$o8c0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 24 Jul 2024 09:07:14 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f4f98ac77d637080cb67668722a9a19e";
logging-data="1741236"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oYtDevUjOTx4XPgc7gdRg"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:GYSzkMCBKYNqhK7fUj1TSRhWczc=
Content-Language: en-GB
In-Reply-To: <v7m471$o8c0$1@dont-email.me>
View all headers

Am 22.07.2024 um 19:17 schrieb Rich:
> Andreas Leitgeb <avl@logic.at> wrote:
>> alexandru <alexandru.dadalau@meshparts.de> wrote:
>>> Will there be a fix for the 2GB size limit that a string representation
>>> have in Tcl?
>>> Maybe already fixed in Tcl 9.0?
>>
>> Yes, that's one of the reasons for switching to tcl9 as soon as
>> possible.
>
> What is the new larger "limit" in Tcl9?

expr {2**63}

Subject: Re: 2GB limitation
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 24 Jul 2024 16:22 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: 2GB limitation
Date: Wed, 24 Jul 2024 16:22:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <slrnva2ait.1l9n7.avl@logic.at>
References: <ca9ceb402172bc85450b5a9ac4e18715@www.novabbs.com>
<slrnv9s677.1l9n7.avl@logic.at> <v7m471$o8c0$1@dont-email.me>
<20240722215803.631b2a665d03387d3129cbc1@example.invalid>
Reply-To: avl@logic.at
Injection-Date: Wed, 24 Jul 2024 18:22:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b89304e26684d85b712c933857a17e67";
logging-data="1915713"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18w5fLIVixrTCgWzAwAtWH6"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:ZDcIOvxapYQjNZH8B4n3V/dw/xI=
View all headers

Emiliano <emiliano@example.invalid> wrote:
> In 9.0 the type of the 'length' member of the Tcl_Obj struct (the number of
> bytes at '*bytes' member, not including the terminating null) has changed
> from int to ptrdiff_t, so it will remain (1<<31)-1 => 2147483647 bytes on
> 32 bit platforms (unsurprisingly) and (1<<63)-1 => 9223372036854775807
> (9,22 exabyte) on 64 bit platforms.

My hearsay was "generally 64 bit (minus the sign-bit)".
Are you sure that length-type is *always* ptrdiff_t, and
that this may be 32bit?

The "64bit'ness" of a platform is also a bit more complicated...
There are platforms, where pointers are 64bit, but ints are
still 32 (despite machine words being all 64bit) - in those
cases, I'd expect ptrdiff_t to be 64 bit, but on a real old
32bit machine, I don't really know for sure...

> IIUC that's also the (new) number of elements for a Tcl list.
> In practice the number will be less, since the length of the
> string representation of such list will hit the '*bytes' max
> length first.

Not all lists are ever turned to string-rep. While they are
semantically "just strings", well written programs can avoid
the actual obtainment of the string rep, at least for those
really long lists that may be relevant here.

Subject: Re: 2GB limitation
From: Emiliano
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 24 Jul 2024 20:05 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: emiliano@example.invalid (Emiliano)
Newsgroups: comp.lang.tcl
Subject: Re: 2GB limitation
Date: Wed, 24 Jul 2024 17:05:19 -0300
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <20240724170519.f9f2ad383c7d336f11fa4fcf@example.invalid>
References: <ca9ceb402172bc85450b5a9ac4e18715@www.novabbs.com>
<slrnv9s677.1l9n7.avl@logic.at>
<v7m471$o8c0$1@dont-email.me>
<20240722215803.631b2a665d03387d3129cbc1@example.invalid>
<slrnva2ait.1l9n7.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 24 Jul 2024 22:05:23 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c236c9e3471892317cec827144428d60";
logging-data="1992136"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oQVtGSwjUYQYioVaR5w3XIVgnofZl2jA="
Cancel-Lock: sha1:mn1wm3uOX/xxtcNYGxHu5hF9b+c=
X-Newsreader: Sylpheed 3.5.1 (GTK+ 2.24.32; i686-pc-linux-gnu)
View all headers

On Wed, 24 Jul 2024 16:22:53 -0000 (UTC)
Andreas Leitgeb <avl@logic.at> wrote:

> Emiliano <emiliano@example.invalid> wrote:
> > In 9.0 the type of the 'length' member of the Tcl_Obj struct (the number of
> > bytes at '*bytes' member, not including the terminating null) has changed
> > from int to ptrdiff_t, so it will remain (1<<31)-1 => 2147483647 bytes on
> > 32 bit platforms (unsurprisingly) and (1<<63)-1 => 9223372036854775807
> > (9,22 exabyte) on 64 bit platforms.
>
> My hearsay was "generally 64 bit (minus the sign-bit)".
> Are you sure that length-type is *always* ptrdiff_t, and
> that this may be 32bit?

In 9.X, it is ptrdiff_t. In 8.Y is still int.

See https://core.tcl-lang.org/tcl/file?ci=trunk&name=generic/tcl.h&ln=325-333
and
https://core.tcl-lang.org/tcl/file?ci=trunk&name=generic/tcl.h&ln=740-752

ptrdiff_t can still be a 32 bits wide value. See below.
> The "64bit'ness" of a platform is also a bit more complicated...
> There are platforms, where pointers are 64bit, but ints are
> still 32 (despite machine words being all 64bit) - in those
> cases, I'd expect ptrdiff_t to be 64 bit, but on a real old
> 32bit machine, I don't really know for sure...

This is what I mean when say "on 32-bit platforms is still 2GB",
since i386-i686 platform has a 32 bit ptrdiff_t.

On my ancient i686 machine:

$ uname -m
i686
$ tclsh9.0
% expr {(1 << (8 * $tcl_platform(pointerSize))-1) - 1}
2147483647
% package provide Tcl
9.0b3
% set tcl_platform(pointerSize)
4

> > IIUC that's also the (new) number of elements for a Tcl list.
> > In practice the number will be less, since the length of the
> > string representation of such list will hit the '*bytes' max
> > length first.
>
> Not all lists are ever turned to string-rep. While they are
> semantically "just strings", well written programs can avoid
> the actual obtainment of the string rep, at least for those
> really long lists that may be relevant here.

Yes, but that's an optimization. Tcl semantics are still defined
in terms of strings operations. I prefer not to depend on internals.

--
Emiliano

1

rocksolid light 0.9.8
clearnet tor