From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 6A5E9BB84 for ; Sat, 17 Jan 2009 10:46:06 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAB84cUnVhjEYkWdsb2JhbACUAwEBAQEJCwoHEQO3AoVyhEs X-IronPort-AV: E=Sophos;i="4.37,280,1231110000"; d="scan'208";a="33873149" Received: from ihsmtp02voda.lis.interhost.com (HELO ihsmtp02cons.lis.interhost.com) ([213.134.49.24]) by mail4-smtp-sop.national.inria.fr with ESMTP; 17 Jan 2009 10:46:06 +0100 Received: from [192.168.1.64] ([77.54.249.136]) by ihsmtp02cons.lis.interhost.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 17 Jan 2009 09:43:29 +0000 Message-ID: <4971A8DC.9040307@inescporto.pt> Date: Sat, 17 Jan 2009 09:46:04 +0000 From: Hugo Ferreira User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Kuba Ober Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Optimizing symbolic processing code References: <4970488C.9080104@inescporto.pt> <200901161341.53632.jon@ffconsultancy.com> <49709693.50201@inescporto.pt> <4970B398.5010100@inescporto.pt> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 17 Jan 2009 09:43:29.0083 (UTC) FILETIME=[0D4D60B0:01C97888] X-Spam: no; 0.00; inference:01 inference:01 compiler:01 ocaml:01 bytecode:01 compiler:01 andrej:01 ocaml's:01 ocaml's:01 ocaml:01 admittedly:01 andrej:01 cheers:01 beginner's:01 bug:01 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 >