• computer languages speed race at Dave's garage

    From Lorenzo Lodi@21:1/5 to All on Sat Jul 24 09:58:16 2021
    I wanted to call your attention to an on-going series of videos on the
    YouTube channel Dave's garage:
    https://www.youtube.com/watch?v=pv4Yq35Chx0


    This all began when the author of the Youtube channel recounted that he implemented a prime number sieve as an exercise in his school years in
    the '80s, and now wanted to run exactly the same benchmark using modern languages (initially, C# and Python).
    This proved very popular, and watchers have submitted their
    implementations in lots of languages (61 and counting), including Fortran. Specifically, the goal is to implement a prime number sieve for primes
    up to a million, closely following the algorithm in a reference
    implementation (in C#).
    In every episode of the series the author consider a couple of
    implementations in similar languages (e.g., C# and Java), discusses a
    bit the languages and then shows the results of the benchmarks.

    There is a Github repository with all the implementations https://github.com/PlummersSoftwareLLC/Primes

    At the moment there are two Fortran implementations, one Fortran 2003
    and 2008. https://github.com/PlummersSoftwareLLC/Primes/tree/drag-race/PrimeFortran

    I think it's be great if some of the Fortran experts had a look at those implementations and, perhaps, improved them if possible.
    I think if Fortran did well this would be good publicity for the general public. I found some benchmarks (for older implementations, as they are
    updated all the time) here: https://www.reddit.com/r/fsharp/comments/oezbnv/daves_garage_prime_numbers_laguages_benchmark/

    The list above indicates that the fastest implementations are in C and
    zig (a language I'd never heard of), with the Fortran implementation far
    behind (although many of those results look very strange, so take them
    with a pinch of salt).

    Lorenzo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gah4@21:1/5 to Lorenzo Lodi on Sat Jul 24 03:28:40 2021
    On Friday, July 23, 2021 at 11:58:25 PM UTC-7, Lorenzo Lodi wrote:
    I wanted to call your attention to an on-going series of videos on the YouTube channel Dave's garage:
    https://www.youtube.com/watch?v=pv4Yq35Chx0


    This all began when the author of the Youtube channel recounted that he implemented a prime number sieve as an exercise in his school years in
    the '80s, and now wanted to run exactly the same benchmark using modern languages (initially, C# and Python).

    The C version realizes that the word of bits to clear repeats cyclically through
    the loop. The Fortran version generates the bits one at a time, each time. Even more, the Fortran version uses divide and mod for each one, though
    the compiler might do it with shift and AND operations. Still, the bitwise computations are likely intensive.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robin Vowels@21:1/5 to Lorenzo Lodi on Sat Jul 24 20:19:05 2021
    On Saturday, July 24, 2021 at 4:58:25 PM UTC+10, Lorenzo Lodi wrote:
    I wanted to call your attention to an on-going series of videos on the YouTube channel Dave's garage:
    https://www.youtube.com/watch?v=pv4Yq35Chx0


    This all began when the author of the Youtube channel recounted that he implemented a prime number sieve as an exercise in his school years in
    the '80s, and now wanted to run exactly the same benchmark using modern languages (initially, C# and Python).
    This proved very popular, and watchers have submitted their
    implementations in lots of languages (61 and counting), including Fortran. Specifically, the goal is to implement a prime number sieve for primes
    up to a million, closely following the algorithm in a reference implementation (in C#).
    In every episode of the series the author consider a couple of implementations in similar languages (e.g., C# and Java), discusses a
    bit the languages and then shows the results of the benchmarks.

    There is a Github repository with all the implementations https://github.com/PlummersSoftwareLLC/Primes

    At the moment there are two Fortran implementations, one Fortran 2003
    and 2008. https://github.com/PlummersSoftwareLLC/Primes/tree/drag-race/PrimeFortran

    I think it's be great if some of the Fortran experts had a look at those implementations and, perhaps, improved them if possible.
    I think if Fortran did well this would be good publicity for the general public. I found some benchmarks (for older implementations, as they are updated all the time) here: https://www.reddit.com/r/fsharp/comments/oezbnv/daves_garage_prime_numbers_laguages_benchmark/

    The list above indicates that the fastest implementations are in C and
    zig (a language I'd never heard of), with the Fortran implementation far behind (although many of those results look very strange, so take them
    with a pinch of salt).
    .
    Implementations of the algorithm in various languages
    can be found at rosetta code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)