Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!ptsfa!lll-lcc!seismo!mcvax!unido!iaoobelix!wagner From: wagner@iaoobelix.UUCP Newsgroups: comp.lang.prolog Subject: Re: Re: How do you like Turbo-Prolog? - (nf) Message-ID: <7000004@iaoobelix.UUCP> Date: Wed, 11-Mar-87 10:54:00 EST Article-I.D.: iaoobeli.7000004 Posted: Wed Mar 11 10:54:00 1987 Date-Received: Fri, 13-Mar-87 06:35:58 EST References: <1974@cit-vax.UUCP> Lines: 61 Nf-ID: #R:cit-vax:-197400:iaoobelix:7000004:000:2916 Nf-From: iaoobelix!wagner Mar 11 16:54:00 1987 > /***** iaoobelix:comp.lang.pro / cit-vax!newton / 9:19 am Mar 8, 1987*/ > > The unfortunate part was the Pascal-ization of the language. Everything > had to be typed (they called it domains). As far as I could tell, lists > had to be composed soley of other lists or elements all of one type. One > had to define the possible terms (giving the functor) that could be > arguments to a predicate. It seemed impossible to write generic predicates > for dealing with arbitrary types of terms. It is even impossible to write certain applications (e.g. parsers for natural language) that have to use lists containing arbitrary objects (i.e. symbols, lists, terms, ...). > Typing each subterm of a term is not my idea of Prolog. I absolutely agree. > Also, and most seriously (thanks to Fernando Pereira) there are two more > *MAJOR* problems: the logical variable doesn't really > exist: it is a runtime error to do variable-to-variable unifications > as in > p(X,X). > > ?- p(X,Y), p(X,a). > > And, it is not possible to assert clauses with variables. My opinion is that everybody working with real Prologs who tried to use TurboP????? encounters the same kind of problems as soon as one starts to write a typical Prolog program. Therefore, my flame about TurboP????? was just the conclusion, not the explanation. Most of the problems come from the fact that you have to declare variables. Of course, it is possible in programming languages like C or some versions of PASCAL to use loopholes or type casts to get around type checks and to change an int into a pointer to char or whatever. I agree, this can be very dangerous and the programmer has to be aware of them. On the other hand, languages like Lisp or Prolog *ARE NOT TYPELESS* and *DO HAVE TYPE-CHECKING*. The only difference is that in PASCAL or C or (for heaven's sake) FORTRAN the program (or each individual function call) has to know about the types of any data objects involved, whereas in Lisp or Prolog you have objects knowing of which type they are. This requires, of course, an entirely different (in fact, a much more sophisticated) memory management and garbage collection, what might have been the reason for Borland to write a TurboP????? rather than a ?????Prolog. You see, both PASCAL and Prolog do have type-checking but while PASCAL does checks at compile-time (and is able to do so because of the presence of declarations), Prolog (and other AI languages) use a dynamic type- checking at runtime, on one hand releaving the programmer of caring about some problems with type conflicts, and on the other hand enabling him/her to write generic functions/predicates. By the way, I am using CProlog1.5+ on Suns and it runs pretty fast. Juergen Wagner, (USENET) ...!unido!iaoobel!wagner ("Gandalf") Fraunhofer Institute IAO, Stuttgart Note: "God is REAL (unless declared INTEGER)." ...vanilla disclaimer...