Skip to main content

Fast Functional Lists

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2670))

Abstract

Since J. McCarthy first introduced Functional Programming, the Linked List has almost universally been used as the underpinning data structure. This paper introduces a new data structure, the VList, that is compact, thread safe and significantly faster to use than Linked Lists for nearly all list operations. Space usage can be reduced by 50% to 90% and in typical list operations speed improved by factors ranging from 4 to 20 or more. Some important operations such as indexing and length are typically changed from O(N) to O(1) and O(lgN) respectively. In the current form the VList structure can provide an alternative heap architecture for functional languages using eager evaluation. To prove the viability of the new structure a language interpreter Visp, a dialect of Common Lisp, has been implemented using VList and a simple benchmark comparison with OCAML reported.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Zhong Shao and John H. Reppy and Andrew W. Appel: Unrolling Lists. Conference record of the 1994 (ACM) Conference on Lisp and Functional Programming (1994) 185–191

    Google Scholar 

  2. Zhong Shao: Compiling Standard ML for Efficient Execution on Modern Machines (Thesis) TR-475-94 (1994) 169

    Google Scholar 

  3. WJ Hansen: Compact list representation: definition, garbage collection and system implementation. Communications of the ACM (1969) 12/9, 499

    Article  MATH  Google Scholar 

  4. D. W. Clark and C. C. Green: An empirical study of list structure in LISP. Communications of the ACM (Feb 1977) 20/2, 78–87

    Article  MATH  Google Scholar 

  5. Chris Okasaki: Purely Functional Random-Access Lists. Functional Programming Languages and Computer Architecture (1995) 86–95

    Google Scholar 

  6. K. Li and P. Hudak: A new list compaction method. Software-Practice and Experience (Feb 1986) 16/2, 145–163

    Article  MATH  Google Scholar 

  7. R Greenblatt: LISP Machine Progress Report memo 444 (Aug 1977) 169 A.I. Lab., M.I.T., Cambridge, Mass.

    Google Scholar 

  8. D.W. Clark: List Structure: Measurements, Algorithms, and Encodings, (Ph.D. Thesis Aug 1976) Dept. of Computer Science, Carnegie-Mellon University

    Google Scholar 

  9. D. G. Bobrow and D. W. Clark: Compact encoding of list structures. ACM Transactions on Programming Languages and Systems (Oct 1979) 1/2, 266–286

    Article  MATH  Google Scholar 

  10. Andrej Brodnik and Svante Carlsson and Erik D. Demaine and J. Ian Munro and Robert Sedgewick: Resizable Arrays in Optimal Time and Space. Workshop on Algorithms and Data Structures (1999) 37–48

    Google Scholar 

Download references

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bagwell, P. (2003). Fast Functional Lists. In: Peña, R., Arts, T. (eds) Implementation of Functional Languages. IFL 2002. Lecture Notes in Computer Science, vol 2670. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44854-3_3

Download citation

  • DOI: https://doi.org/10.1007/3-540-44854-3_3

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-40190-2

  • Online ISBN: 978-3-540-44854-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics