Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!europa.eng.gtefsd.com!library.ucla.edu!galaxy.ucr.edu!ihnp4.ucsd.edu!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!winikoff
From: winikoff@munta.cs.mu.OZ.AU (Michael David WINIKOFF)
Subject: Re: In defense of Prolog's dynamic typing
Message-ID: <9434012.13942@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU
Organization: Computer Science, University of Melbourne, Australia
References: <3aviu6$7dq@hitchcock.dfki.uni-sb.de> 	<PEREIRA.94Nov23222128@alta.research.att.com> 	<3b1q1v$kqu@hitchcock.dfki.uni-sb.de> <3b2dst$q54@elna.ethz.ch> <THOMASL.94Nov25131424@arnold.csd.uu.se>
Date: Tue, 6 Dec 1994 01:09:20 GMT
Lines: 46

thomasl@arnold.csd.uu.se (Thomas Lindgren) writes:

>In article <3b2dst$q54@elna.ethz.ch> marti@inf.ethz.ch (Robert Marti) writes:
>   Even better, use a typed language which provides automatic garbage
>   collection: CLU, Eiffel, ML, Modula-3, and Oberon come to mind -- and
>   of course Goedel.  In other words:  Ideally, I want both typing and
>   automatic memory management to save me from stupid mistakes. 

>One of the pains of Goedel is that you must write type declarations
>for every procedure, which is the same as type declaring each case
>statement or while-loop in an imperative language. 

>While the information is used for a worthy purpose, I personally find

One of the worthy purposes is documentation.

Functional languages such as Haskell/Gofer/Miranda/SML do type inference
so in theory(*) you never have to declare types.

It is, however, good practice to include the types explicitly -- it
doesn't take any extra thinking (if you don't know what the types of 
your functions are odds are they don't have consistant types) -- just typing.

Types also make good documentation and can help the type inferencer
pinpoint errors.

>this excessive, and would much prefer type inference 
>or soft typing to reduce the amount of declarations to just declaring 
>type definitions (not predicate types) and/or typing selected
>predicates. This has been done for Scheme (e.g., Andrew Wright's thesis)
>and for the object-oriented Cecil (Craig Chambers and students). 

>Finally, maybe the Mycroft-O'Keefe type checker can be useful to those 
>who want strong typing for their Prolog programs. I also seem to recall 
>a Typed Prolog, but cannot remember where either of the above two may 
>be found. Doesn't NU-Prolog provide various forms of typing as well?
>The advantage is again that you can mix statically and dynamically
>typed program development to your own taste.

>				Thomas


>--
>Thomas Lindgren, Uppsala University		"Kkkkttttt."
>thomasl@csd.uu.se, lindgren@sics.se		
>http://www.csd.uu.se/~thomasl/home.html		
