Deutsch English Français Italiano |
<vbkaub$1uovi$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Thomas Koenig <tkoenig@netcologne.de> Newsgroups: comp.arch Subject: Re: Fortran was NOT higher level than C. Was: Computer architects leaving Intel... Date: Sun, 8 Sep 2024 14:05:00 -0000 (UTC) Organization: A noiseless patient Spider Lines: 46 Message-ID: <vbkaub$1uovi$1@dont-email.me> References: <2024Aug30.161204@mips.complang.tuwien.ac.at> <memo.20240830164247.19028y@jgd.cix.co.uk> <vasruo$id3b$1@dont-email.me> <2024Aug30.195831@mips.complang.tuwien.ac.at> <vat5ap$jthk$2@dont-email.me> <vaunhb$vckc$1@dont-email.me> <vautmu$vr5r$1@dont-email.me> <2024Aug31.170347@mips.complang.tuwien.ac.at> <vavpnh$13tj0$2@dont-email.me> <vb00c2$150ia$1@dont-email.me> <505954890d8461c1f4082b1beecd453c@www.novabbs.org> <vb0kh2$12ukk$1@dont-email.me> <vb3smg$1ta6s$1@dont-email.me> <vb4q5o$12ukk$3@dont-email.me> <vb6a16$38aj5$1@dont-email.me> <jwv8qw8o7zg.fsf-monnier+comp.arch@gnu.org> <vb7q5q$3f6cg$1@dont-email.me> <20240904113123.00002098@yahoo.com> <vba46k$3te58$1@dont-email.me> <20240905130424.00001218@yahoo.com> <vbc53m$ahv7$1@dont-email.me> <20240905153103.00000008@yahoo.com> <vbcfo4$cd1g$1@dont-email.me> <20240908123330.000079a1@yahoo.com> Injection-Date: Sun, 08 Sep 2024 16:05:00 +0200 (CEST) Injection-Info: dont-email.me; posting-host="d7ba24bf9b685bf0d6c797373a0fc93a"; logging-data="2057202"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IbS7rV367+PQyww6uxZR1IFDm5dTCmgQ=" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:8wQvHab4ee0FGJKR7/v1y5IY1yQ= Bytes: 3457 Michael S <already5chosen@yahoo.com> schrieb: > On Thu, 5 Sep 2024 14:37:56 -0000 (UTC) > Thomas Koenig <tkoenig@netcologne.de> wrote: > >> Michael S <already5chosen@yahoo.com> 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) If you want to, you can also do so in Fortran. > and since memory management is > automatic, If you want to, you can also do so in Fortran. You can also do allocation on assignment, so the size is calculated automatically for you (since Fortran 2003). (Of course, Fortran stole^H^H^H^H^H borrowed this feature from Matlab, but for a compiled language). >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. I find the Fortran notation of having INTENT(IN), INTENT(OUT) and INTENT(INOUT) very convenient; you get to say explicitly what you want, and the compiler will check it for you. > 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. In an interpreted language, I guess the focus is less on squeezing out the last bit of speed... in Fortran, we find this something quite important.