[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applicative languages? Anyone?



>Organization: LFCS, University of Edinburgh

In article <1202@uoregon.UUCP> markv@drizzle.UUCP (Mark VandeWettering) writes:
>In article <584@zippy.eecs.umich.edu> dwt@zippy.eecs.umich.edu (David West) writes:
>>Applicativity has its advantages, but it needs
>>1) ...
>>2) Some syntactic means for preventing argumentsfrom getting unreadably
>>   numerous just to pass something down to where it's finally used. 
>
>	Hmmm, not a bad idea.  I have just acquired "Implementation of
>	Functional Programming Languages by Simon L. Peyton Jones, and
>	am much impressed by the depth/level of the text.  Seeing as I
>	have to do a final thesis/project sometime :-) I might be
>	tempted to try a hand at an ML interpreter/compiler.  I would
>	like to hear from anyone who is trying/has tried similar
>	projects.

ML gives you objects with modifiable state, so that you don't need to
pass a state structure around with you. The disadvantage, of course, is
that you smash the applicative behaviour of the language -
whether it's worth it depends what you're trying to do.
   Another way around this is to use type abstraction. That way, your
state structure is an abstract object with a few access functions to get
at the bits you need. I've always used the former approach, so I don't know
how far the latter approach gets you. It's quite possible to take non-
applicative features like assignment and abstract over them to build
structured objects with varying state, a la Smalltalk perhaps. This isn't
"dirty" functional programming - it's just using a functional language as if
it were a language of a different kind. I recently dedicated a lecture to the
structured use of side-effects in ML.
   By the way, I have various little typecheckers and interpreters for tiny
functional languages lying around on-line somewhere, if you're interested.
All written in ML, of course.
-- 
Nick Rothwell,	Laboratory for Foundations of Computer Science, Edinburgh.
		nick%lfcs.ed.ac.uk@nss.cs.ucl.ac.uk
		<Atlantic Ocean>!mcvax!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
"Nothing's forgotten. Nothing is ever forgotten."   - Herne