Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #197950

Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

From Lawrence D’Oliveiro <ldo@nz.invalid>
Newsgroups sci.math, comp.lang.fortran, comp.lang.python
Subject Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?
Date 2026-09-06 22:00 +0000
Organization A noiseless patient Spider
Message-ID <117knq7$2o0bv$4@dont-email.me> (permalink)
References <WFfnS.67381$kqHe.6119@fx07.ams4> <117k135$2fr7o$1@dont-email.me>

Cross-posted to 3 groups.

Show all headers | View raw


On Sun, 6 Sep 2026 15:32:53 -0000 (UTC), Thomas Koenig wrote:

> Fortran 77 makes little sense, modern Fortran variants (Fortran 90+)
> are available with free compilers and offer much more comfort and
> safety.

Python offers custom operator overloads, so you can write actual
operator expressions for addition, dot product etc -- closer in
appearance to the actual maths -- instead of parenthesis-ridden
function calls.

For a simple example, this method constructs a 3D homogeneous matrix
that performs arbitrary scaling about an arbitrary centre point:

    @classmethod
    def scaling_about(celf, factor : Vector4, centre : Vector4) :
        "constructs a Matrix4 that scales by the specified offset Vector4" \
        " about the specified centre."
        return \
          (
                celf.translation(centre)
            @
                celf.scaling(factor)
            @
                celf.translation(- centre)
          )
    #end scaling_about

From the body, you can see intuitively how it works, as the dot
product (“@” being the recommended Python operator to use for this) of
3 separate transformations: from right to left, you move the centre
point to the origin, perform the scaling about the origin, then
translate the origin back to the original centre point.

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-06 23:29 +0800
  Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Thomas Koenig <tkoenig@netcologne.de> - 2026-09-06 15:32 +0000
    Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-06 23:53 +0800
    Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Cóilín Nioclásín Glostéir <thanks-to@Taf.com> - 2026-09-06 17:30 +0000
      Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Thomas Koenig <tkoenig@netcologne.de> - 2026-09-06 19:47 +0000
    Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? "David Jones" <dajhawkxx@nowherel.com> - 2026-09-06 18:40 +0000
      Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Thomas Koenig <tkoenig@netcologne.de> - 2026-09-06 19:49 +0000
    Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-09-06 22:00 +0000
      Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-09-07 10:48 +0800
      Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> - 2026-09-07 04:41 +0000
        Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-09-07 13:24 +0800
        Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-09-07 06:47 +0000
          Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-09-07 16:32 +0800
      Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra? Thomas Koenig <tkoenig@netcologne.de> - 2026-09-07 05:08 +0000

csiph-web