
The FAQ of comp.lang.prolog is maintained as a Prolog source file - martinlaz
https://www.metalevel.at/prolog/faq/
======
rho4
Story of my life. In my opinion the best tool for basically all jobs is
usually the main programming language of your project / team / company.
Everyone can read it, change it and run it. It can do everything. It has the
best tooling support. The best IDE, which everyone has installed, licensed and
knows how to operate. It is hopefully compile- and type safe. It is hopefully
under source control. And hopefully a mainstream language, so you can find
tons of help and resources online.

But for some reason, every f* new task is always first solved with some
interpreted weakly typed scripting language, shell script or batch file,
config file, xml programming, open source tool or web service. Unversioned,
and with the weakest tool and team support imaginable. Probably a separate git
repository with separate login credentials is created somewhere along the way
as well.

~~~
YeGoblynQueenne
I feel your pain. For me the worse case of this is web dev, where there's a
different language for every task: html, CSS, javascript, SQL, your back-end
language, XML, JSON, and so on.

But, Swi has my back on that, too:

[https://www.swi-prolog.org/FAQ/PrologLAMP.txt](https://www.swi-
prolog.org/FAQ/PrologLAMP.txt)

    
    
      Can I replace a LAMP stack with SWI-Prolog?
      
      Yes, you can, and you'll be happier for it.
      
      LAMP is short for the following open source components to realise a web
      server:
      
          Linux
          Apache
          MySQL
          PHP
      
      In this picture, Linux provides the OS, Apache the web server, MySQL the
      database and PHP server-side scripting facilities. In fact, most of these
      components can be replaced. One can replace Linux with almost any other OS,
      Apache with Nginx, MySQL with PostgreSQL. PHP is similar to ASP.
      
      There are also larger replacements of this stack, such as Tomcat, which
      replaces both Apache and PHP. Similar architectures are available for Python
      (django), Ruby (Ruby on Rails) etc. As we will see below, this is the picture
      into which SWI-Prolog fits.  
    
      The SWI-Prolog web framework
      
      The SWI-Prolog web framework (obviously) does not replace the OS. It does
      replace Apache, PHP and to some extent MySQL. We could refer to the stack as
      LP (Linux Prolog). Below, we point at the various libraries that make up the
      stack and relate them to the LAMP components they replace.
    

You can't quite replace html/css/js of course, since the browsers depend on
them- but they can be embedded in Prolog easily. I believe the http library in
my other comment here has facilities to do this.

Also- if you ever need to write a parser for some topsy-turvy ad-hoc markup
language some third-party is using that you are forced to process, Prolog is
probably the best language to do this, thanks to its Definite Clause Grammars
notation that's basically BNF, except that it's not restricted to context-free
grammars:

[https://en.wikipedia.org/wiki/Definite_clause_grammar](https://en.wikipedia.org/wiki/Definite_clause_grammar)

~~~
choward
Please don't format your comments like this. Nobody is going to read it on
mobile.

~~~
jlarocco
What's the problem, exactly? He's quoting a paragraph out of a document, and
appropriately used a blockquote...

Maybe it's a bug on your phone or the HN codebase?

~~~
j88439h84
Hn doesn't support block quotes

~~~
derefr
I've always wondered why support wasn't added. It's a very simple change to
add them; and everyone continuously tries-and-fails to use them. @dang et al,
is there nobody on your side who can make little patches like this to "pave
the well-trod path"?

------
YeGoblynQueenne
Swi-Prolog includes an http client/server library:

[https://www.swi-
prolog.org/pldoc/doc_for?object=section(%27p...](https://www.swi-
prolog.org/pldoc/doc_for?object=section\(%27packages/http.html%27\))

And of course, a lot of support for the semantic web:

[https://www.swi-prolog.org/web/index.txt](https://www.swi-
prolog.org/web/index.txt)

The entire Swi-Prolog website at [https://www.swi-
prolog.org/](https://www.swi-prolog.org/) runs on the Swi-Prolog web libraries
- they call it "eating your own dog food":

[https://www.swi-prolog.org/dogfood.txt](https://www.swi-
prolog.org/dogfood.txt)

~~~
7thaccount
The Perl6 (now Raku) language implementors use that phrase a lot as well. I
wonder where it originated.

~~~
mhd
There's a decent Wikipedia article about it:

[https://en.wikipedia.org/wiki/Eating_your_own_dog_food](https://en.wikipedia.org/wiki/Eating_your_own_dog_food)

The first alternative phrase is hilarious to my German ears.

~~~
YeGoblynQueenne
I'm... not sure I should ask you to explain ~.-

~~~
tom_mellior
They might be referring to this:
[https://en.wiktionary.org/wiki/Natursekt](https://en.wiktionary.org/wiki/Natursekt)

~~~
mhd
I was. But thanks for the link, it made me check out the etymology of "Sekt"
(sparkling wine) and that was quite surprising.

------
subjectsigma
I don't know if he browses this site, but wanted to give a quick thank you to
Markus Triska - the posted website and his YouTube channel are both simple but
informative Prolog resources. He's also made many contributions to SWI-Prolog
and a new experimental flavor called Scryer. Would encourage everyone to give
it a quick look, especially the fantastic reif and ediprolog tools. Thanks
Markus!

------
tetron
I was really hoping this would be structured as a set of assertions which
would then be used to generate answers in response to queries.

------
NaNtales
This reminds me of the C++ coding standard used at game company Splash Damage
which is maintained as a compilable source file (+ header)[1].

[1] [https://github.com/splash-damage/coding-
standards](https://github.com/splash-damage/coding-standards)

------
brian_herman
My teacher talked about prolog in college in my programming languages course
at UIC. It was really cool to see him talk about his thesis.

[https://cs.uic.edu/profiles/joe-hummel/](https://cs.uic.edu/profiles/joe-
hummel/)

~~~
djsumdog
I think the last time I touched prolog was in University. Looking back through
my class assignments, I think we discussed prolog but didn't actually write
anything in it. The only assignment I see from that era was writing our own
First-Order-Inference engine (really basic implementation; lots of
limitations):

[https://github.com/sumdog/assignments/tree/master/csc4240-pr...](https://github.com/sumdog/assignments/tree/master/csc4240-program2)

