Discussion:
Extensions for Forth files.
(too old to reply)
a***@spenarnc.xs4all.nl
2024-06-04 13:32:10 UTC
Permalink
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 -
PMF
2024-06-04 13:52:06 UTC
Permalink
..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 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.

BR
Peter
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
Anton Ertl
2024-06-04 16:38:11 UTC
Permalink
Post by PMF
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
LIT
2024-06-04 14:15:41 UTC
Permalink
Post by a***@spenarnc.xs4all.nl
For Forth we've seen: .f .F .frt .FRT .fth .4th .fs
Are there more?
I'd like to see an official extension.
To me .4th sounds good -- but actually I see this as
quite minor thing.
Post by a***@spenarnc.xs4all.nl
This would help with uniformization of the Forth language
"Uniformized Forth" would mean "crippled Forth".

The whole point is that, after one becomes acquainted
with internals of the Forth compiler, one can sport one's
own compiler, that doesn't have to conform to any supposed
"standard". Everything it has to -- is to allow get the
job done.

A good example would be that "Machine Forth" story,
described by Jeff Fox on his UT Web pages.
dxf
2024-06-05 06:03:50 UTC
Permalink
Post by LIT
Post by a***@spenarnc.xs4all.nl
For Forth we've seen: .f .F .frt .FRT .fth .4th .fs
Are there more?
I'd like to see an official extension.
To me .4th sounds good -- but actually I see this as
quite minor thing.
Post by a***@spenarnc.xs4all.nl
This would help with uniformization of the Forth language
"Uniformized Forth" would mean "crippled Forth".
The whole point is that, after one becomes acquainted
with internals of the Forth compiler, one can sport one's
own compiler, that doesn't have to conform to any supposed
"standard". Everything it has to -- is to allow get the
job done.
A good example would be that "Machine Forth" story,
described by Jeff Fox on his UT Web pages.
'Standard Forth is regarded by the common people as true, by the
wise as false, and by the rulers as useful.'
LIT
2024-06-05 08:30:37 UTC
Permalink
Post by dxf
'Standard Forth is regarded by the common people as true, by the
wise as false, and by the rulers as useful.'
Leo Brodie should add the above to the set of sentences
in "Thinking Forth". :D
Anton Ertl
2024-06-04 16:11:45 UTC
Permalink
Post by a***@spenarnc.xs4all.nl
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
<***@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.
Post by a***@spenarnc.xs4all.nl
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?
Post by a***@spenarnc.xs4all.nl
gforth also uses .fs for non forth files,
Examples?
Post by a***@spenarnc.xs4all.nl
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
dxf
2024-06-05 02:45:00 UTC
Permalink
Post by Anton Ertl
Post by a***@spenarnc.xs4all.nl
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.
Anton Ertl
2024-06-05 10:17:04 UTC
Permalink
Post by dxf
Post by Anton Ertl
Post by a***@spenarnc.xs4all.nl
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
dxf
2024-06-05 11:52:33 UTC
Permalink
Post by Anton Ertl
Post by dxf
Post by Anton Ertl
Post by a***@spenarnc.xs4all.nl
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.
a***@spenarnc.xs4all.nl
2024-06-05 13:02:32 UTC
Permalink
Post by dxf
Post by Anton Ertl
Post by dxf
Post by Anton Ertl
Post by a***@spenarnc.xs4all.nl
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 -
LIT
2024-06-05 13:13:14 UTC
Permalink
Post by a***@spenarnc.xs4all.nl
Delivering syntax coloring to editors could be the next step.
Forth actually has no syntax...
John Ames
2024-06-05 14:51:01 UTC
Permalink
On Wed, 5 Jun 2024 13:13:14 +0000
Post by LIT
Post by a***@spenarnc.xs4all.nl
Delivering syntax coloring to editors could be the next step.
Forth actually has no syntax...
Sure it does! There's, um, words and numbers...
LIT
2024-06-05 15:13:10 UTC
Permalink
Post by John Ames
Post by LIT
Post by a***@spenarnc.xs4all.nl
Delivering syntax coloring to editors could be the next step.
Forth actually has no syntax...
Sure it does! There's, um, words and numbers...
Then what colouring scheme we're going to establish?
Words as 'normal' and numbers as 'intense' -- or the
other way around?
John Ames
2024-06-05 15:29:32 UTC
Permalink
On Wed, 5 Jun 2024 15:13:10 +0000
Post by LIT
Post by John Ames
Post by LIT
Post by a***@spenarnc.xs4all.nl
Delivering syntax coloring to editors could be the next step.
Forth actually has no syntax...
Sure it does! There's, um, words and numbers...
Then what colouring scheme we're going to establish?
Words as 'normal' and numbers as 'intense' -- or the
other way around?
Whatever it is, it has to have a "dark" mode.
Ahmed
2024-06-05 15:38:35 UTC
Permalink
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
Kerr-Mudd, John
2024-06-05 20:26:24 UTC
Permalink
On Wed, 5 Jun 2024 15:38:35 +0000
Post by Ahmed
Hi,
I sometimes use notepad++ and there is highlighting for gforth .fs
scripts.
: do-it ( doing test ) 10 0 do cr i . 2 spaces ." It is done!" loop ; \
and that works
: 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)
Post by Ahmed
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.
Ahmed
2024-06-05 20:55:09 UTC
Permalink
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
a***@spenarnc.xs4all.nl
2024-06-05 15:45:26 UTC
Permalink
Post by LIT
Post by a***@spenarnc.xs4all.nl
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 -
dxf
2024-06-06 01:43:13 UTC
Permalink
Post by a***@spenarnc.xs4all.nl
Post by dxf
Post by Anton Ertl
Post by dxf
Post by Anton Ertl
Post by a***@spenarnc.xs4all.nl
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
How is that different from a MAKE.BAT under DOS/Windows? ISTM .4th is a
solution looking for a problem. Given nobody else appears to be using it,
none has been found?
Anton Ertl
2024-06-06 05:49:45 UTC
Permalink
Post by dxf
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
dxf
2024-06-07 02:53:02 UTC
Permalink
Post by Anton Ertl
Post by dxf
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
$(buildccdir)/libgf%.la: unix/%.fs $(FORTH_GEN_LIGHT) $(GEN) $(LIBCC_LIB_SRC) libforth
@echo LIBFORTH $<
-./libforth $(package)$(libccdir) $< -e bye
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.
So that's a yes - you don't have any problem that .4TH would fix. Like the Forth
Standard it was a nice idea but everyone has gone their own way and changing now
would create problems for not much gain.

