home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.ai      Awaiting the gospel from Sarah Connor      1,954 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 58 of 1,954   
   Laurence Kramer to Hakan Younes   
   Re: Newbie Questions: Starting a Career    
   10 Sep 03 10:27:25   
   
   From: lkramer@cs.cmu.edu   
      
   Hakan Younes wrote:   
      
   > Don Geddis  wrote in message news:...   
   >   
   >>Yes, and Haskell is no exception.  As the main tag line at haskell.org   
   >>admits, it is a "purely functional", "static typing", language.  Both of   
   >>these choices are highly debatable; these are far from universally-accepted   
   >>superior language choices.  Lisp is a bit less dogmatic about these issues,   
   >>offering functional (but also imperative) programming, and offering   
   >>optional typing ("weak typing").   
   >   
   >   
   > A rich type system helps the programmer avoid obvious coding errors   
   > (e.g. passing a number to "cdr" in Lisp).  Could you please explain to   
   > me why anyone would think that "(cdr 4)" should be a valid Lisp   
   > program?  The fact is that the primitive procedure "cdr" most likely   
   > checks the "run-time type" of the object passed to it and reports an   
   > error if it is not a cons cell.  This of course makes Lisp type safe   
   > in the sense that you cannot currupt memory, but the runtime check   
   > required by "cdr" and other primitive procedures leads to less   
   > efficient code.  More importantly, though, it does not alert the   
   > programmer of the bug until it is encountered during run-time.  If the   
   > expression "(cdr 4)" occurs infrequently, then it is less likely that   
   > the programming error is ever detected.   
   >   
   > Thinking that one must choose between static and dynamic type checking   
   > shows a lack of understanding of basic type theory.  The type system   
   > of SML, for example, is rich enough to include both concepts.  What   
   > you call "weak typing" is obtained by tagging objects with a run-time   
   > "type" that can be checked with specific language constructs.  I would   
   > be surprised if Haskel did not have something similar.  This allows   
   > you to code as in Lisp, with an "anything goes" mentality, in a   
   > strongly typed language.  The type system provides the programmer with   
   > a choice.   
   >   
   > The bottom line is that a rich type system should always be preferred   
   > to a (uni-)type system such as the one in Lisp.   
      
   When I get the (cdr 4) break, I look at the stack, do "ctrl-c ." to   
   get me directly to the offending function definition, fix it, load or   
   compile it (just it, not the whole program), and restart the program.   
      
   I've never heard of SML before and have not programmed in Haskel,   
   but when you *do* encounter a program error in these languages, can you   
   fix the error while the program is running and continue?   
   If so, I'll give those languages a look.   
      
   If not, Lisp is clearly superior as a language for AI development,   
   where by definition you are tackling very difficult problems and   
   exploring different solutions.   
      
   Larry   
      
   [ comp.ai is moderated.  To submit, just post and be patient, or if ]   
   [ that fails mail your article to , and ]   
   [ ask your news administrator to fix the problems with your system. ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca