Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Michael S Newsgroups: comp.arch Subject: Re: Fortran was NOT higher level than C. Was: Computer architects leaving Intel... Date: Sun, 8 Sep 2024 12:33:30 +0300 Organization: A noiseless patient Spider Lines: 24 Message-ID: <20240908123330.000079a1@yahoo.com> References: <2024Aug30.161204@mips.complang.tuwien.ac.at> <2024Aug30.195831@mips.complang.tuwien.ac.at> <2024Aug31.170347@mips.complang.tuwien.ac.at> <505954890d8461c1f4082b1beecd453c@www.novabbs.org> <20240904113123.00002098@yahoo.com> <20240905130424.00001218@yahoo.com> <20240905153103.00000008@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Sun, 08 Sep 2024 11:33:08 +0200 (CEST) Injection-Info: dont-email.me; posting-host="46daed28da5e223c25c4774ca01ab553"; logging-data="1969573"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18o3ZLxky2wVccl2RWLB/mN/OuCP9BY1Hw=" Cancel-Lock: sha1:NUAgXxXn/lxez09kCALn8st0qXA= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 2809 On Thu, 5 Sep 2024 14:37:56 -0000 (UTC) Thomas Koenig wrote: > Michael S schrieb: > > > In other group (Matlab/Octave) pass-by-value is the only available > > option, so I use it all the time, but it does not mean much. > > I knew there's a reason for me not using matlab or octave :-) > But of course, if it's your day job, you have little choice > in the matter. > Since in Matlab/Octave function can return as many arrays/matrices as one wants (by value, of course) and since memory management is automatic, it's all ends up sufficiently convenient. And certainly easier to follow for reader and less error prone to writer than most forms of passing arrays by reference. The only serious downside of this approach is a performance hit due to sometimes unnecessary copying and allocation/freeing. More often than not it's not a big deal and certainly not a main performance bottleneck of this environments.