What is the most common filename extension of a Forth source code file?
Asked Answered
S

3

15

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?

Spelling answered 15/8, 2013 at 5:18 Comment(2)
Wouldn't the obvious one be .4th?Schwerin
@Schwerin No. Hence the question.Spelling
C
18

I searched for various file extension on GitHub (plus "dup drop swap"), and this was the result:

  1. .fs 4783 hits
  2. .fth 1144
  3. .4th 509
  4. .f 398
  5. .fr 143
  6. .4 55
  7. .frt 46
  8. .scr 30
  9. .forth 20
  10. .ft 11
  11. .fb 4
  12. .blk 2
  13. .seq 1
  14. .ans 1
  15. .for 1
  16. .fo 0

If nothing else, this shows there are many file extensions to chose from.

Cassandracassandre answered 18/8, 2013 at 19:51 Comment(3)
Today "dup drop swap in:file extension:fs" = 31 376 and "dup drop swap in:file extension:txt" = 17783 and .fth = 6086 - c:Freudian
Be careful , some use the convention that .fsis a FORTH screen file (not really text, a sequence of 16 line 64 character "screens")Ible
Conflicts: .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
R
8

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:

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.
Randallrandan answered 13/5, 2021 at 13:49 Comment(0)
S
4

Gforth advocates .fs in its documentation, which is a pretty good standard for such things.

Spotless answered 16/8, 2013 at 20:14 Comment(4)
What does the "FS" stand for?Froh
@ArtB It is only a guess, but perhaps it stands for "Forth Script".Spotless
But F# uses .fs, and F# is unfortunately more common now. It may be better to use .fth to clearly distinguish Forth files from F# files.Knopp
"Forth script" or "Forth source" (also guesses)Seward

© 2022 - 2024 — McMap. All rights reserved.