Article View: comp.lang.functional
Article #632Re: Why functional languages?
From: Nick Haines
Date: Fri, 02 Oct 1992 18:42
Date: Fri, 02 Oct 1992 18:42
48 lines
2850 bytes
2850 bytes
In article <BvGz2u.2rv.1@cs.cmu.edu> spot@CS.CMU.EDU (Scott Draves) writes:
[about SLM syntax ...]
but the answer to your question isn't important. real programs aren't
that short. large lisp functions retain their clarity. large SML
functions are horrid messes. this is taken from the compiler itself
(something i work on). i didn't even have to try and find something
bad... (* Copyright 1989 by AT&T Bell Laboratories *).
and getroot(APP(VAR f,wl)) = (f,mix(wl,standardformals wl))
[...etc...]
With all due respect to the NJ programmers (who have, after all,
provided us with the best free compiler) the compiler is well known
among SML hackers as one of the least legible, least well-structured
large pieces of SML code in existence. It's dying from mouldiness and
sagging under the weight of hacked-on pieces. It's _very_ difficult to
understand or maintain, but this is not a consequence of it being
written in SML. I have worked on other SML systems, at least one of
which is larger than the NJ compiler, and in comparison they are
simple, legible, and maintainable (and _commented_!).
[...]
where's the obvious syntax error in this:
datatype foo = FOO of x
fun bar FOO x = x
( )
Missing parens, of course; you didn't really want a curried function
of type (x -> foo) -> 'a -> 'a, did you? What's the problem? Anyone
who's done much work in SML should recognise immediately that
fun bar x y =
defines a curried function. The real problem with the fun syntax is
with infix functions (which IMO are a mistake in the design).
As a hacker who's worked specifically with syntax and parsing problems
in SML, I will be the first to agree that it is not syntactically
perfect. But it's problems are minor compared to a language in which
_every_ structure looks the same. I have also worked with very large
LISP systems and much prefer coding in SML.
Nick Haines nickh@cmu.edu
Technical Details
Message-ID:
<NICKH.92Oct2134230@VOILA.VENARI.CS.CMU.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!nickhReferences:
<TMB.92Sep28144424@arolla.idiap.ch> <annius.717696151@freyr> <TMB.92Sep28223555@arolla.idiap.ch> <26463@castle.ed.ac.uk> <BvGz2u.2rv.1@cs.cmu.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.functional Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!nickh From: nickh@CS.CMU.EDU (Nick Haines) Subject: Re: Why functional languages? In-Reply-To: spot@CS.CMU.EDU's message of Fri, 2 Oct 1992 01:06:29 GMT Message-ID: <NICKH.92Oct2134230@VOILA.VENARI.CS.CMU.EDU> Originator: nickh@VOILA.VENARI.CS.CMU.EDU Sender: news@cs.cmu.edu (Usenet News System) Nntp-Posting-Host: voila.venari.cs.cmu.edu Organization: School of Computer Science, Carnegie Mellon University References: <TMB.92Sep28144424@arolla.idiap.ch> <annius.717696151@freyr> <TMB.92Sep28223555@arolla.idiap.ch> <26463@castle.ed.ac.uk> <BvGz2u.2rv.1@cs.cmu.edu> Date: Fri, 2 Oct 1992 18:42:30 GMT Lines: 48