Xref: utzoo comp.lang.lisp:566 comp.lang.scheme:65 comp.lang.misc:889 Path: utzoo!mnetor!uunet!mcvax!ukc!its63b!csnjr From: csnjr@its63b.ed.ac.uk (Nick Rothwell) Newsgroups: comp.lang.lisp,comp.lang.scheme,comp.lang.misc Subject: Re: Applicative languages? Anyone? Message-ID: <819@its63b.ed.ac.uk> Date: 8 Dec 87 12:40:13 GMT References: <1409@mind.UUCP> <584@zippy.eecs.umich.edu> <1202@uoregon.UUCP> Reply-To: nick%ed.lfcs@uk.ac.ucl.cs.nss (Nick Rothwell) Organization: LFCS, University of Edinburgh Lines: 37 Keywords: ML interpreter typechecker 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!mcvax!ukc!lfcs!nick ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ "Nothing's forgotten. Nothing is ever forgotten." - Herne