From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,97482af7429a6a62 X-Google-Attributes: gid109fba,public X-Google-Thread: 10d15b,97482af7429a6a62 X-Google-Attributes: gid10d15b,public X-Google-Thread: 103376,97482af7429a6a62 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Language Efficiency Date: 1995/04/19 Message-ID: #1/1 X-Deja-AN: 101281635 references: <3lmt64$stt@dplanet.p2k.cbis.com> <3lrrqk$kbj@usenet.INS.CWRU.Edu> <3ls7u0$3v1@stc06.ctd.ornl.gov> <9511001.20524@mulga.cs.mu.OZ.AU> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.c++,comp.lang.ada,comp.lang.cobol Date: 1995-04-19T00:00:00+00:00 List-Id: Fergus notes the comparison of peformance of Prolog and Mercury, and states that Mercury is up to 70% faster: (The feature in question is the ability to write `read(X), call(X)', which can call any predicate with any arguments depending on the input.) But how can forbidding a feature POSSIBLY mean that you can compile faster. If it is possible to compile faster if read(x) and call(x) are avoided, then surely a prolog compiler can just look at your program, see if you use these features, and use one of two totally different compilation strategies depending on the answer. Of course I understand that this makes implementation harder, and it is indeed true that you have to work very hard to deal with difficult problems, but you often can deal with them much better than you might imagine. Another example from SNOBOL-4 In SNOBOL-4, when you access any variable by name, as in the access to Q in the assignment R = Q you have to check if Q is input associated (and if so, read from a file), and if it is trace associated (and if so, call a user defined trace routine). Similarly the assignment to R may write to a file or call a userdefined trace procedure. The I/O associations and trace associations are completely dynamic, and it is impossible to tell at compile time whether any given reference needs the extra tests. Yes, without ANY loss of dynamic flexibility, the 370 SPITBOL compiler does these tests with precisely ZERO overhead in the most common case where the variables R and Q are never associated. ZERO doesn't just mean small, it means ZERO!