• Blog: Is Fortran better than Python for teaching the basics of numerica

    From Johann "Myrkraverk" Oskarsson@3:633/10 to All on Sun Sep 6 23:29:56 2026
    Subject: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    Dear comp.lang.fortran, sci.math, and comp.lang.python,

    I came across this blog post about the question which is better to teach mathematics, Fortran or Python. I'm currently still reading it, but
    will share with you this introductory paragraph.

    I?ve been teaching an /Intro to Scientific Computing/ class for nearly
    10+ years. This class is intended for second year engineering students
    and, as such, places a large emphasis on numerical linear algebra.
    Like the rest of Academia, I?m using a combination of Python and numpy arrays for this. Yet, after all these years, I start to believe it
    ain?t necessarily the right choice for a first encounter with
    numerical linear algebra. Obvisouly everything is not black and white
    and I?ll try to be nuanced. But, in my opinion, a strongly typed
    language such as Fortran might lead to an overall better learning experience. And that?s what it?s all about when you start Uni:
    learning the principles of scientific programming, not the quirks of a particular language (unless you?re a CS student, which is a different crowd).

    From https://loiseaujc.github.io/posts/blog-title/fortran_vs_python.html
    and you are best served by reading the blog post on your own.


    Best wishes, and happy switching from Python to Fortran 77!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Thomas Koenig@3:633/10 to All on Sun Sep 6 15:32:53 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    Johann "Myrkraverk" Oskarsson <johann@myrkraverk.invalid> schrieb:

    Best wishes, and happy switching from Python to Fortran 77!

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

    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann "Myrkraverk" Oskarsson@3:633/10 to All on Sun Sep 6 23:53:59 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    On 9/6/2026 11:32 PM, Thomas Koenig wrote:
    Johann "Myrkraverk" Oskarsson <johann@myrkraverk.invalid> schrieb:

    Best wishes, and happy switching from Python to Fortran 77!

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


    The author of the blog has this to say on the subject.

    When I write Fortran, what I really mean is modern Fortran, not
    FORTRAN. Anything pre-dating the Fortran 90 standard (or even
    better, the Fortran 2018 one) is not even an option (yes, I?m
    looking at you FORTRAN 77 and your incomprehensible goto, error-
    prone common, artithmetic if and what not).


    And it's purely a /skill issue/. Of course Fortran 77 is the better programming language.
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Cóilín Nioclásín Glostéir@3:633/10 to All on Sun Sep 6 17:30:03 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    Thomas Koenig <tkoenig@NetCologne.De> hat geschrieben: |-------------------------------------------------------------------|
    |"Johann "Myrkraverk" Oskarsson <johann@myrkraverk.invalid> schrieb:|
    | |
    Best wishes, and happy switching from Python to Fortran 77! |
    | |
    |Fortran 77 makes little sense, modern Fortran variants (Fortran |
    |90+) are available with free compilers and offer much more comfort |
    |and safety." | |-------------------------------------------------------------------|

    Are new versions of Fortran still much slower than FORTRAN 77?

    Ada is better for safety.
    (S. HTTP://Gloucester.Insomnia247.NL/ fuer Kontaktdaten!)

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Jones@3:633/10 to All on Sun Sep 6 18:40:42 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    Thomas Koenig wrote:

    Johann "Myrkraverk" Oskarsson <johann@myrkraverk.invalid> schrieb:

    Best wishes, and happy switching from Python to Fortran 77!

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

    Recall that the modern bits of modern Fortran might well lead a student
    to leap to use of MATINV, when MATINV should not be used. Etc..
    Students need to think in detail about what the computations in linear
    algebra are doing.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Thomas Koenig@3:633/10 to All on Sun Sep 6 19:47:57 2026
    Subject: 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> schrieb:
    Thomas Koenig <tkoenig@NetCologne.De> hat geschrieben:
    |-------------------------------------------------------------------| >|"Johann "Myrkraverk" Oskarsson <johann@myrkraverk.invalid> schrieb:|
    | |
    Best wishes, and happy switching from Python to Fortran 77! |
    | | >|Fortran 77 makes little sense, modern Fortran variants (Fortran |
    |90+) are available with free compilers and offer much more comfort |
    |and safety." | >|-------------------------------------------------------------------|

    Are new versions of Fortran still much slower than FORTRAN 77?

    Depends on what you're doing, but in general, no.


    Ada is better for safety.

    Different domains. While both languages are general-purpose,
    Fortran is more oriented towards scientific and technical
    application, for which you won't find Ada used much.

    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Thomas Koenig@3:633/10 to All on Sun Sep 6 19:49:40 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    David Jones <dajhawkxx@nowherel.com> schrieb:
    Thomas Koenig wrote:

    Johann "Myrkraverk" Oskarsson <johann@myrkraverk.invalid> schrieb:

    Best wishes, and happy switching from Python to Fortran 77!

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

    Recall that the modern bits of modern Fortran might well lead a student
    to leap to use of MATINV, when MATINV should not be used. Etc..

    Not sure what you mean by MATINV, it is not part of Fortran. Fortran
    does have MATMUL (which can usually be mapped to a BLAS routine).

    Students need to think in detail about what the computations in linear algebra are doing.

    Not only that... numerics in general is a difficult field.
    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sun Sep 6 22:00:39 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    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.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Mon Sep 7 10:48:32 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    On 07/09/2026 6:00 AM, Lawrence D?Oliveiro wrote:
    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.

    [snip some irrelevant B.S.]

    Lawrence, Lawrence, Lawrence!

    Why are you even mentioning Pythong in this context? Don't you know
    we are talking about the superiourity [sic] of Fortran 77?

    You know that Lua also has operator overloading, right? Or are you
    too busy snogging Kruger and Dunning, both at the same time? Why are
    you constantly posting about your snogging adventures in alt.sex.bon- dage.sco.unix- -- and what is the minus doing at the end?

    /I/ know, and knew before, that Lua has operator overloading. It's im- plemented with metatables -- unrelated to the recent meta adventures of
    the Meta C.E.O. -- and didn't think to mention it in the context of For-
    tran 77.


    So please, enlighten us about your snogging adventures!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Mon Sep 7 04:41:38 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    On Sun, 6 Sep 2026 22:00:39 -0000 (UTC), Lawrence D?Oliveiro wrote:

    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.

    Can we assume you know little to nothing about modern
    Fortran? One can write custom operator overloads in
    Fortran. Here's a Cartesian point with a translation
    and scaling operators.

    module pointm

    implicit none

    type point_t
    real x, y, z
    end type point_t

    interface operator(-)
    module procedure translate
    end interface

    interface operator(*)
    module procedure left
    module procedure rght
    end interface

    contains

    function translate(pt1, pt2) result(r)
    type(point_t) r
    type(point_t), intent(in) :: pt1, pt2
    r%x = pt1%x - pt2%x
    r%y = pt1%y - pt2%y
    r%z = pt1%z - pt2%z
    end function translate

    function left(c, pt1) result(r)
    type(point_t) r
    real, intent(in) :: c
    type(point_t), intent(in) :: pt1
    r%x = c * pt1%x
    r%y = c * pt1%y
    r%z = c * pt1%z
    end function left

    function rght(pt1, c) result(r)
    type(point_t) r
    real, intent(in) :: c
    type(point_t), intent(in) :: pt1
    r%x = c * pt1%x
    r%y = c * pt1%y
    r%z = c * pt1%z
    end function rght

    end module pointm

    program foo
    use pointm
    type(point_t) :: a = point_t(1, 1, 1), b = point_t(0.5, 0.75, 2)
    print "(3F6.2)", a - b
    print "(3F6.2)", 3. * a - 4. * b
    end program

    --
    steve

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Thomas Koenig@3:633/10 to All on Mon Sep 7 05:08:18 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:
    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.

    So does Fortran.

    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Mon Sep 7 13:24:54 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    On 07/09/2026 12:41 PM, Steven G. Kargl wrote:
    On Sun, 6 Sep 2026 22:00:39 -0000 (UTC), Lawrence D?Oliveiro wrote:

    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.

    Can we assume you know little to nothing about modern
    Fortran? One can write custom operator overloads in
    Fortran. Here's a Cartesian point with a translation
    and scaling operators.


    [snip program]

    Dear Steven,

    I'm pleased you've met Lawrence. He is in fact, not a programmer,
    but a /Pythong influencer/. I'm sure he gets paid by the post.

    I in fact did not know modern Fortran has operator overloading, as I
    haven't had a reason to use it since Fortran 77. It was a delightful experience I still remember.


    Thank you for the enlightenment!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Sep 7 06:47:39 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    On Mon, 7 Sep 2026 04:41:38 -0000 (UTC), Steven G. Kargl wrote:

    On Sun, 6 Sep 2026 22:00:39 -0000 (UTC), Lawrence D?Oliveiro wrote:

    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.

    Can we assume you know little to nothing about modern Fortran? One
    can write custom operator overloads in Fortran.

    Something else I can do in Python is write things that look a lot like
    new custom operators. E.g. a cross product between two 3D vectors
    could be written (with a suitable definition of the ?cross? property)
    as

    v1 .cross* v2

    without unnecessary parentheses.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Mon Sep 7 16:32:18 2026
    Subject: Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?

    On 07/09/2026 2:47 PM, Lawrence D?Oliveiro wrote:
    On Mon, 7 Sep 2026 04:41:38 -0000 (UTC), Steven G. Kargl wrote:

    On Sun, 6 Sep 2026 22:00:39 -0000 (UTC), Lawrence D?Oliveiro wrote:

    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.

    Can we assume you know little to nothing about modern Fortran? One
    can write custom operator overloads in Fortran.

    Something else I can do in Python is write things that look a lot like
    new custom operators. E.g. a cross product between two 3D vectors
    could be written (with a suitable definition of the ?cross? property)
    as

    v1 .cross* v2

    without unnecessary parentheses.

    So? Hasn't that been available since 1974 in the ML [1] programming
    language? Or was that added for the upgrade in 1997? I admit I've
    only read /The Definition of Standard ML (Revised Edition)/ (1997) and
    not the original from 1974.

    You're not gaining any /internet points/ by trying to pretend something
    was invented by Guido van Rossum!


    [1] Unrelated to /machine learning/, it's the /meta language/ of Edin-
    burg.
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)