• Upcoming gfortran 15 will contain unsigned numbers

    From Thomas Koenig@tkoenig@netcologne.de to comp.lang.fortran on Sun Oct 13 09:52:15 2024
    From Newsgroup: comp.lang.fortran

    Hello world,

    J3 has passed https://j3-fortran.org/doc/year/24/24-116.txt , a
    proposal for unsigned numbers in Fortran, in their February/March
    meeting.

    Gfortran 15, to be released in the beginning of 2025, will contain
    an experimental implementation of that proposal. The current
    development version already has that documentation, so if you
    are so inclined, you can download and compile it for yourself to
    try it out already.

    This feature can be accessed by using the -funsigned flag.
    Some short documentation can be found at

    https://gcc.gnu.org/onlinedocs/gfortran/Unsigned-integers.html

    Test cases (also doubling as use examples) can be found at https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=gcc/testsuite/gfortran.dg
    (any file that has "unsigned" in its name).

    Bug reports and comments are welcome.

    Enjoy!

    Best regards

    Thomas
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Gary Scott@garylscott@sbcglobal.net to comp.lang.fortran on Sun Oct 13 09:09:22 2024
    From Newsgroup: comp.lang.fortran

    On 10/13/2024 4:52 AM, Thomas Koenig wrote:
    Hello world,

    J3 has passed https://j3-fortran.org/doc/year/24/24-116.txt , a
    proposal for unsigned numbers in Fortran, in their February/March
    meeting.

    Gfortran 15, to be released in the beginning of 2025, will contain
    an experimental implementation of that proposal. The current
    development version already has that documentation, so if you
    are so inclined, you can download and compile it for yourself to
    try it out already.

    This feature can be accessed by using the -funsigned flag.
    Some short documentation can be found at

    https://gcc.gnu.org/onlinedocs/gfortran/Unsigned-integers.html

    Test cases (also doubling as use examples) can be found at https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=gcc/testsuite/gfortran.dg
    (any file that has "unsigned" in its name).

    Bug reports and comments are welcome.

    Enjoy!

    Best regards

    Thomas
    Yay? :) I'm so used to using larger signed integers and various tricks
    that I'll probably never use it, but at least I have the option now.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.lang.fortran on Sun Oct 13 21:04:36 2024
    From Newsgroup: comp.lang.fortran

    On Sun, 13 Oct 2024 09:52:15 -0000 (UTC), Thomas Koenig wrote:

    J3 has passed https://j3-fortran.org/doc/year/24/24-116.txt , a
    proposal for unsigned numbers in Fortran ...

    Do you mean rCLunsigned integersrCY?

    https://gcc.gnu.org/onlinedocs/gfortran/Unsigned-integers.html

    Thought so.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lynn McGuire@lynnmcguire5@gmail.com to comp.lang.fortran on Tue Oct 15 15:26:42 2024
    From Newsgroup: comp.lang.fortran

    On 10/13/2024 4:52 AM, Thomas Koenig wrote:
    Hello world,

    J3 has passed https://j3-fortran.org/doc/year/24/24-116.txt , a
    proposal for unsigned numbers in Fortran, in their February/March
    meeting.

    Gfortran 15, to be released in the beginning of 2025, will contain
    an experimental implementation of that proposal. The current
    development version already has that documentation, so if you
    are so inclined, you can download and compile it for yourself to
    try it out already.

    This feature can be accessed by using the -funsigned flag.
    Some short documentation can be found at

    https://gcc.gnu.org/onlinedocs/gfortran/Unsigned-integers.html

    Test cases (also doubling as use examples) can be found at https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=gcc/testsuite/gfortran.dg
    (any file that has "unsigned" in its name).

    Bug reports and comments are welcome.

    Enjoy!

    Best regards

    Thomas

    Any plans to support UTF16 or UTF8 in gfortran ?

    Thanks,
    Lynn

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Steven G. Kargl@sgk@REMOVEtroutmask.apl.washington.edu to comp.lang.fortran on Tue Oct 15 20:46:59 2024
    From Newsgroup: comp.lang.fortran

    On Tue, 15 Oct 2024 15:26:42 -0500, Lynn McGuire wrote:


    Any plans to support UTF16 or UTF8 in gfortran ?


    gfortran has supported UTF-8 for long time now. Here's
    an example from the manual.


    program character_kind
    use iso_fortran_env
    implicit none
    integer, parameter :: ascii = selected_char_kind ("ascii")
    integer, parameter :: ucs4 = selected_char_kind ('ISO_10646')

    character(kind=ascii, len=26) :: alphabet
    character(kind=ucs4, len=30) :: hello_world

    alphabet = ascii_"abcdefghijklmnopqrstuvwxyz"
    hello_world = ucs4_'Hello World and Ni Hao -- ' &
    // char (int (z'4F60'), ucs4) &
    // char (int (z'597D'), ucs4)

    write (*,*) alphabet

    open (output_unit, encoding='UTF-8')
    write (*,*) trim (hello_world)
    end program character_kind
    --
    steve
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lynn McGuire@lynnmcguire5@gmail.com to comp.lang.fortran on Tue Oct 15 16:51:32 2024
    From Newsgroup: comp.lang.fortran

    On 10/15/2024 3:46 PM, Steven G. Kargl wrote:
    On Tue, 15 Oct 2024 15:26:42 -0500, Lynn McGuire wrote:


    Any plans to support UTF16 or UTF8 in gfortran ?


    gfortran has supported UTF-8 for long time now. Here's
    an example from the manual.


    program character_kind
    use iso_fortran_env
    implicit none
    integer, parameter :: ascii = selected_char_kind ("ascii")
    integer, parameter :: ucs4 = selected_char_kind ('ISO_10646')

    character(kind=ascii, len=26) :: alphabet
    character(kind=ucs4, len=30) :: hello_world

    alphabet = ascii_"abcdefghijklmnopqrstuvwxyz"
    hello_world = ucs4_'Hello World and Ni Hao -- ' &
    // char (int (z'4F60'), ucs4) &
    // char (int (z'597D'), ucs4)

    write (*,*) alphabet

    open (output_unit, encoding='UTF-8')
    write (*,*) trim (hello_world)
    end program character_kind

    Thanks !

    Lynn

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.lang.fortran on Tue Oct 15 22:35:36 2024
    From Newsgroup: comp.lang.fortran

    On Tue, 15 Oct 2024 15:26:42 -0500, Lynn McGuire wrote:

    Any plans to support UTF16 or UTF8 in gfortran ?

    No UTF-16, please!

    That was just a horrible backward-compatibility hack for the sake of those platforms (*cough* Java, Windows NT *cough*) that embraced Unicode as
    their native encoding just a little too soon.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lynn McGuire@lynnmcguire5@gmail.com to comp.lang.fortran on Fri Nov 8 21:00:55 2024
    From Newsgroup: comp.lang.fortran

    On 10/15/2024 5:35 PM, Lawrence D'Oliveiro wrote:
    On Tue, 15 Oct 2024 15:26:42 -0500, Lynn McGuire wrote:

    Any plans to support UTF16 or UTF8 in gfortran ?

    No UTF-16, please!

    That was just a horrible backward-compatibility hack for the sake of those platforms (*cough* Java, Windows NT *cough*) that embraced Unicode as
    their native encoding just a little too soon.

    Aren't all of the Unix and Linux boxen either UTF-16 or UTF-32 ?

    Lynn

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.lang.fortran on Sat Nov 9 04:37:37 2024
    From Newsgroup: comp.lang.fortran

    On Fri, 8 Nov 2024 21:00:55 -0600, Lynn McGuire wrote:

    Aren't all of the Unix and Linux boxen either UTF-16 or UTF-32 ?

    No!
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lynn McGuire@lynnmcguire5@gmail.com to comp.lang.fortran on Fri Nov 8 23:23:56 2024
    From Newsgroup: comp.lang.fortran

    On 11/8/2024 10:37 PM, Lawrence D'Oliveiro wrote:
    On Fri, 8 Nov 2024 21:00:55 -0600, Lynn McGuire wrote:

    Aren't all of the Unix and Linux boxen either UTF-16 or UTF-32 ?

    No!

    A friend of mine was working on a PLC in Japan a couple of decades ago.
    It was very custom Unix and UTF-32. He was shocked. He had several
    problems porting their software to the PLC.

    Lynn

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Thomas Koenig@tkoenig@netcologne.de to comp.lang.fortran on Sat Nov 9 11:57:41 2024
    From Newsgroup: comp.lang.fortran

    Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
    On 10/15/2024 5:35 PM, Lawrence D'Oliveiro wrote:
    On Tue, 15 Oct 2024 15:26:42 -0500, Lynn McGuire wrote:

    Any plans to support UTF16 or UTF8 in gfortran ?

    No UTF-16, please!

    That was just a horrible backward-compatibility hack for the sake of those >> platforms (*cough* Java, Windows NT *cough*) that embraced Unicode as
    their native encoding just a little too soon.

    Aren't all of the Unix and Linux boxen either UTF-16 or UTF-32 ?

    Most certainly not:

    $ echo $LANG
    de_DE.UTF-8

    Haven't seen anything but UTF-8 in a long time.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lynn McGuire@lynnmcguire5@gmail.com to comp.lang.fortran on Fri Nov 22 19:40:19 2024
    From Newsgroup: comp.lang.fortran

    On 11/9/2024 5:57 AM, Thomas Koenig wrote:
    Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
    On 10/15/2024 5:35 PM, Lawrence D'Oliveiro wrote:
    On Tue, 15 Oct 2024 15:26:42 -0500, Lynn McGuire wrote:

    Any plans to support UTF16 or UTF8 in gfortran ?

    No UTF-16, please!

    That was just a horrible backward-compatibility hack for the sake of those >>> platforms (*cough* Java, Windows NT *cough*) that embraced Unicode as
    their native encoding just a little too soon.

    Aren't all of the Unix and Linux boxen either UTF-16 or UTF-32 ?

    Most certainly not:

    $ echo $LANG
    de_DE.UTF-8

    Haven't seen anything but UTF-8 in a long time.

    Come over here to Windows. UTF-16 is the name of the game. It is a
    total pain.

    Microsoft is rumored to be working on a UTF-8 API for Win32 / Win64. I
    will believe it when I see it.

    Lynn

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.lang.fortran on Sat Nov 23 02:08:19 2024
    From Newsgroup: comp.lang.fortran

    On Fri, 22 Nov 2024 19:40:19 -0600, Lynn McGuire wrote:

    Come over here to Windows. UTF-16 is the name of the game. It is a
    total pain.

    Microsoft (and Sun, with Java) adopted Unicode at precisely the wrong
    time, back when everybody believed the Unicode folks who said that it
    would remain a fixed-length 16-bit code.

    Microsoft is rumored to be working on a UTF-8 API for Win32 / Win64. I
    will believe it when I see it.

    Linux simply ignored the issue. Filespecs passed to the kernel are split
    at ASCII rCL/rCY characters and terminated by NUL. And those are the only byte values with special interpretations; file/directory names are free to
    contain anything else. As a result, it works seamlessly with UTF-8.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lynn McGuire@lynnmcguire5@gmail.com to comp.lang.fortran on Fri Nov 22 21:16:19 2024
    From Newsgroup: comp.lang.fortran

    On 11/22/2024 8:08 PM, Lawrence D'Oliveiro wrote:
    On Fri, 22 Nov 2024 19:40:19 -0600, Lynn McGuire wrote:

    Come over here to Windows. UTF-16 is the name of the game. It is a
    total pain.

    Microsoft (and Sun, with Java) adopted Unicode at precisely the wrong
    time, back when everybody believed the Unicode folks who said that it
    would remain a fixed-length 16-bit code.

    Microsoft is rumored to be working on a UTF-8 API for Win32 / Win64. I
    will believe it when I see it.

    Linux simply ignored the issue. Filespecs passed to the kernel are split
    at ASCII rCL/rCY characters and terminated by NUL. And those are the only byte
    values with special interpretations; file/directory names are free to
    contain anything else. As a result, it works seamlessly with UTF-8.

    It was probably an economic decision on Microsoft's part with having to
    ship different versions of DOS and Windows with English, French,
    Russian, Chinese, Japanese, etc, etc, etc back in the 1980s. UTF-8 came
    out in the middle 1990s ??? I suspect that they wanted to ship just one version of Windows, Office, etc and have it automatically acclimate to
    the user's desired main language.

    Several countries mandated that large software shops ship their
    countries native language in their software. France and Quebec were the guiltiest of this. I actually have a French version of Microsoft Office
    95 over in my cabinet.

    Lynn

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Thomas Koenig@tkoenig@netcologne.de to comp.lang.fortran on Sat Nov 23 08:04:06 2024
    From Newsgroup: comp.lang.fortran

    Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
    On 11/9/2024 5:57 AM, Thomas Koenig wrote:
    Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
    On 10/15/2024 5:35 PM, Lawrence D'Oliveiro wrote:
    On Tue, 15 Oct 2024 15:26:42 -0500, Lynn McGuire wrote:

    Any plans to support UTF16 or UTF8 in gfortran ?

    No UTF-16, please!

    That was just a horrible backward-compatibility hack for the sake of those >>>> platforms (*cough* Java, Windows NT *cough*) that embraced Unicode as
    their native encoding just a little too soon.

    Aren't all of the Unix and Linux boxen either UTF-16 or UTF-32 ?

    Most certainly not:

    $ echo $LANG
    de_DE.UTF-8

    Haven't seen anything but UTF-8 in a long time.

    Come over here to Windows.

    I should have qualified that with "on Linux".

    UTF-16 is the name of the game. It is a
    total pain.

    I can well believe that.

    At least Fortran has standard methods of using UTF-8.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Wolfgang Agnes@wagnes@example.com to comp.lang.fortran on Sat Nov 23 09:18:11 2024
    From Newsgroup: comp.lang.fortran

    Lynn McGuire <lynnmcguire5@gmail.com> writes:

    On 11/9/2024 5:57 AM, Thomas Koenig wrote:

    [...]

    Most certainly not:
    $ echo $LANG
    de_DE.UTF-8
    Haven't seen anything but UTF-8 in a long time.

    Come over here to Windows. UTF-16 is the name of the game. It is a
    total pain.

    How about UCS-2? Have you seen it? I find UCS-2 when I use
    write-sequence from Common Lisp on the Windows Console.

    Microsoft is rumored to be working on a UTF-8 API for Win32 / Win64.
    I will believe it when I see it.

    Same here.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.lang.fortran on Sat Nov 23 22:09:39 2024
    From Newsgroup: comp.lang.fortran

    On Sat, 23 Nov 2024 09:18:11 -0300, Wolfgang Agnes wrote:

    How about UCS-2?

    rCLUCS-2rCY was the name of the encoding back when it was assumed that Unicode was always going to be just 16 bits. After the coding was extended, those rCLsurrogaterCY ranges were introduced, to allow representation of the extra characters within a 16-bit encoding, and so rCLUCS-2rCY was renamed to rCLUTF-16rCY.

    In short, rCLUTF-16rCY is basically rCLUCS-2 with surrogatesrCY.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Wolfgang Agnes@wagnes@example.com to comp.lang.fortran on Mon Nov 25 08:35:48 2024
    From Newsgroup: comp.lang.fortran

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 23 Nov 2024 09:18:11 -0300, Wolfgang Agnes wrote:

    How about UCS-2?

    rCLUCS-2rCY was the name of the encoding back when it was assumed that Unicode
    was always going to be just 16 bits. After the coding was extended, those rCLsurrogaterCY ranges were introduced, to allow representation of the extra characters within a 16-bit encoding, and so rCLUCS-2rCY was renamed to rCLUTF-16rCY.

    In short, rCLUTF-16rCY is basically rCLUCS-2 with surrogatesrCY.

    Nice to know! Thanks. So, UCS means ``Universal Character Set''. I
    thought it was a whole different character set. It's a bit difficult to understand ``surrogates''. So many definitions come up such as ``Basic Multilingual Plane''. Can you explain what surrogates are?
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lynn McGuire@lynnmcguire5@gmail.com to comp.lang.fortran on Mon Nov 25 14:39:37 2024
    From Newsgroup: comp.lang.fortran

    On 11/25/2024 5:35 AM, Wolfgang Agnes wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 23 Nov 2024 09:18:11 -0300, Wolfgang Agnes wrote:

    How about UCS-2?

    rCLUCS-2rCY was the name of the encoding back when it was assumed that Unicode
    was always going to be just 16 bits. After the coding was extended, those
    rCLsurrogaterCY ranges were introduced, to allow representation of the extra >> characters within a 16-bit encoding, and so rCLUCS-2rCY was renamed to
    rCLUTF-16rCY.

    In short, rCLUTF-16rCY is basically rCLUCS-2 with surrogatesrCY.

    Nice to know! Thanks. So, UCS means ``Universal Character Set''. I
    thought it was a whole different character set. It's a bit difficult to understand ``surrogates''. So many definitions come up such as ``Basic Multilingual Plane''. Can you explain what surrogates are?

    There is lots of information at
    https://home.unicode.org/

    And
    https://stackoverflow.com/

    Lynn

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.lang.fortran on Mon Nov 25 23:35:34 2024
    From Newsgroup: comp.lang.fortran

    On Mon, 25 Nov 2024 08:35:48 -0300, Wolfgang Agnes wrote:

    It's a bit difficult to understand ``surrogates''.

    The Unicode folks just decided that the ranges 0xD800-0xDBFF (1024 codes
    of rCLhigh surrogatesrCY) and 0xDC00-0xDFFF (1024 codes of rCLlow surrogatesrCY)
    would be used in pairs to represent codes above 0xFFFF in UTF-16 encoding. This gives an additional 1024|u1024 = 1048576 different codes, which should
    be enough to cover the entire (current) Unicode range, which officially
    goes up to 0x10FFFF. At least, thatrCOs what theyrCOre saying right now.

    In the full UCS-4 encoding, those ranges are considered invalid.
    --- Synchronet 3.21d-Linux NewsLink 1.2