caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hugo Ferreira <hmf@inescporto.pt>
To: Kuba Ober <ober.14@osu.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Optimizing symbolic processing code
Date: Sat, 17 Jan 2009 09:46:04 +0000	[thread overview]
Message-ID: <4971A8DC.9040307@inescporto.pt> (raw)
In-Reply-To: <C20197A3-90C8-4A4C-9CDC-26770D68615E@osu.edu>

Hello,

Kuba Ober wrote:
 >
 > On Jan 16, 2009, at 11:19 AM, Hugo Ferreira wrote:
 >
 >> Peter Ilberg wrote:
 >>> On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote:
 >>>> I have implemented a simple Prolog like inference engine
 >>>> to be used in machine learning algorithms (ILP). My first
 >>>> basic test shows that inference is dismally slow (compared
 >>>> to a Prolog compiler).
 >>>> Consequently I am looking for information on optimizing the code.
 >>> For implementing a Prolog-like language, you might want to look at
 >>> this book on the Warren Abstract Machine:
 >>> 
http://web.archive.org/web/20030213072337/http://www.vanx.org/archive/wam/wam.html 

 >>>
 >>
 >> Ok, new of this document. But I think this demands too-much effort.
 >
 > What you expect, basically, is for OCaml to magically translate your
 > likely cobbled-together, slowly performing interpreter into a bytecode
 > compiler and a VM.
 >

See response to Andrej Bauer's e-mail please.

 > That ain't happening, and it's not OCaml's fault. Try compiling your
 > code in F# and see how fast it runs - I doubt you'll see an
 > improvement of more than an order of magnitude, unless you're really
 > unlucky to hit some OCaml's deficiencies.

This is exactly the type of information I am looking for.
What deficiencies does Ocaml have that may cause efficiency problems?
How should one go about looking for these problems?
What can one do to avoid or correct these problems?

 > I doubt that SWI Prolog would be
 > substantially (as in more than an order of magnitude linear constant)
 > slower
 > if it were ported to OCaml.
 >

Let me make this clear: I am not attempting to port anything.
I want a resolution based system to be used in a learning algorithm.
Naturally I want performance on par with possibly less efficient
Prolog implementations like SWI (BTW, SWI is my preferred Prolog 
interpreter, so don't misread what I just said). In fact I don't
need much of Prolog's programming capabilities (otherwise I would
have used Prolog).

 > Writing a well-performing Prolog system is not an overnight task, at
 > least not without using some decent compiler/system building
 > libraries, which may not even exist.
 >

Admittedly I am no expert in this or any other area for that matter.
Nevertheless this has not been "an overnight task". Again see
response to Andrej Bauer's e-mail please.

Hugo F.


 > Cheers, Kuba
 >
 > _______________________________________________
 > Caml-list mailing list. Subscription management:
 > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
 > Archives: http://caml.inria.fr
 > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
 > Bug reports: http://caml.inria.fr/bin/caml-bugs
 >


      reply	other threads:[~2009-01-17  9:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16  8:42 Hugo Ferreira
2009-01-16  9:05 ` [Caml-list] " blue storm
2009-01-16  9:44   ` Hugo Ferreira
2009-01-16 13:41 ` Jon Harrop
2009-01-16 14:15   ` Hugo Ferreira
2009-01-16 16:14     ` Peter Ilberg
2009-01-16 16:19       ` Hugo Ferreira
2009-01-16 19:09         ` Andrej Bauer
2009-01-16 20:48           ` Andrej Bauer
2009-01-17  9:28             ` Hugo Ferreira
2009-01-17 11:39               ` Andrej Bauer
2009-01-17 15:47                 ` Hugo Ferreira
2009-01-17 16:08                   ` Hugo Ferreira
2009-01-16 21:46         ` Kuba Ober
2009-01-17  9:46           ` Hugo Ferreira [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4971A8DC.9040307@inescporto.pt \
    --to=hmf@inescporto.pt \
    --cc=caml-list@yquem.inria.fr \
    --cc=ober.14@osu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).