Comment by hunterpayne

3 months ago

Because its more powerful than MongoDb or Fortran. The cut operator for instance gives it the ability to express things you just can't do in those other systems. The trade-off is that mastering the cut operator is a rare skill and only that one person who can do it can maintain the Prolog code. Compare that with MongoDb where even the village idiot can use it but with a huge performance cost.

I don't know about MongoDB and its query language, but wrt Fortran, it's unreasonable to say that Prolog is more powerful than Fortran (or vice versa). A more reasonable statement is that Prolog is more expressive than Fortran (though this gets fuzzy, we have to define expressiveness in a way that lets us rank languages). But the power of a language normally means what we can compute using that language. Prolog and Fortran both have the same level of "power", but it's certainly fair to say that expressing many programs is easier in Prolog than Fortran, and there are some (thinking back to my scientific computing days) that are easier to express in Fortran than Prolog.

  • I would say most programs are easier in Fortran. But there are things you can't express in Fortran but you can in Prolog. There is nothing like the cut operator in Fortran for example. They are very different animals.

    • You seem to be confusing two different things: What is easily or natively expressed in the language, and what can be expressed in the language.

      You can create a logical equivalent of the cut operator in Fortran if you wanted to, but there's no native mechanism or operator to rely on. The languages possess the same computing "power", the difference is not in what they can compute which is your claim with "there are things you can't express in Fortran but you can in Prolog" (utter nonsense). Anything you can get a Prolog program to do, you can get a Fortran program to do (and vice versa).

      3 replies →