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



On May 22, 8:19 am, Cameron Hughes <cahug...@xxxxxxxxxx> wrote:
Isaac Gouy wrote:
On May 21, 5:35 am, Simon Strobl <Simon.Str...@xxxxxxxxx> wrote:
Suggestions for new benchmarks game problems are welcome, make them on
the discussion forum or preferably make a feature request

http://shootout.alioth.debian.org/gp4sandbox/faq.php#help

Maybe it would be a good idea for the Computer LanguageShootoutto
also measure elegance. (A first approach to defining elegance might
be to simply identify it with shortness.)

I think that claiming the benchmark game measured elegance would show
lack of humility, but we do measure the gzip size of the source code
files (stripped of comments and whitespace)

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all〈=all...

Its not just a matter of elegance. Yall know this already :-) Its all about the right paradigm/tool for the job.

One can play tennis with a golf club if one practices hard and long enough. But a tennis racket would just make things so much easier!

My current work involves implementing ontologies, MTS (model theoretic semantics), and epistemic agents for the purpose of doing
legal transcript analysis (a type of datamining for court room transcripts). There is a great deal of NLP, inference processing and entailment processing
against the transcripts. Yes I could do this in Java or C++ (golf club ) But Prolog is so well suited for dealing with thesaurus, lexicon,
inference, semantic parse, etc. that a C++ or Java implementation would have to be extraodinary to achieve the same performance.

Folks, we're in an multicore revolution and storage revolution. The run-of-the-mill desktop computer now has two--to-four processors running at
several gigahertz each with a least a teraflop throughput (in most cases) The average ram is between 4 billion and 8 billion bytes. And common hard drives are
measured in hundreds of gigs. A comparison of Java vs Prolog at the hardware level is somewhat academic at this point. Yes hardcore performance benchmarks (Java vs Prolog etc) is an issue for massive data sets, high performance computing applications,or high traffic server environments. But most applications don't fit
those scenarios. And if performance is
that critical then C/C++ will trump both Prolog and Java.

The most relevant comparison between Java & Prolog is object oriented solutions vs logic programming solutions. Unification approaches vs assignment approaches.
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. Obviously many problems can be solved from either a object oriented or a logic programming paradigm (but the solutions will look different!)

I think Sterling and Shapiro put it very nicely.

" We believe that programming can be and should be, an intellectually rewarding activity; that a good programming language is a powerful conceptual tool. a tool
for organizing, experssing, experimenting with and even communicating one's thoughts; that treating programming as "coding" the last, mundane intellectually trivial, but time-consuming and tedious phase of solving a problem using a computer system , is perhaps at the very roots of what has been known as the software crisis"
... The Art of Prolog

Thinking in Java, is very different from thinking in Prolog. Insight and inspiration look different from a Java perspective than it does from a Prolog perspective.
What may be obvious in one of these languages in mind numbing in the other and vice versa. How do you benchmark elegance, insight, and inspiration?

I realize the Christina started all of this with a question about sorts and performance. But if she's using Prolog and the sort she was using wasn't fast enough,
the solution is not to pick a different language, but rather find a better sort, or improve the one she was working with. (Whatever happen to alorithm analysis?)
Perhaps a visit to Cormen or Sedwick is in order :-) (It still not to late to come up with new sorting techniques in prolog!!!)

Ultimately the language shootout between Java & Prolog will wind up comparing two very different paradigms. And benchmarking paradigms is non-sequitur.



I agree with most of your comment, but the penultimate paragraph is a
little puzzling.

If Christina discovers the best algorithm for her Prolog
implementation and if unhappily that doesn't perform as well as hoped,
then why would it be inappropriate to consider other programming
languages?

If it can't be done satisfactorily in Prolog then it can't be done? :-)
.



Relevant Pages

  • Re: In which cases/problems is Prolog faster than Java?
    ... We've OOP languages built from functional languages foundations ... they are envy of imperative programming styles. ... still a predicate either in plain Prolog or encapsulated in a Prolog ... People often use Java not because its OO features per se but because ...
    (comp.lang.prolog)
  • Re: Software suggestions
    ... pointers (I speak about the smart pointers and more ... Now I prefer languages that let me define problems ... Taking Prolog, I must say that dangling pointers ... There are languages that more robust than C++; Java is one of them, ...
    (comp.constraints)
  • Re: Programming Newbie: Ruby or Java?
    ... Before switching to Java my university taught the basic CS course using Scheme. ... Yet I certainly don't see a ton of people using those languages, and I certainly don't see many jobs asking for experience in those languages. ... I've had to learn Lisp/Scheme and Prolog. ...
    (comp.lang.ruby)
  • Re: java calling prolog
    ... > I would like to develop a java (or other languages) program which ... > generates a prolog script, calls prolog and reads the output for ...
    (comp.lang.prolog)
  • Re: Networking in Prolog - a survey
    ... I coded it in Java ... kindly asked if it was possible to extend the interpreter with various ... the state of the art in Prolog networking libraries to see if I could ...
    (comp.lang.prolog)