In this paper we present a new and general strictness analysis technique for lazy functional languages.In contrast to many other methods, this method is practically usable. This is shown with results of a real implementation.The key idea is the use of an abstract domain of which the elements rep resent various kinds of sets of concrete values.Reduction as well aa pattern matching in the abstract domain mimics reduction and pattern matching in the concrete domain in a very natural way. With th~abstract domain various kinds of strictness analysis are possible. In particular, higher order functions and general data types (tuples and lists, but also user defined data types) fit perfectly well in this mechanism. In contrast to methods based on abstract interpretation, the abstract domain is infinite.Recursive functions are handled by a technique called reduction path analysis, Complicated and expensive fixed point derivation techniques are not needed.The implementation in the Concurrent Clean system shows that the analyser is very fast and that it finds much strictness information.
No abstract
Concurrent Clean is an experimental, lazy, higher-order parallel functional p r ogramming language based on term graph rewriting. An important d i e r ence with other languages is that in Clean graphs are manipulated and not terms. This can beused by the programmer to control communication and sharing of computation. Cyclic structures can be de ned. Concurrent Clean furthermore a llows to control the (parallel) order of evaluation t o m a k e e cient e v aluation p o ssible. With help of sequential annotations the default lazy evaluation can be locally changed into eager evaluation. The language enables the de nition o f p a rtially strict data structures which m a ke a whole new class of a l g orithms feasible in a functional language. A p o werful and fast strictness analyser is incorporated in the system. The quality of the code generated b y the Clean compiler has been greatly improved such t h a t it is one of t h e b e st code generators f o r a l a zy functional language. Two v ery p o werful parallel annotations enable the programmer to de ne concurrent functional progra m s w i t h a rbitrary process topologies. Concurrent C l e a n i s s e t u p i n s u c h a way t h a t the e ciency achieved for the sequential c a se can largely be maintained for a p a rallel implementation on l o o sely coupled parallel machine architectures.
Values belonging to lazy data types have the advantage that sub-components can be accessed without evaluating the values as a whole: unneeded components remain unevaluated. A disadvantage is that often a large amount of space and time is required to handle lazy data types properly. Many special constructor cells are needed to ‘glue’ the individual parts of a composite object together and to store it in the heap. We present a way of representing data in functional languages which makes these special constructor cells superfluous. In some cases, no heap at all is needed to store this data. To make this possible, we introduce a new kind of data type: (partially) strict non-recursive data types. The main advantage of these types is that an efficient call-by-value mechanism can be used to pass arguments. A restrictive subclass of (partially) strict non-recursive data types, partially strict tuples, is treated more comprehensively. We also give examples of important classes of applications. In particular, we show how partially strict tuples can be used to define very efficient input and output primitives. Measurements of applications written in Concurrent Clean which exploit partially strict tuples have shown that speedups of 2 to 3 times are reasonable. Moreover, much less heap space is required when partially strict tuples are used.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.