Re: In which cases/problems is Prolog faster than Java?



On May 22, 4:19 pm, Cameron Hughes <cahug...@xxxxxxxxxx> wrote:

The  most  relevant comparison  between Java & Prolog  is   object oriented solutions vs  logic programming solutions.  Unification approaches vs assignment approaches.

The first "vs" above is both true and misleading (the second "vs" is
the important one). About the misleading bit. We've OOP languages
built from imperative language foundations (e.g. Objective-C, C++,
Java). We've OOP languages built from functional languages foundations
(e.g. CLOS). We've OOP languages built from logic languages
foundations (e.g. OL(P), L&O, Logtalk). This is a consequence of the
need of powerful code encapsulation and code reuse mechanisms missing
from imperative, functional, and logic languages. Language
implementers do not develop e.g. CLOS or Logtalk because they miss or
they are envy of imperative programming styles. Programming in CLOS
still fells like functional programming. Programming in Logtalk still
feels like logic programming. Encapsulation features helps you
encapsulate code. Reuse features helps you reuse your code. A function
is still a function either in plain Lisp or in CLOS. A predicate is
still a predicate either in plain Prolog or encapsulated in a Prolog
module or a Logtalk object.

Java is well suited to certain paradigms of software development. Prolog is well suited to other paradigms of software development. These two languages should be used
to complement each other.

People often use Java not because its OO features per se but because
its libraries. And, when talking about libraries that allows you to
write powerful applications without the need of implementing every
single bit of functionality yourself, then we, Prolog programmers,
have good reasons to fell envy :(

Obviously many problems can be solved from either a object oriented or a logic programming paradigm (but the solutions will look different!)

Yes, solutions will look different. But, for non-trivial problems, one
of them will be a good (or at least acceptable) solution while the
other will be a awkward solution at best. Objects are secondary here.
As you wrote above, the "unification approaches vs assignment
approaches" is what dictates the fundamental differences.

Best regards,

Paulo

.



Relevant Pages

  • Re: compiler for Chinese development language
    ... This relates to the development of vernacular ... Indian vernacular display, OS and programming languages. ... Bangla and other vernaculars. ...
    (comp.compilers)
  • Re: Head-in-the-Sand Liberals (LA Times Columnist)
    ... You claimed to have known several computer languages, ... If you lie about knowing computer languages, ... of the programming loop for a functional ... You also don't know Java. ...
    (rec.org.mensa)
  • Re: Is there a mainframe skills shortage?
    ... That's because the author of the article is comparing it to standard SQL. ... and material around Lamdas and functional programming. ... obvious which languages were the ones to learn. ... stick to writing system software and leave applications to the COBOL ...
    (comp.lang.cobol)
  • Re: LISPPA
    ... >> a match for such imperative languages as C, ... >comparing Lisp with languages like C, Pascal and Basic, ... I can accept that Lisp tries to compensate of the lack of compile-time ... If you have tools of visual programming, nice editor, advanced ...
    (comp.lang.lisp)
  • Re: GoTo in Java
    ... Scripting languages are programming languages; ... override the method.via an interface, or write a new method in the wrapper. ...
    (comp.lang.cobol)