Anton Ertl
2024-06-06 06:16:46 UTC
Permalink
Post by a***@spenarnc.xs4all.nl
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.
Post by a***@spenarnc.xs4all.nl
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 <***@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
a***@spenarnc.xs4all.nl
2024-06-06 11:31:32 UTC
Permalink
Post by Anton Ertl
Post by a***@spenarnc.xs4all.nl
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>
Post by Anton Ertl
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>
Post by Anton Ertl
- 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 -
Anton Ertl
2024-06-06 12:17:15 UTC
Permalink
Post by a***@spenarnc.xs4all.nl
Post by Anton Ertl
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.
Post by a***@spenarnc.xs4all.nl
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
Ahmed
2024-06-06 13:17:58 UTC
Permalink
and
fs for F# files

Ahmed
a***@spenarnc.xs4all.nl
2024-06-05 10:24:20 UTC
Permalink
Post by Anton Ertl
Post by a***@spenarnc.xs4all.nl
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
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>
Post by Anton Ertl
Including foo.4th
hi
bye
Post by a***@spenarnc.xs4all.nl
gforth also uses .fs for non forth files,
Examples?
Post by a***@spenarnc.xs4all.nl
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 )
Post by Anton Ertl
- 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 -
Anton Ertl
2024-06-05 12:24:37 UTC
Permalink
Post by a***@spenarnc.xs4all.nl
Post by Anton Ertl
At the 2015 Forth200x meeting we decided on ".4th", and that has been
added to the extensions that VFX knows about
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 ?
We have put it in Gforth's start-gforth.el, which will autoload
gforth.el when encountering a program with the extension ".4th".

If you want to have a GNU make default rule that involves .4th, I
would add a wishlist item to the GNU make bugtracker. But what would
such a rule do?
Post by a***@spenarnc.xs4all.nl
Is it possible that .fs are actually forth source files, that
can only be interpreted by gforth?
.fs and .4th are for the same kinds of files: Forth source files.
Whether they work on one system or several is not encoded in the
extension.
Post by a***@spenarnc.xs4all.nl
Why then change the extension?
Which change?
Post by a***@spenarnc.xs4all.nl
(A proper script file has extension .sh and start with e.g.
#!/usr/bin/lina )
When people write shell scripts, some that love file extensions use
the extension .sh for those scripts. I normally don't use an
extension for shell scripts. When I put

#!/bin/bash

at the start of such a script, Emacs knows automatically that this is
a bash script. For scripts written in Forth I naturally use one of
the extensions where Emacs then knows that it is a Forth source file,
such as ".fs" or ".4th". I don't see a reason why a Forth script
should use the extension ".sh", but it's a free world.

I just tested what happens when I write a Forth source file called
zzz.sh that starts with

#! /usr/bin/gforth

When I visit the file in Emacs, I geht the mode
"Shell-script[gforth]", but that mode does not know anything about
Gforth (or Forth in general), and Emacs does not use the Forth mode
that it uses when the extension is .4th.

- 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
sjack
2024-06-07 00:08:25 UTC
Permalink
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
Loading...