Article View: comp.lang.functional
Article #68Execution costs
From: Antony J. T. Davie
Date: Wed, 22 Jul 1992 09:35
Date: Wed, 22 Jul 1992 09:35
39 lines
2421 bytes
2421 bytes
Simon Courtenage writes: >Making the following assumptions, that > > 1. execution cost of functional languages is fixed for each program run > 2. the cost advantage of functional languages, such as ease of program > maintenance and clarity of expression etc. per unit time decrease > over the program life-cycle, > >then if the program was a high-use, long-use program then it would be better >to write the application in an imperative language as the execution cost >disadvantage would outweigh the dvelopment cost advantage. If the program >was a short-use or low-use program then it would be better to write it in a >functional language since the development cost advantage of functional >languages would, on average(?), overcome the execution cost disadvantage. >Hence why functional languages make good tools for prototyping but not for >end-products. The first assumption is not realistic in persistent situations. One of the whole points about laziness is that things should get evaluated at most once. If this principle is extended so that values persist after a functional program has been run and so that evaluation work done on these values is not lost, then running a new program which accesses these values will NOT incur the fixed cost mentioned in the assumption. The cost of reusing such values will be virtually zero --- and reuse is one of the major planks on which software engineering rests. My colleague Dave McNally (forthcoming thesis) and I have been working on such persistent systems [1,2] and their power really adds a new dimension to lazy evaluation, making its beneficial effects felt after particular programs have terminated. [1] D.J. McNally, A.J.T. Davie "Two Models for Integrating Persistence and Lazy Functional Languages" SIGPLAN 26, No. 5, May 1991 and University of St.Andrews Dept. of Math and Comp Sci research report CS/91/1 [2] A.J.T. Davie, D.J. McNally "PCASE --- A Persistent Lazy Version of an SECD Machine" University of St.Andrews Dept. of Math and Comp Sci research report CS/92/7
Technical Details
Message-ID:
<1992Jul22.093524.13830@st-andrews.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!warwick!str-ccsun!strath-cs!st-and!ajtdShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!warwick!str-ccsun!strath-cs!st-and!ajtd From: ajtd@st-andrews.ac.uk (Antony J. T. Davie) Newsgroups: comp.lang.functional Subject: Execution costs Message-ID: <1992Jul22.093524.13830@st-andrews.ac.uk> Date: 22 Jul 92 09:35:24 GMT Organization: St. Andrews University, Scotland. Lines: 39