News for hackers. Stuff that matters.
Re:`tar` creator/extractor in ~100 lines of Prolog by d33 on Wednesday January 18, 2023 @11:34AM (#34428937)
Just curious, is .pl the standard extension for Prolog programs? Why would Perl and Prolog choose the same one, instead of one using e.g. .pg?
Re:`tar` creator/extractor in ~100 lines of Prolog by Tomte on Wednesday January 18, 2023 @11:38AM (#34428992)
Probably because few people used both.

.pro is also common for Prolog code, if you care about the extension clash.

Re:`tar` creator/extractor in ~100 lines of Prolog by DonHopkins on Wednesday January 18, 2023 @01:06PM (#34430418)
Because .log was taken.
Re:`tar` creator/extractor in ~100 lines of Prolog by tmtvl on Wednesday January 18, 2023 @05:31PM (#34434066)
.pro is also used by IDL and Qt. I imagine there are few two or three letter extensions that aren't overloaded.
Re:`tar` creator/extractor in ~100 lines of Prolog by davelee on Wednesday January 18, 2023 @11:37AM (#34428982)
A less common extension is .pro.
Re:`tar` creator/extractor in ~100 lines of Prolog by civopsec on Wednesday January 18, 2023 @01:06PM (#34430424)
> instead of one using e.g. .pg?

Why not just `.prolog`? In this day and age. (Maybe there’s some reason like “then I can’t put these source files on FAT filesystems”, I don’t know.)

Java seems to do fine with it’s longer-than-three-letters `.java`.

Re:`tar` creator/extractor in ~100 lines of Prolog by Avshalom on Wednesday January 18, 2023 @01:13PM (#34430520)
Most editors will understand .prolog, but on the other hand it's 15 years older than perl and it's not hard to teach editors to treat .pl as prolog.
Re:`tar` creator/extractor in ~100 lines of Prolog by anon291 on Wednesday January 18, 2023 @04:27PM (#34433341)
.pl is used because prolog is really old and FAT used to enforce extension limits. Not relevant nowadays, but it's stuck around.
Re:`tar` creator/extractor in ~100 lines of Prolog by pjmlp on Thursday January 19, 2023 @01:55AM (#34437458)
FAT is 8 + 3, so it still had space for .pro as well.
Re:`tar` creator/extractor in ~100 lines of Prolog by infradig on Thursday January 19, 2023 @02:21AM (#34437600)
Prolog is older than Perl. Perl usurped the .pl extension. Some are trying to claim it back.
Re:`tar` creator/extractor in ~100 lines of Prolog by eesmith on Friday January 20, 2023 @05:44AM (#34451227)
Yes, it looks like modern Prolog systems using ".pl". I checked Ciao, GNU Prolog (which recognizes ".pl" and ".pro"), SICStus Prolog (also ".pl" and .pro"), SWI-Prolog, and B-Prolog.

The documentation for SWI-Prolog 5.10 (2010) even says "Tradition calls for .pl, but conflicts with Perl force the use of another extension on systems where extensions have global meaning, such as MS-Windows. On such systems .pro is the common alternative." https://www.swi-prolog.org/download/stable/doc/SWI-Prolog-5.....

Thing is, I can't confirm that tradition predates Perl 4 - call it 1993.

Turbo Prolog used ".pro" in the late 1980s - https://archive.org/details/bitsavers_borlandturOwnersHandbo... .

So did Prolog-2, according to the 1990 book at https://archive.org/details/advancedlogicpro0000unse/page/80... .

VPI Prolog from 1991 has an '".hc" file name extension (which stands for Horn Clause, the logic upon which the PROLOG language is based).'.

I even found one Prolog system from that era using ".txt", at https://archive.org/details/programminginpro0000cloc/page/26... .

Re:`tar` creator/extractor in ~100 lines of Prolog by falsissime on Friday January 20, 2023 @03:39PM (#34459592)
The 1978 DEC10 Prolog user guide mentions PROG.PL as an example of a Prolog file with an extension. See 3.2 in https://userweb.fct.unl.pt/~lmp/publications/online-papers/U...

Maybe the 1975 Prolog I manual has more to say...

Re:`tar` creator/extractor in ~100 lines of Prolog by eesmith on Saturday January 21, 2023 @01:03AM (#34464280)
Good work!

I think it's even more explicit on p25 where it says "A module name can have the form either file.ext or just file. In the latter case the extension 'PL' is implied."

Re:`tar` creator/extractor in ~100 lines of Prolog by mathstuf on Wednesday January 18, 2023 @01:29PM (#34430772)
Fun trivia: I got a Emacs user to switch to Vim because in one of our class projects using Prolog, Emacs kept trying to highlight it as Perl (though it might be valid Perl syntax now that I think about it…). When I showed him that Vim did that for an empty file, but if it detected "Prolog-y" content (IIRC, the comment marker or a `:-` did it), it defaulted to Prolog highlighting.

No idea if Emacs ever fixed it (this was 2009 or so).

Re:`tar` creator/extractor in ~100 lines of Prolog by waynecochran on Wednesday January 18, 2023 @02:24PM (#34431637)
This is a trivial fix for an emacs user. M-x prolog-mode.
Re:`tar` creator/extractor in ~100 lines of Prolog by puffoflogic on Wednesday January 18, 2023 @02:30PM (#34431718)
Instructions unclear, pinky finger fell off.