• The new features of Fortran 202x

    From Beliavsky@21:1/5 to All on Wed Mar 23 06:37:42 2022
    At Fortran Discourse https://fortran-lang.discourse.group/t/fortran-202x-features/388/3 the new paper by John Reid, "The new features of Fortran 202x", https://wg5-fortran.org/N2151-N2200/N2194.pdf was mentioned.
    No more features have been added to the lists of obsolete and deleted features.

    Some sections are

    Language elements
    Intrinsic procedures and intrinsic modules
    Interoperability with C
    Input-output
    Coarrays
    Procedures
    Array features
    Enumerations

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gary Scott@21:1/5 to Beliavsky on Wed Mar 23 10:45:40 2022
    On 3/23/2022 8:37 AM, Beliavsky wrote:
    At Fortran Discourse https://fortran-lang.discourse.group/t/fortran-202x-features/388/3 the new paper by John Reid, "The new features of Fortran 202x", https://wg5-fortran.org/N2151-N2200/N2194.pdf was mentioned.
    No more features have been added to the lists of obsolete and deleted features.

    Some sections are

    Language elements
    Intrinsic procedures and intrinsic modules
    Interoperability with C
    Input-output
    Coarrays
    Procedures
    Array features
    Enumerations
    hmmm...no bit strings :(

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Nagle@21:1/5 to Gary Scott on Wed Mar 23 10:05:50 2022
    Hi,

    On Mar 23, 2022, Gary Scott wrote
    (in article <t1ffb5$f4r$1@dont-email.me>):

    hmmm...no bit strings :(
    bit strings are usually taken as implying a new type.
    New types are expensive for compilers, so to add a new type to the language
    you must find an important use case difficult to support without a new type.

    --
    Cheers!

    Dan Nagle

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Lionel@21:1/5 to Gary Scott on Wed Mar 23 12:01:54 2022
    On 3/23/2022 11:45 AM, Gary Scott wrote:
    hmmm...no bit strings :(

    See https://stevelionel.com/drfortran/2020/08/11/doctor-fortran-in-were-all-bozos-on-this-bus/
    for some words on that.

    --
    Steve Lionel
    ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
    Retired Intel Fortran developer/support
    Email: firstname at firstnamelastname dot com
    Twitter: @DoctorFortran
    LinkedIn: https://www.linkedin.com/in/stevelionel
    Blog: https://stevelionel.com/drfortran
    WG5: https://wg5-fortran.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robin Vowels@21:1/5 to Dan Nagle on Wed Mar 23 09:44:18 2022
    On Thursday, March 24, 2022 at 3:05:54 AM UTC+11, Dan Nagle wrote:
    Hi,

    On Mar 23, 2022, Gary Scott wrote
    (in article <t1ffb5$f4r$1...@dont-email.me>):

    hmmm...no bit strings :(
    bit strings are usually taken as implying a new type.
    New types are expensive for compilers, so to add a new type to the language you must find an important use case difficult to support without a new type.

    Bit strings have been available in PL/I since 1966. No big deal.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Koenig@21:1/5 to Dan Nagle on Wed Mar 23 17:27:04 2022
    Dan Nagle <danlnagle@mac.com> schrieb:
    Hi,

    On Mar 23, 2022, Gary Scott wrote
    (in article <t1ffb5$f4r$1@dont-email.me>):

    hmmm...no bit strings :(
    bit strings are usually taken as implying a new type.
    New types are expensive for compilers, so to add a new type to the language you must find an important use case difficult to support without a new type.

    Bit strings can be implemented without too much trouble using the
    existing intrinsic functions plus boz constants.

    What I find difficult to get around sometimes is the lack of
    an unsigned integer type, for exact interaction with C and for
    reading or writing file formats which have unsigned lengths.
    I usually resort to using C, then (the horror!)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Koenig@21:1/5 to All on Wed Mar 23 18:30:43 2022
    Just going through the document... a few thoughts.

    # The limit of 255 continuation lines is removed and the limit on
    # statement length is raised to a million characters.

    # These relaxations are designed to support programs that are
    # constructed mechanically. It not expected that they will be needed
    # in programs written directly by people.

    # These are hard limits. Processors are required to issue warnings
    # if they are breached.

    Love that one. A million also makes sure that this is clearly
    recognizable as an artifical limit - had 1048575 been used,
    somebody would have wondered about a 20-bit limitation somewhere.

    Automatically allocating the length for get_command - great.
    Saves me quite a few lines of code (inquiring about the length,
    allocating the character, filling in the argument).

    Splitting tokens - also quite useful. I'll probably get to
    write it once, for libgfortran, instead of quite a few times
    in my own programs.

    selected_logical_kind: James will be pleased.

    Plus there is some more - enums and coarray stuff.

    Sounds like a few irksome things were fixed in that revision.
    Looks good to me :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Beliavsky@21:1/5 to Thomas Koenig on Wed Mar 23 13:26:42 2022
    On Wednesday, March 23, 2022 at 2:30:46 PM UTC-4, Thomas Koenig wrote:
    Just going through the document... a few thoughts.

    # The limit of 255 continuation lines is removed and the limit on
    # statement length is raised to a million characters.

    # These relaxations are designed to support programs that are
    # constructed mechanically. It not expected that they will be needed
    # in programs written directly by people.

    # These are hard limits. Processors are required to issue warnings
    # if they are breached.

    Love that one. A million also makes sure that this is clearly
    recognizable as an artifical limit - had 1048575 been used,
    somebody would have wondered about a 20-bit limitation somewhere.

    Automatically allocating the length for get_command - great.
    Saves me quite a few lines of code (inquiring about the length,
    allocating the character, filling in the argument).

    Splitting tokens - also quite useful. I'll probably get to
    write it once, for libgfortran, instead of quite a few times
    in my own programs.

    selected_logical_kind: James will be pleased.

    Plus there is some more - enums and coarray stuff.

    Sounds like a few irksome things were fixed in that revision.
    Looks good to me :-)

    Thanks to you and the other gfortran volunteers for your efforts. As features are added I will publicize them on Twitter FortranTip.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robin Vowels@21:1/5 to Thomas Koenig on Wed Mar 23 21:25:27 2022
    On Thursday, March 24, 2022 at 4:27:07 AM UTC+11, Thomas Koenig wrote:
    Dan Nagle <danl...@mac.com> schrieb:
    Hi,

    On Mar 23, 2022, Gary Scott wrote
    (in article <t1ffb5$f4r$1...@dont-email.me>):

    hmmm...no bit strings :(
    bit strings are usually taken as implying a new type.
    New types are expensive for compilers, so to add a new type to the language you must find an important use case difficult to support without a new type.

    Bit strings can be implemented without too much trouble using the
    existing intrinsic functions plus boz constants.

    What I find difficult to get around sometimes is the lack of
    an unsigned integer type, for exact interaction with C and for
    reading or writing file formats which have unsigned lengths.
    I usually resort to using C, then (the horror!)
    .
    There's no problem either with PL/I or Fortran in reading
    and writing picture file formats that have unsigned lengths, etc.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Van Buskirk@21:1/5 to Steve Lionel on Thu Mar 24 00:51:12 2022
    "Steve Lionel" wrote in message news:ja0ujjFih27U1@mid.individual.net...

    On 3/23/2022 11:45 AM, Gary Scott wrote:
    hmmm...no bit strings :(

    See https://stevelionel.com/drfortran/2020/08/11/doctor-fortran-in-were-all-bozos-on-this-bus/
    for some words on that.

    So
    char([integer::Z'48',Z'65',Z'6C',Z'6C',Z'6F',Z'2C',Z'20',Z'77',Z'6F',Z'72',Z'6C',Z'64'])
    but not
    [character::Z'48',Z'65',Z'6C',Z'6C',Z'6F',Z'2C',Z'20',Z'77',Z'6F',Z'72',Z'6C',Z'64']
    ?
    And still no
    char(Z'21') !?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Van Buskirk@21:1/5 to Thomas Koenig on Thu Mar 24 00:59:16 2022
    "Thomas Koenig" wrote in message news:t1fp0j$k3p$1@newsreader4.netcologne.de...

    selected_logical_kind: James will be pleased.

    James who? Since there are different internal representations of .TRUE.: x
    /= 0,
    BTEST(x,0), TEST >= 0, and the gfortran representation, there may be
    different
    kinds with the same size.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Koenig@21:1/5 to James Van Buskirk on Thu Mar 24 07:47:20 2022
    James Van Buskirk <not_valid@comcast.net> schrieb:
    "Thomas Koenig" wrote in message news:t1fp0j$k3p$1@newsreader4.netcologne.de...

    selected_logical_kind: James will be pleased.

    James who?

    Van Buskirk :-) Are you?

    Since there are different internal representations of .TRUE.: x
    /= 0,
    BTEST(x,0), TEST >= 0, and the gfortran representation, there may be different
    kinds with the same size.

    There are different internal representations in use, but certainly
    not in the same compiler with the same options.

    And C_BOOL pretty much settled the question about the internal
    representation.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Lionel@21:1/5 to James Van Buskirk on Thu Mar 24 10:48:00 2022
    On 3/24/2022 2:51 AM, James Van Buskirk wrote:
    So

    char([integer::Z'48',Z'65',Z'6C',Z'6C',Z'6F',Z'2C',Z'20',Z'77',Z'6F',Z'72',Z'6C',Z'64'])

    but not

    [character::Z'48',Z'65',Z'6C',Z'6C',Z'6F',Z'2C',Z'20',Z'77',Z'6F',Z'72',Z'6C',Z'64']

    ?
    And still no
      char(Z'21') !?

    Correct. Note that the definition of the CHAR intrinsic is NOT "transfer
    the bit pattern" but "a value in the range 0 ≤ I ≤ n−1, where n is the number of characters in the collating sequence associated with the
    specified kind type parameter" It's not much of a hardship to write char(int(Z'21')) or use your first form of an array constructor.

    I'd also wonder how an attempt to shoehorn BOZ constants into CHAR would
    deal with character sets that have varying number of bytes (UNICODE, etc.)

    You are welcome to make a proposal to enhance the use of BOZ constants
    in character contexts - https://github.com/j3-fortran/fortran_proposals
    is a good place for that.

    --
    Steve Lionel
    ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
    Retired Intel Fortran developer/support
    Email: firstname at firstnamelastname dot com
    Twitter: @DoctorFortran
    LinkedIn: https://www.linkedin.com/in/stevelionel
    Blog: https://stevelionel.com/drfortran
    WG5: https://wg5-fortran.org

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