• 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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 “unsigned integers”?

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

    Thought so.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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.20a-Linux NewsLink 1.114
  • 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 “/” 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.20a-Linux NewsLink 1.114
  • 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 “/” 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.20a-Linux NewsLink 1.114