Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are polymorphic messages so much more powerful in practice than the combination of unification and backtracking?

One way of looking at the history of programming language design is that there was a revolution with the introduction of the subroutine. Twenty or thirty years later, two refinements of the subroutine call were seriously considered:

  • Polymorphic messages
  • Unification and backtracking

I've just been programming in Prolog after a 20 year hiatus and realizing just how incredibly powerful unification and backtracking are. However, polymorphism won. Why?

like image 651
Kent Beck Avatar asked Oct 27 '10 16:10

Kent Beck


1 Answers

My experience with Prolog is that is works excellent when backtracking search is a good fit for your problem domain. However, if that is not the case much of the programming effort goes into fighting the backtracking search, bending it to ones own needs.

So my take on the situation is that backtracking search is too narrow a language feature to be generally useful. If we would have seen unification together with a more flexible search then we might have seen a different course of development.

like image 103
svenningsson Avatar answered Oct 06 '22 22:10

svenningsson