[go: up one dir, main page]

Skip to main content

Faster Coroutine Pipelines: A Reconstruction

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2019)

Abstract

Spivey has recently presented a novel functional representation that supports the efficient composition, or merging, of coroutine pipelines for processing streams of data. This representation was inspired by Shivers and Might’s three-continuation approach and is shown to be equivalent to a simple yet inefficient executable specification. Unfortunately, neither Shivers and Might’s original work nor the equivalence proof sheds much light on the underlying principles allowing the derivation of this efficient representation from its specification.

This paper gives the missing insight by reconstructing a systematic derivation in terms of known transformation steps from the simple specification to the efficient representation. This derivation sheds light on the limitations of the representation and on its applicability to other settings. In particular, it has enabled us to obtain a similar representation for pipes featuring two-way communication, similar to the Haskell pipes library. Our benchmarks confirm that this two-way representation retains the same improved performance characteristics.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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 EPUB and 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

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    http://www.cs.kuleuven.be/publicaties/rapporten/cw/CW715.abs.html.

  2. 2.

    The benchmarks are at https://github.com/rubenpieters/orth-pipes-bench.

  3. 3.

    https://github.com/rubenpieters/Orthogonal-Pipes.

References

  1. Böhm, C., Berarducci, A.: Automatic synthesis of typed lambda-programs on term algebras. Theor. Comput. Sci. 39, 135–154 (1985). https://doi.org/10.1016/0304-3975(85)90135-5

    Article  MATH  Google Scholar 

  2. Church, A.: The Calculi of Lambda-Conversion. Princeton University Press, Princeton (1941)

    MATH  Google Scholar 

  3. Claessen, K.: Parallel parsing processes. J. Funct. Program. 14(6), 741–757 (2004). https://doi.org/10.1017/S0956796804005192

    Article  MATH  Google Scholar 

  4. Ghani, N., Uustalu, T., Vene, V.: Build, augment and destroy, universally. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 327–347. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-30477-7_22

    Chapter  MATH  Google Scholar 

  5. Gonzalez, G.: Haskell Pipes library (2012). http://hackage.haskell.org/package/pipes

  6. Kammar, O., Lindley, S., Oury, N.: Handlers in action. In: Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, ICFP 2013, pp. 145–158. ACM, New York (2013) https://doi.org/10.1145/2500365.2500590

  7. Lindley, S., McBride, C., McLaughlin, C.: Do be do be do. In: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, pp. 500–514. ACM, New York (2017). https://doi.org/10.1145/3009837.3009897

  8. Mogensen, T.: Efficient self-interpretation in lambda calculus. J. Funct. Program. 2(3), 345–364 (1992). https://doi.org/10.1017/S0956796800000423

    Article  MathSciNet  MATH  Google Scholar 

  9. O’Sullivan, B.: Haskell Criterion library (2009). http://hackage.haskell.org/package/criterion

  10. Shivers, O., Might, M.: Continuations and transducer composition. In: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2006, pp. 295–307. ACM, New York (2006). https://doi.org/10.1145/1133981.1134016

  11. Snoyman, M.: Haskell Conduit library (2011). http://hackage.haskell.org/package/conduit

  12. Spivey, M.: Faster coroutine pipelines. In: Proceedings of the ACM Programming Languages, 1(ICFP), 5:1–5:23, August 2017. https://doi.org/10.1145/3110249

    Article  Google Scholar 

Download references

Acknowledgements

We would like to thank Nicolas Wu, Alexander Vandenbroucke and the anonymous PADL reviewers for their feedback. This work was partly funded by the Flemish Fund for Scientific Research (FWO).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ruben P. Pieters .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Pieters, R.P., Schrijvers, T. (2019). Faster Coroutine Pipelines: A Reconstruction. In: Alferes, J., Johansson, M. (eds) Practical Aspects of Declarative Languages. PADL 2019. Lecture Notes in Computer Science(), vol 11372. Springer, Cham. https://doi.org/10.1007/978-3-030-05998-9_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-05998-9_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-05997-2

  • Online ISBN: 978-3-030-05998-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics