🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.rust
Article #400

Re: “The end of software secrecy is almost upon

#400
From: Chris M. Thomasson
Date: Tue, 27 Oct 2026 02:29
79 lines
5071 bytes
On 10/24/2026 3:43 AM, David Brown wrote:
> On 23/10/2026 18:57, Peter Flass wrote:
>> On 10/23/26 02:45, David Brown wrote:
>>> On 23/10/2026 08:25, Lawrence D’Oliveiro wrote:
>>>> On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:
>>>>
>>>>> On 10/22/2026 8:19 PM, Lawrence D’Oliveiro wrote:
>>>>>>
>>>>>> On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:
>>>>>>
>>>>>>> That's why I try to use PL/I AUTOMATIC (stack) storage and not
>>>>>>> allocate a lot of stuff. You need to have a disciplined approach
>>>>>>> if you allocate random stuff here and there.
>>>>>>
>>>>>> What if you’re building an object that needs to be returned to the
>>>>>> caller?
>>>>>
>>>>> Have the caller have the object before hand and call a function to
>>>>> initialize it?
>>>>
>>>> I’m assuming that all that BASIC programming hasn’t got to your head,
>>>> and you’re not serious. ;)
>>>
>>> Chris' wording is perhaps poor, but the principle is right.
>>>
>>> I don't know PL/I or Fortran, but in C if you have :
>>>
>>>      typedef struct data_struct { int a; int xs[20]; } S ;
>>>
>>>      S build_some_data(void) {
>>>          S s;
>>>
>>>          s.a = 123;
>>>          for (int i = 0; i < 20; i++) s.xs[i] = i;
>>>
>>>          return s;
>>>      }
>>>
>>>      void foo() {
>>>          S s = build_some_data();
>>>      }
>>>
>>>
>>> then it is typically handled as though you had written :
>>>
>>>      void build_some_data(S * p) {
>>>          p->a = 123;
>>>          for (int i = 0; i < 20; i++) p->xs[i] = i;
>>>
>>>          return;
>>>      }
>>>
>>>      void foo() {
>>>          S s;
>>>          build_some_data(&s);
>>>      }
>>>
>>>
>>> That is - the caller creates the /space/ for the returned object, but 
>>> does not do any kind of initialisation.  It passes a pointer to that 
>>> space as a hidden parameter to the function that wants to return the 
>>> object.
>>>
>>> That principle should work fine in any language, as long as the size 
>>> of the returned object is known by the caller code.
>>
>> That last sentence is why it would not work fine,
> 
> OK.  Knowing the size of the returned object is an absolute requirement 
> for pre-allocation by the caller, and it is a requirement that is fine 
> for a lot of situations and a lot of languages.  But if it is not the 
> case for PL/I, Fortran, or any other particular language (or particular 
> function in any language), then I fully agree - the object's space can't 
> be handled by the caller.
> 

Use when the API provides it, or else, well, read the api learn and know 
how to use it. If it allows the caller to make the memory it needs, so 
be it, if not, who cares?
Technical Details
Message-ID: <11bp2ac$15h60$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11amvre$15far$1@dont-email.me> <11b5tdb$2cs5l$1@dont-email.me> <11b64cp$end$1@panix2.panix.com> <11b64hj$2faos$1@dont-email.me> <11b679m$6dl$1@panix2.panix.com> <11b6vc4$2npqv$1@dont-email.me> <11b87jg$37b7t$1@dont-email.me> <11b884b$p2o9$1@dont-email.me> <11b94he$3hdo3$2@dont-email.me> <11b9qd6$pq4i$1@dont-email.me> <11b9r5r$3nppf$1@dont-email.me> <11baekk$3v7n1$1@dont-email.me> <11bbl4f$du80$2@dont-email.me> <11bbo58$ek3q$1@dont-email.me> <11bbqns$fe31$1@dont-email.me> <11bbron$fmi2$1@dont-email.me> <11bc09b$gsv1$1@dont-email.me> <11bd6ed$ttau$1@dont-email.me> <11bejnh$1eab6$1@dont-email.me> <11berc9$1ge43$1@dont-email.me> <11beuk5$1h9da$2@dont-email.me> <11bfacd$1jkb5$6@dont-email.me> <11bg3kt$203lc$2@dont-email.me> <11bi23m$2jjto$2@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.lang.fortran,comp.lang.c++,alt.comp.lang.rust,alt.folklore.computers
Subject: Re: “The end of software secrecy is almost upon
Date: Mon, 26 Oct 2026 19:29:29 -0700
Organization: A noiseless patient Spider
Lines: 79
Message-ID: <11bp2ac$15h60$1@dont-email.me>
References: <11amvre$15far$1@dont-email.me> <11b5tdb$2cs5l$1@dont-email.me>
 <11b64cp$end$1@panix2.panix.com> <11b64hj$2faos$1@dont-email.me>
 <11b679m$6dl$1@panix2.panix.com> <11b6vc4$2npqv$1@dont-email.me>
 <11b87jg$37b7t$1@dont-email.me> <11b884b$p2o9$1@dont-email.me>
 <11b94he$3hdo3$2@dont-email.me> <11b9qd6$pq4i$1@dont-email.me>
 <11b9r5r$3nppf$1@dont-email.me> <11baekk$3v7n1$1@dont-email.me>
 <11bbl4f$du80$2@dont-email.me> <11bbo58$ek3q$1@dont-email.me>
 <11bbqns$fe31$1@dont-email.me> <11bbron$fmi2$1@dont-email.me>
 <11bc09b$gsv1$1@dont-email.me> <11bd6ed$ttau$1@dont-email.me>
 <11bejnh$1eab6$1@dont-email.me> <11berc9$1ge43$1@dont-email.me>
 <11beuk5$1h9da$2@dont-email.me> <11bfacd$1jkb5$6@dont-email.me>
 <11bg3kt$203lc$2@dont-email.me> <11bi23m$2jjto$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Oct 2026 02:29:33 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1230016"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/7GFK+2edrrzZ24vcmIXsU5p9Am5/KNII="; posting-host="a6c988641c9f0a5278d89ebf0389e645"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:eK/TGGVQXVZpAKBdDpq3qhn1WOo= sha256:cd3H0AWAkYF50I9uRBtSVWgChGZXK2uCsArJbJ0akwg=
	sha1:oDPQ5+0ms9hb2OnwEAFGogNBx3c= sha256:zla5EJmdAYzYqFgGYWPExpsWEefK/9rckdF8eun4T9I=
Content-Language: en-US
In-Reply-To: <11bi23m$2jjto$2@dont-email.me>