I have seen people save Forth source code files with the extensions .4th
, .fth
, .frt
and .f
. Which is the most common filename extension of Forth source code files?
I searched for various file extension on GitHub (plus "dup drop swap"), and this was the result:
- .fs 4783 hits
- .fth 1144
- .4th 509
- .f 398
- .fr 143
- .4 55
- .frt 46
- .scr 30
- .forth 20
- .ft 11
- .fb 4
- .blk 2
- .seq 1
- .ans 1
- .for 1
- .fo 0
If nothing else, this shows there are many file extensions to chose from.
.fs
is a FORTH screen file (not really text, a sequence of 16 line 64 character "screens") –
Ible .fs
- F#, .fth
- FileMaker theme, .f
and .for
- Fortran. The most popular non- conflicting extension listed is .4th
. The most obvious extension would be .forth
, but I guess Forth is still often used with file systems requiring a 3-character extension and .4th
would fit that criterion as well. –
Seward Inspired by Lars Brinkhoff's answer, I ran some queries myself on GitHub to find out how the various extension names are used between various languages (not just Forth). For each extension in the list below, only the top 3 languages with the highest number of results are shown:
.fs
.fth
- Forth - 10119
.f
- Fortran - 2192549
- Forth - 7725
- Filebench WML - 5946
.4th
.frt
- Forth - 1950
.fr
.forth
- Forth - 344
.for
.ft
The results above were obtained on 13 May 2021 at 15:30 UTC.
Note: GitHub sometimes detects the wrong language for source code files. The above queries attempt to reduce the impact of such errors on the results above but they aren't perfect.
Conclusions:
- The most popular extension for Forth source code appears to be
.fs
but the extension.fs
is most often used for F#. In fact there are about twice as many F# source code files with this extension as there are for Forth. - The most popular extension for Forth source code that does not appear to be used for any other language is
.fth
. - The extensions
.4th
,.frt
, and.forth
also do not appear to be used for any other language, however, these extensions are less popular than.fth
.
Gforth advocates .fs in its documentation, which is a pretty good standard for such things.
.fs
, and F# is unfortunately more common now. It may be better to use .fth
to clearly distinguish Forth files from F# files. –
Knopp © 2022 - 2024 — McMap. All rights reserved.
.4th
? – Schwerin