• Extensions for Forth files.

    From albert@spenarnc.xs4all.nl@21:1/5 to All on Tue Jun 4 15:32:10 2024
    The official extension known to a linux system (make) are:

    .out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S .mod
    .sym .def .h .info .dvi .tex .texinfo .texi .txinfo .w .ch .web .sh
    .elc .el .out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s
    .S .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo .w .ch
    .web .sh .elc .el

    There is no extension for Forth files. Moreover .f .F have been taken
    for FORTRAN.
    Note that there is no extension for Python. Apparently if you have given
    up compiling to executables, you don't register with make. All the same
    there is a de facto extension for Python that is py and half-compiled .pyc.

    For Forth we've seen: .f .F .frt .FRT .fth .4th .fs
    Are there more?

    I'd like to see an official extension. This would help with uniformization
    of the Forth language and finding forth sources on the web.
    For example build in rules to go from a source
    to an executable, or syntax coloring in editors.

    The gforth authors have the most influence in GNU linux. Unfortunately
    they seem to use the .f suffix exclusively. Would they push for an
    official extension?
    gforth also uses .fs for non forth files, scripts, while others use it
    for plain Forth files.

    Groetjes Albert
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat purring. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to PMF on Tue Jun 4 16:38:11 2024
    peter.m.falth@gmail.com (PMF) writes:
    I have always used .4
    I must have picked this up over 30 years ago. I do not remember where.
    I like it. It is short and different.

    locate \*.4|wc -l

    reports 3912 file names that end in .4 (and very few of them are Forth
    files). Most are file names with version numbers that end in .4, some
    of them .so*.4 files, others are directories. There are also man
    pages from section 4 that end in .4.

    .4th is a little longer, but of the 903 files on my system all are
    Forth files as far as I can see; so it's really different.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2023: https://euro.theforth.net/2023

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to albert@spenarnc.xs4all.nl on Tue Jun 4 16:11:45 2024
    albert@spenarnc.xs4all.nl writes:
    For Forth we've seen: .f .F .frt .FRT .fth .4th .fs
    Are there more?

    I'd like to see an official extension.

    At the 2015 Forth200x meeting we decided on ".4th", and that has been
    added to the extensions that VFX knows about <2016Mar29.122333@mips.complang.tuwien.ac.at>. And indeed:

    [/tmp:149794] echo 'cr .( hi) cr' >foo.4th
    [/tmp:149795] vfx64 "include foo"
    VFX Forth 64 5.43 [build 0199] 2023-11-09 for Linux x64
    © MicroProcessor Engineering Ltd, 1998-2023

    Including foo.4th
    hi

    bye

    It does not work for sf64, while "include f" works for foo.f.

    Gforth does not know anything about extensions, so you always have to
    mention the extension explicitly.

    theforth.net requires the metadata in package.4th.

    The gforth authors have the most influence in GNU linux. Unfortunately
    they seem to use the .f suffix exclusively.

    What makes you think so? Why would Gforth contain Fortran programs?

    gforth also uses .fs for non forth files,

    Examples?

    scripts

    Sure, why not.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2023: https://euro.theforth.net/2023

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to dxf on Wed Jun 5 10:17:04 2024
    dxf <dxforth@gmail.com> writes:
    On 5/06/2024 2:11 am, Anton Ertl wrote:
    albert@spenarnc.xs4all.nl writes:
    For Forth we've seen: .f .F .frt .FRT .fth .4th .fs
    Are there more?

    I'd like to see an official extension.

    At the 2015 Forth200x meeting we decided on ".4th", and that has been
    added to the extensions that VFX knows about

    The question surely is whether VFX uses it. AFAICS it continues
    to use .fth for all its source files.

    [/usr/local/src/VfxForth64Lin-5.43:149811] find . -name \*.4th|wc -l
    4
    [/usr/local/src/VfxForth64Lin-5.43:149812] find . -name \*.fth|wc -l
    275

    But no, that was not the question. The question was about an
    "official" extension, and as far as the Forth200x committee is
    concerned, .4th is the official extension. Of course that does not
    mean that other extensions are forbidden. And actually the standard
    document does not mention extensions at all.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2023: https://euro.theforth.net/2023

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to Anton Ertl on Wed Jun 5 12:24:20 2024
    In article <2024Jun4.181145@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    albert@spenarnc.xs4all.nl writes:
    For Forth we've seen: .f .F .frt .FRT .fth .4th .fs
    Are there more?

    I'd like to see an official extension.

    At the 2015 Forth200x meeting we decided on ".4th", and that has been
    added to the extensions that VFX knows about ><2016Mar29.122333@mips.complang.tuwien.ac.at>. And indeed:

    I wasn't aware of that this decision. Are there any influentual
    people (GNU;s, professors) that could promote this extension with
    distribution, in particular make ?

    <SNIP>
    Including foo.4th
    hi

    bye
    gforth also uses .fs for non forth files,

    Examples?

    scripts

    Sure, why not.

    This reaction puzzles me.
    Is it possible that .fs are actually forth source files, that
    can only be interpreted by gforth? Why then change the extension?

    (A proper script file has extension .sh and start with e.g.
    #!/usr/bin/lina )

    - anton

    Groetjes Albert
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat purring. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to dxforth@gmail.com on Wed Jun 5 15:02:32 2024
    In article <66605182$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 5/06/2024 8:17 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    On 5/06/2024 2:11 am, Anton Ertl wrote:
    albert@spenarnc.xs4all.nl writes:
    For Forth we've seen: .f .F .frt .FRT .fth .4th .fs
    Are there more?

    I'd like to see an official extension.

    At the 2015 Forth200x meeting we decided on ".4th", and that has been
    added to the extensions that VFX knows about

    The question surely is whether VFX uses it. AFAICS it continues
    to use .fth for all its source files.

    [/usr/local/src/VfxForth64Lin-5.43:149811] find . -name \*.4th|wc -l
    4
    [/usr/local/src/VfxForth64Lin-5.43:149812] find . -name \*.fth|wc -l
    275

    But no, that was not the question. The question was about an
    "official" extension, and as far as the Forth200x committee is
    concerned, .4th is the official extension. Of course that does not
    mean that other extensions are forbidden. And actually the standard
    document does not mention extensions at all.

    Well that makes it ok then. The Forth200x committee has nominated
    an "official extension" that's little more than a flag users can
    wave about when they feel like it.

    It could be much more. If lina is the official Forth compiler installed
    and you have hello.4th
    you could say
    make hello
    That would be similar as having hello.c and saying
    make hello

    Delivering syntax coloring to editors could be the next step.

    Groetjes Albert




    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat purring. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to LIT on Wed Jun 5 17:45:26 2024
    In article <1bccca9c48450daa05a878c4c84e72de@www.novabbs.com>,
    LIT <zbigniew2011@gmail.com> wrote:
    Delivering syntax coloring to editors could be the next step.

    Forth actually has no syntax...

    Good point. Coloring is still useful. https://home.hccnet.nl/a.w.m.van.der.horst/forthlectureE.html

    Groetjes Albert
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat purring. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ahmed@21:1/5 to All on Wed Jun 5 15:38:35 2024
    Hi,
    I sometimes use notepad++ and there is highlighting for gforth .fs
    scripts.
    It works like this:

    for example:
    : do-it ( doing test ) 10 0 do cr i . 2 spaces ." It is done!" loop ; \
    and that works

    is colored as follows:

    : do-it ---red
    ( doing test ) ---green
    10 0 ---light blue
    do cr i . ---black
    2 ---light blue
    spaces ---black
    " It is done!" ---orange
    loop ---black
    ; ---red
    \ that works ---green


    : go { a b -- } a b + . ;

    { a b -- } ---blue

    and : A B C D E F a b c d e f --- in light blue (but when used with
    G...Z g...z it is in black)
    G ...Z g ...z --- in black

    I don't know how it is configured to do this.

    Ahmed

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ahmed@21:1/5 to All on Wed Jun 5 20:55:09 2024
    Under windows, I found these two xml files: langs.xml and stylers.xml
    located in the "AppData\Roaming\Notepad++" dirctory.

    The first contains the languages and their keywords.
    the second contains the correspondant styles (colors,...).

    and the language forth is considered in these two files.

    Ahmed

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd, John@21:1/5 to Ahmed on Wed Jun 5 21:26:24 2024
    On Wed, 5 Jun 2024 15:38:35 +0000
    melahi_ahmed@yahoo.fr (Ahmed) wrote:

    Hi,
    I sometimes use notepad++ and there is highlighting for gforth .fs
    scripts.
    It works like this:

    for example:
    : do-it ( doing test ) 10 0 do cr i . 2 spaces ." It is done!" loop ; \
    and that works

    is colored as follows:

    : do-it ---red
    ( doing test ) ---green
    10 0 ---light blue
    do cr i . ---black
    2 ---light blue
    spaces ---black
    " It is done!" ---orange
    loop ---black
    ; ---red
    \ that works ---green


    : go { a b -- } a b + . ;

    { a b -- } ---blue

    and : A B C D E F a b c d e f --- in light blue (but when used with

    (identified as hex,chars, and coloured same as numeric 0-9, I'd imagine)

    G...Z g...z it is in black)
    G ...Z g ...z --- in black

    I don't know how it is configured to do this.

    Language, User-defined , erm dont know after that

    I'm more of a Notepad2 user. (View Customise Schemes ..)

    --
    Bah, and indeed Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to dxf on Thu Jun 6 05:49:45 2024
    dxf <dxforth@gmail.com> writes:
    ISTM .4th is a
    solution looking for a problem. Given nobody else appears to be using it, >none has been found?

    File extensions are used by various tools for recognizing whether a
    file contains Forth source code, most notably editors, but also
    Makefiles and line-counting tools. Some Forth systems try to use file extensions for including files (e.g., VFX tries .4th (and probably
    also .fth), and SwiftForth tries .f), so you don't have to write the
    file extension when using INCLUDE or REQUIRE.

    Concerning Makefiles, I find several occurences of "%.fs" (where "5"
    is a placeholder for a specific name) in Gforth's Makefile, among them
    this rule:

    $(buildccdir)/libgf%.la: unix/%.fs $(FORTH_GEN_LIGHT) $(GEN) $(LIBCC_LIB_SRC) libforth
    @echo LIBFORTH $<
    -./libforth $(package)$(libccdir) $< -e bye
    -$(TOUCH) $@

    Here unix/%.fs is a file containing Forth code that describes the
    interface to C library code, and $(buildccdir)/libgf%.la is the file
    that describes the corresponding binary files for libtool dynamic
    linking.

    Why %.fs and not %.4th? We started with this stuff before the decision
    on .4th as common extension, and renaming the interface files would
    break code that includes them.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2023: https://euro.theforth.net/2023

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to albert@spenarnc.xs4all.nl on Thu Jun 6 06:16:46 2024
    albert@spenarnc.xs4all.nl writes:
    It could be much more. If lina is the official Forth compiler installed
    and you have hello.4th
    you could say
    make hello
    That would be similar as having hello.c and saying
    make hello

    What do you mean with "official Forth compiler installed"? In order
    for something like this to work, Forth systems would also need to
    agree on a common OS-command-line interface.

    Delivering syntax coloring to editors could be the next step.

    Various editors have had syntax highlighting for Forth code for many
    years. I use emacs, and gforth.el's Forth mode (based on Goran
    Rydqvist's forth.el) has had syntax highlighting for a long time; here
    we have it:

    |commit a0117f0158a4cb57bcd61c03cd3285508cae229c
    |Author: Bernd Paysan <bernd.paysan@gmx.de>
    |Date: Sat Mar 18 21:27:38 2000 +0000
    |
    | Added syntax highlighting for Forth (not perfect yet)

    When my students present their programs, they usually use code (the
    one by MS) or vim, and both have syntax highlighting for Forth; in
    some cases the syntax highlighting seems to be for a different
    language, though. I guess this is the use of file extensions with the
    highest impact in practice. So what file extensions do the editors
    use?

    When you have the development version of Gforth installed, you get:

    emacs: .fs .fth .4th .fb (where .fb is for block files)

    I leave it to other participants to list the extensions that turn on
    Forth syntax highlighting for their favourite editor.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2023: https://euro.theforth.net/2023

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to Anton Ertl on Thu Jun 6 13:31:32 2024
    In article <2024Jun6.081646@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    albert@spenarnc.xs4all.nl writes:
    It could be much more. If lina is the official Forth compiler installed
    and you have hello.4th
    you could say
    make hello
    That would be similar as having hello.c and saying
    make hello

    What do you mean with "official Forth compiler installed"? In order
    for something like this to work, Forth systems would also need to
    agree on a common OS-command-line interface.

    An additional benefit, yes.

    <SNIP>

    When you have the development version of Gforth installed, you get:

    emacs: .fs .fth .4th .fb (where .fb is for block files)

    Nice. I see that you refrain from using the .f extension lest
    emacs think you are using FORTRAN.

    Reminds me that it is common to use .blk for block files.

    <SNIP>


    - anton
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat purring. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to albert@spenarnc.xs4all.nl on Thu Jun 6 12:17:15 2024
    albert@spenarnc.xs4all.nl writes:
    In article <2024Jun6.081646@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    When you have the development version of Gforth installed, you get:

    emacs: .fs .fth .4th .fb (where .fb is for block files)

    Nice. I see that you refrain from using the .f extension lest
    emacs think you are using FORTRAN.

    Yes, we also don't use .f, but we also don't add it to the list as
    indication for Forth mode, because that would conflict with the
    existing use for Fortran. I don't know exactly what would happen, but
    one of the possible outcomes would be that someone wants to edit a
    Fortran file with the extension .f, and gets Forth mode instead of
    Fortran mode. I think that would lead to complaints about Gforth's
    installer sooner or later.

    Reminds me that it is common to use .blk for block files.

    Various file-extension web sites list lots of file types that use
    .blk, but I have not seen Forth block files there. .fb also has some
    other uses, so it's not ideal. But then, who cares about Forth block
    files nowadays? Probably not even those who think that any agreement
    is a loss of freedom, because those tend not to use the rigid imposed
    structure of a file system in the first place.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2023: https://euro.theforth.net/2023

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ahmed@21:1/5 to All on Thu Jun 6 13:17:58 2024
    and
    fs for F# files

    Ahmed

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From sjack@21:1/5 to albert@spenarnc.xs4all.nl on Fri Jun 7 00:08:25 2024
    albert@spenarnc.xs4all.nl wrote:
    The official extension known to a linux system (make) are:

    I use make to assemble my assembly level portion of Forth which
    files have the known .s file-type. I also use make to build
    extended Forths with file-types .f .fb etc. that it doesn't need
    to know as the file parts and paths are provided in variables that
    it happily processes.

    My extensions:
    s assembly source (Linux convention)
    sh shell program (Linux convention)
    fs Forth system source
    The few extensions to the assembled code to give the
    Forth its character (e.g turns FIG into a TOAD)
    f General Forth extensions (of the character type).
    fb Block file source
    Main block file library
    scr block file
    Legacy block files
    pac pack files (sequence file conversion of a block file)
    d document (mime type: text/x-rsml)
    rcd record file (mime type: text/x-rsml, Record simple markup)


    Note:
    Linux provides various dot files for user to use his own
    file-type mappings that overrides (registered) defaults.

    In .vim for color syntax I have the following set
    for Forth: .f .fs .fb .seq .4th .fth
    I don't use FORTRAN so no conflict but wouldn't have one if I did.
    Magic and mime can be used in manner to bypass file extension.

    In .mimi.types I only needed settings for: .fb .scr

    In lessfilter only: .fb .scr
    (This is nice, any block file of .fb or .scr is auto-converted, using
    dd, for display as a sequence file.)

    I still use the .sh for shell scripts even though it doesn't
    distinguish between Dash and Bash (which one is being used sometimes
    makes a difference, but I somehow get around it.)

    My Forths are in constant flux (shifting sands). I haven't updated
    color syntax in a decade. What's there or not doesn't bother me.

    A thought: If a standard set of extensions become a reality,
    just soft link all the legacy files.

    --
    me

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