Re: In which cases/problems is Prolog faster than Java?
- From: Paulo Moura <pjlmoura@xxxxxxxxx>
- Date: Fri, 23 May 2008 03:02:56 -0700 (PDT)
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
.
- Follow-Ups:
- Re: In which cases/problems is Prolog faster than Java?
- From: A . L .
- Re: In which cases/problems is Prolog faster than Java?
- From: Cameron Hughes
- Re: In which cases/problems is Prolog faster than Java?
- References:
- In which cases/problems is Prolog faster than Java?
- From: Christina
- Re: In which cases/problems is Prolog faster than Java?
- From: Cameron Hughes
- Re: In which cases/problems is Prolog faster than Java?
- From: Isaac Gouy
- Re: In which cases/problems is Prolog faster than Java?
- From: Simon Strobl
- Re: In which cases/problems is Prolog faster than Java?
- From: Isaac Gouy
- In which cases/problems is Prolog faster than Java?
- Prev by Date: Re: large databases
- Next by Date: Functional and Declarative Programming in Education (FDPE): Call for Papers (co-located w/ ICFP08)
- Previous by thread: Re: In which cases/problems is Prolog faster than Java?
- Next by thread: Re: In which cases/problems is Prolog faster than Java?
- Index(es):
Relevant Pages
|
|