ebook img

Arrays, Functional Languages, and Parallel Systems PDF

318 Pages·1991·3.16 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Arrays, Functional Languages, and Parallel Systems

ARRAYS, FUNCTIONAL LANGUAGES, AND PARALLEL SYSTEMS ARRAYS, FUNCTIONAL LANGUAGES, AND PARALLEL SYSTEMS Editedby Lenore M. R. Mullin University ofVermont Michael Jenkins Queen's University Gaetan Hains University of Montreal Robert Bemecky Snake Island Research GuangGao McGill University SPRINGER SCIENCE+BUSINESS MEDIA, LLC Library ofCongress Cataloging-in-Publication Data Arrays, functionallanguages, and parallel systems / edited by Lenore Mullin ... [et al.]. p. cm. "Representative of talks given at the First International Workshop on Arrays, Functional Languages, and Parallel Systems held 12-15 June 1990 in Montreal, Quebec" --Perf. Includes index. ISBN 978-1-4613-6789-5 ISBN 978-1-4615-4002-1 (eBook) DOI 10.1007/978-1-4615-4002-1 1. Functional programming languages --Congresses. 2. Parallel processing (Electronic computers) --Congresses. 3. Array processors --Congresses. 1. Mullin, Lenore. II. International Workshop on Arrays, Functional Languages, and Parallel Systems (1st : 1990 : Montreal, Quebec) QA76.7.A7 1991 004' .35 --dc20 91-27527 CIP Copyright © 1991 by Springer Science+Business Media New York Originally published by Kluwer Academic Publishers in 1991 Softcover reprint ofthe hardcover Ist edition 1991 AlI rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form orby any means, mechanical, photo-copying, recording, or otherwise, without the prior written permission of the publisher, Springer Science+ Business Media, LLC. Printed on acid-free paper. Dedication Alan J. Perlis 1922 -1990 We dedicate this workshop to the memory of Alan J. Perlis and his commitment to research in arrays and programming languages. The Organizing Committee: R. Bernecky, G. Gao, G. Hains, M. Jenkins, L. Mullin A Mentor Arrays, how you lived them You supported their research before their time APL and STA PL thanks to you You advised and mentored students everywhere Perdue, Yale, and CMU Thank you for your encouragement, my mentor For your help and guidance, my advisor We will all miss you We will all remember you a student Table or Contents Preface .............................................................................................................. ix 1 Arrays and the Lambda Calculus -Klaus Berlding ....•............................................ 2 Compiling APL -Robert Bernecky .....•.....•...•..••....••.•••...•.......••...•......••...•........... 19 3 Acorn Run-Time System for the CM-2 -Walter Schwarz ......................................... 35 4 Compiling Issues of Monolithic Arrays -GUilng Gao .......•...................................... 59 5 Arrays in Sisal -lohn T. Feo ..... ...........• ....... ••.... ....•........... ........ ... .... ....... ......... 93 6 Falafel: Arrays in a Functional Language -Carl McCrosky, Kanad Roy, KenSailor 107 7 Arrays in HaskeIl -Guy Lapalme ....................................................................... 125 8 Array Theory and Knowledge Representation -lanice Glasgow .... ........ ....... ............. 133 9 A Parallel Intermediate Representation Based on Lambda Expressions - Timothy A. Budd ........•.............•................................................................... 145 10 Arrays in Fidil -Luigi Semanzato, Paul Hilfinger ...... .............. ....... ....... ....... ....... 155 11 Structured Data-Types in the Reduction System 'IT-RED - Claudia Schmittgen, Harald BI/jdorn, Werner Kluge ...... ............... .............. ......... 171 12 Psi, The Indexing Function: A Basis for FFP with Arrays- Lenore M. Restifo Mullin ................................................................................ 185 13 Genotype-A Pure Functional Array Language -Sebastian Shaumyan ....... ................. 201 14 A Comparison of Array Theory and A Mathematics of Arrays - Michael A. lenkins, Lenore M. Restifo Mullin ................................................... 237 15 Alternative Evaluation of Array Expressions -Cory F. Skutt ........... .............. ......... 269 16 Matrix Inverion in 3 Dimensions -Gaetan Hains .................................................. 295 17 Fuzzy Inference Using Array Theory and Nial -Ian lantzen ................................... 303 PREFACE During a meeting in Toronto last winter, Mike Jenkins, Bob Bernecky and I were discussing how the two existing theories on arrays influenced or were in fluenced by programming languages and systems. More's Army Theory was the basis for NIAL and APL2 and Mullin's A Mathematics of A rmys(MOA) , is being used as an algebra of arrays in functional and A-calculus based pro gramming languages. MOA was influenced by Iverson's initial and extended algebra, the foundations for APL and J respectively. We discussed that there is a lot of interest in the Computer Science and Engineering communities concerning formal methods for languages that could support massively parallel operations in scientific computing, a back to-roots interest for both Mike and myself. Languages for this domain can no longer be informally developed since it is necessary to map languages easily to many multiprocessor architectures. Software systems intended for parallel computation require a formal basis so that modifications can be done with relative ease while ensuring integrity in design. List based lan guages are profiting from theoretical foundations such as the Bird-Meertens formalism. Their theory has been successfully used to describe list based parallel algorithms across many classes of architectures. We decided that it would prove fruitful to get together the research community investigating formalisms for array based languages designed for parallel machines with the community actually building and using func tional parallel languages. Many of the colleagues we know individually did not know each other's work, yet they were addressing topics with much commonality. For example, some of our colleagues that have worked with language communities such as FORTRAN, NIAL, and APL, have developed arrays for scientific computation since the early 60's. The language development groups in these areas have spent years investigating design methodology, efficient implementations, and compiler technology for array operations and recently, parallelizing compilers to classes of multiprocessor architectures. Although issues of functional programming and constructive derivations are not the focus of these communities, issues on array compilation to various architectures, performance and scientific applications are. Other colleagues have been directly involved in the design and extension of list-oriented functional programming languages to include array mech anisms. There has been very little communication between the language design and implementation groups in these different communities. As a x result many ideas in the functional programming community have been re discovered independently. We decided to hold an invitational workshop in Montreal as a first step to bring these communities together. The list of attendees was drawn up from colleagues who had an interest in array and list algebras, functional lan guages, parallel algorithms, multiprocessor architectures, intelligent compil ers, and scientific applications. The papers presented herein are representa tive of the talks given at the First International Workshop on Arrays, Func tional Languages, and Parallel Systems held 12-15 June 1990 in Montreal, Quebec. We are very grateful to everyone who helped us achieve our goals, in par ticular, CRIM( Centre de recherche injormatique de MontreaQ, ITRC(Injormati07 Technology Research Centre), NSERC, and IBM Corporation for financial support. We would like to thank Kluwer for its assitance in publishing this record of the conference. Lenore Mullin ARRAYS, FUNCTIONAL LANGUAGES, AND PARALLEL SYSTEMS 1 ARRAYS AND THE LAMBDA CALCULUS Kla.us Berk ling CASE Center and School of Computer and Information Science Syracuse University Syracuse, NY 13244-1190 May 1990 Keywords: Array processing, functional programming, lambda cal culus, reduction machines. INTRODUCTION Why do functional languages have more difficulties with arrays than procedural languages? The problems arising in the designing offunc tionallanguages with arrays and in their implementations are man ifold_ They can be classified according to 1) first principles, 2) se mantics, 3) pragmatics, and 4) performance. This paper attempts to give an outline of the issues in this area, and their relation to the lambda calculus. The lambda calculus is a formal system and as such seemingly remote from practical applications. However, specific representations and implementations of that system may be utilized to realize arrays such that progress is made towards a compromise of 1) adhering to first principles, 2) clear semantics, 3) obvious prag matics, and 4) high performance. To be more specific, a form of the lambda calculus which uses a particular representation of variables, namely De Bruijn indices, may be a vehicle to represent arrays and the functions to manipulate them. PROBLEM Serious computational problems come almost always in terms of ar rays. Nothing seems to be more appropriate to array processing than the von Neumann Computer Architecture. Its linear memory struc + + ture, its addressing methods (absolute address offset index, base registers, offset registers, index registers), and its instruction set ob viously constitute a perfect base to implement arrays. Together with 2 language features originating from FORTRAN, the system indeed fills basic needs in all four categories stated above. Why would or should one try to improve on it? Because only very basic needs are filled. For the sake of efficiency, the higher level concepts of program ming languages had to be compromised. Real problems are dealing with very large matrices and/or very frequently used matrices, for ex ample for pointwise transformations in image processing. There is no time (or space!) for costly procedure or function entries (prologues) and exits (epilogues), for scoping of variables and blockstructures, but there is a tendency for rather flat programs and code. This be comes manifest in terms of complicated nests of DO-loop constructs and difficult to follow GOTO's. A premium is on the removal of code from more frequently executed innermost DO-loops to less fre quently executed outer DO-loops or initialization pieces by program transformations. The combination of flat code, flat name space, static memory lay out, and the assignment statement as basic programming tool causes very unpleasant properties. Since index variables are usually con sidered first class citizens, occurrences of, for example, A[J, J(] may refer to different matrix elements depending on the code executed be tween these occurrences. Assignments to J and J( may destroy the referential transparency. The scope structure is intricately mapped onto sequencing. As a consequence, variables can be easily confused, alterations become a costly, error prone, and time consuming enter prise. It is particularly difficult to transform such flat programs into "parallel" programs, which make inherent concurrency explicit. Ob viously, scoping cannot be expelled without penalty. If it is not part of the language, the compiler must symbolically execute the code to reconstruct dependencies. Many of the problems to produce efficient and accurate code without the base of higher level concepts arise from the utilization of memory locations. The conventional viewpoint of a memory location is best described as a "box-variable," as opposed to a "place-holder variable," which is the viewpoint taken by functional languages. This difference makes it difficult for functional languages to adopt easily array features from conventional languages. Four operations are as sociated to box variables: allocate (a name to refer to the box is created), deallocate, fill the box, read the contents of the box. In

Description:
During a meeting in Toronto last winter, Mike Jenkins, Bob Bernecky and I were discussing how the two existing theories on arrays influenced or were in­ fluenced by programming languages and systems. More's Army Theory was the basis for NIAL and APL2 and Mullin's A Mathematics of A rmys(MOA) , is b
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.