Hostname: page-component-586b7cd67f-t8hqh Total loading time: 0 Render date: 2024-11-22T18:55:08.612Z Has data issue: false hasContentIssue false

Causal commutative arrows

Published online by Cambridge University Press:  29 June 2011

HAI LIU
Affiliation:
Department of Computer Science, Yale University, New Haven, CT 06520, USA (e-mail: [email protected], [email protected], [email protected])
ERIC CHENG
Affiliation:
Department of Computer Science, Yale University, New Haven, CT 06520, USA (e-mail: [email protected], [email protected], [email protected])
PAUL HUDAK
Affiliation:
Department of Computer Science, Yale University, New Haven, CT 06520, USA (e-mail: [email protected], [email protected], [email protected])
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Arrows are a popular form of abstract computation. Being more general than monads, they are more broadly applicable, and, in particular, are a good abstraction for signal processing and dataflow computations. Most notably, arrows form the basis for a domain-specific language called Yampa, which has been used in a variety of concrete applications, including animation, robotics, sound synthesis, control systems, and graphical user interfaces. Our primary interest is in better understanding the class of abstract computations captured by Yampa. Unfortunately, arrows are not concrete enough to do this with precision. To remedy this situation, we introduce the concept of commutative arrows that capture a noninterference property of concurrent computations. We also add an init operator that captures the causal nature of arrow effects, and identify its associated law. To study this class of computations in more detail, we define an extension to arrows called causal commutative arrows (CCA), and study its properties. Our key contribution is the identification of a normal form for CCA called causal commutative normal form (CCNF). By defining a normalization procedure, we have developed an optimization strategy that yields dramatic improvements in performance over conventional implementations of arrows. We have implemented this technique in Haskell, and conducted benchmarks that validate the effectiveness of our approach. When compiled with the Glasgow Haskell Compiler (GHC), the overall methodology can result in significant speedups.

Type
Articles
Copyright
Copyright © Cambridge University Press 2011

References

Amagbegnon, P., Besnard, L., & Guernic, P. L. (1995) Implementation of the data-flow synchronous language SIGNAL. In Conference on Programming Language Design and Implementation. ACM, pp. 163173.Google Scholar
Atkey, R. (2008) What is a categorical model of arrows? In Proceedings of the Second Workshop on Mathematically Structured Functional Programming. vol. 229 pp. 19–37.Google Scholar
Bjesse, P., Claessen, K., Sheeran, M., & Singh, S. (1998) Lava: Hardware design in Haskell. In Proceedings of International Conference on Functional Programming (ICFP). ACM, pp. 174184.Google Scholar
Burchett, K., Cooper, G. H. & Krishnamurthi, S. (2007) Lowering: A static optimization technique for transparent functional reactivity. In ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation. ACM, pp. 7180.Google Scholar
Caspi, P., Halbwachs, N., Pilaud, D. & Plaice, J. A. (1987) LUSTRE: A declarative language for programming synchronous systems. In Proceedings of the 14th ACM Symposium on Principles of Programming Languages (POPL). ACM, pp. 178188.Google Scholar
Caspi, P. & Pouzet, M. (1998) A co-iterative characterization of synchronous stream functions. In Coalgebraic Methods in Computer Science (CMCS). Electronic Notes in Theoretical Computer Science. Elsevier. Extended version available as a VERIMAG Tech. Rep. no. 97–07 at www.lri.fr/~pouzet. pp. 121.Google Scholar
Cheng, E. & Hudak, P. (2009) Audio Processing and Sound Synthesis in Haskell. Tech. Rep. YALEU/DCS/RR-1405. Computer Science Department, Yale University, New Heaven, CT. Also see http://haskell.cs.yale.edu.Google Scholar
Cheong, M. H. (2005) Functional Programming and 3D Games. M.Phil. thesis, University of New South Wales, Sydney, Australia. Also see http://www.haskell.org/haskellwiki/Frag.Google Scholar
Colaço, J.-L., Girault, A., Hamon, G., & Pouzet, M. (2004) Towards a higher-order synchronous data-flow language. In Proceedings of the 4th ACM International Conference on Embedded Software (EMSOFT). New York: ACM, pp. 230239.CrossRefGoogle Scholar
Courtney, A. (2004) Modelling User Interfaces in a Functional Language. PhD thesis, Department of Computer Science, Yale University, New Heaven, CT.Google Scholar
Courtney, A. & Elliott, C. (2001) Genuinely functional user interfaces. In Proceedings of the 2001 ACM SIGPLAN Haskell Workshop. ACM, pp. 4169.Google Scholar
Courtney, A., Nilsson, H. & Peterson, J. (2003) The Yampa arcade. In Proceedings of the 2003 ACM SIGPLAN Haskell Workshop. Uppsala, Sweden: ACM, pp. 718.Google Scholar
Coutts, D., Leshchinskiy, R. & Stewart, D. (2007) Stream fusion: From lists to streams to nothing at all. In Proceedings of the International Conference on Functional Programming (ICFP). ACM. pp. 315326.Google Scholar
Elliott, C. & Hudak, P. (1997) Functional reactive animation. In Proceedings of the International Conference on Functional Programming (ICFP). ACM, pp. 263273.Google Scholar
Giorgidze, G. & Nilsson, H. (2008) Switched-on Yampa. In Proceedings, Hudak, P. & Warren, D. S. (eds), Lecture Notes in Computer Science, vol. 4902. San Francisco, CA: Springer, pp. 282298.Google Scholar
Goertzel, G. (1958) An algorithm for the evaluation of finite trigonometric series. Am. Math. Mon. 65 (Jan.), 3435.Google Scholar
Halbwachs, N., Raymond, P. & Ratel, C. (1991) Generating efficient code from data-flow programs. In Proceedings of the Third International Symposium on Programming Language Implementation and Logic Programming, Maluszyński, J. & Wirsing, M. (eds). Springer-Verlag, pp. 207218.CrossRefGoogle Scholar
Harel, D. (1980) On folk theorems. Commun. ACM 23 (July), 379389.CrossRefGoogle Scholar
Hasegawa, M. (1997) Recursion from cyclic sharing: Traced monoidal categories and models of cyclic lambda calculi. In Proceedings of the Third International Conference on Typed Lambda Calculi and Applications (TLCA). London: Springer-Verlag, pp. 196213.Google Scholar
Huang, L., Hudak, P. & Peterson, J. (2007) HPorter: Using arrows to compose parallel processes. In Proceedings of Practical Aspects of Declarative Languages (PADL). Springer-Verlag, pp. 275289.Google Scholar
Hudak, P. (1996) Building domain specific embedded languages. ACM Computing Surveys, 28A, (electronic).Google Scholar
Hudak, P. (1998) Modular domain specific languages and tools. In Proceedings of Fifth International Conference on Software Reuse. IEEE Computer Society, pp. 134142.Google Scholar
Hudak, P., Courtney, A., Nilsson, H. & Peterson, J. (2003) Arrows, robots, and functional reactive programming. In Summer School on Advanced Functional Programming (AFP 2002), Oxford University. Lecture Notes in Computer Science, vol. 2638. Springer-Verlag, pp. 159187.CrossRefGoogle Scholar
Hudak, P., Liu, H., Stern, M & Agarwal, A. 2008 (July). Yampa Meets the Worm. Tech. Rep. YALEU/DCS/RR-1408. Yale University, New Heaven, CT. Also see http://haskell.cs.yale.edu.Google Scholar
Hughes, J. (2000) Generalising monads to arrows. Sci. Comput. Program. 37 (1-3), 67111.Google Scholar
Hughes, J. (2004) Programming with arrows. In Advanced Functional Programming, Vene, V. & Uustalu, T. (eds), Lecture Notes in Computer Science, vol. 3622. Springer, pp. 73129.Google Scholar
Jansson, P. & Jeuring, J. (1999) Polytypic compact printing and parsing. In European Symposium on Programming (ESOP), Swierstra, S. D. (ed), Lecture Notes in Computer Science, vol. 1576. Springer, pp. 273287.Google Scholar
Lindley, S., Wadler, P. & Yallop, J. (2010) The arrow calculus (functional pearl). J. Funct. Program. 20 (1), 5169.Google Scholar
Liu, H. & Hudak, P. (2007) Plugging a space leak with an arrow. Electron. Notes Theor. Comput. Sci. 193, 2945.Google Scholar
Liu, H. & Hudak, P. (2010) An ode to arrows. In Proceedings of the 12th International Symposium on Practical Aspects of Declarative Languages (PADL), Madrid, Spain, January 18–19, 2010, Carro, M. & Peña, R. (eds), Lecture Notes in Computer Science, vol. 5937. Springer, pp. 152166.Google Scholar
Lublinerman, R., Szegedy, C. & Tripakis, S. (2009) Modular code generation from synchronous block diagrams: Modularity vs. code size. In Proceedings of the 36th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL '09. New York: ACM, pp. 7889.Google Scholar
Lublinerman, R. & Tripakis, S. (2008) Modularity vs. reusability: Code generation from synchronous block diagrams. In Proceedings of the Conference on Design, Automation and Test in Europe. DATE '08. New York: ACM, pp. 15041509.Google Scholar
McBride, C. & Paterson, R. (2008) Applicative programming with effects. J. Funct. Program. 18 (1), 113.CrossRefGoogle Scholar
Mealy, G. H. (1955) A method for synthesizing sequential circuits. Bell Syst. Tech. J. 34 (5), 10451079.Google Scholar
Moggi, E. (1991) Notions of computation and monads. Inf. Comput. 93 (1), 5592.Google Scholar
Nilsson, H. (2005) Dynamic optimization for functional reactive programming using generalized algebraic data types. In Proceedings of International Conference on Functional Programming (ICFP). ACM, pp. 5465.Google Scholar
Oertel, C. 2006 (May). RatTracker: A Functional-Reactive Approach to Flexible Control of Behavioural Conditioning Experiments. PhD thesis, Wilhelm-Schickard-Institute for Computer Science at the University of Tübingen, Tübingen, Germany.Google Scholar
Paterson, R. (2001) A new notation for arrows. In Proceedings of International Conference on Functional Programming (ICFP). ACM, pp. 229240.Google Scholar
Peterson, J., Hager, G. & Hudak, P. (1999a) A language for declarative robotic programming. In International Conference on Robotics and Automation, IEEE pp. 11441151.Google Scholar
Peterson, J., Hudak, P. & Elliott, C. (1999b) Lambda in motion: Controlling robots with Haskell. In Proceedings of the First International Workshop on Practical Aspects of Declarative Languages (PADL). ACM, pp. 91105.Google Scholar
PeytonJones, Simon Jones, Simon et al. , (2003) The Haskell 98 language and libraries: The revised report. J. Funct. Program. 13 (1), 0255.Google Scholar
Pouzet, M. & Raymond, P. (2009) Modular static scheduling of synchronous data-flow networks: an efficient symbolic representation. In Proceedings of the seventh ACM International Conference on Embedded Software. EMSOFT '09. New York: ACM, pp. 215224.Google Scholar
Power, J. & Thielecke, H. (1999) Closed freyd- and kappa-categories. In Proceedings of 26th International Colloquium on Automata, Languages and Programming (ICALP), Springer-Verlag pp. 625634.Google Scholar
Raymond, P. (1988) Compilation séparée de programmes lustre. Master's thesis. IMAG (in French).Google Scholar
Rutten, J. J. M. M. (2006) Algebraic specification and coalgebraic synthesis of mealy automata. Electron. Notes Theor. Comput. Sci., 160, 305319.Google Scholar
Sculthorpe, N. & Nilsson, H. (2008) Optimisation of dynamic, hybrid signal function networks. In Proceedings of the 9th Symposium on Trends in Functional Programming (TFP). Intellect, pp. 97–112.Google Scholar
Sheard, T. & PeytonJones, S. Jones, S. (2002) Template metaprogramming for Haskell. In Proceedings of the 2002 ACM SIGPLAN Haskell Workshop, Chakravarty, M. M. T. (ed). ACM, pp. 116.Google Scholar
Stephens, R. (1997) A survey of stream processing. Acta Inform. 34 (7), 491541.Google Scholar
Street, R. H., Joyal, A. & Verity, D. (1996) Traced monoidal categories. Math. Proc. Camb. Phil. Soc. 119 (3), 425446.Google Scholar
Thies, W., Karczmarek, M. & Amarasinghe, S. P. (2002) StreamIt: A language for streaming applications. In Proceedings of the 11th International Conference on Compiler Construction (CC). London: Springer-Verlag, 179196.Google Scholar
Uustalu, T. & Vene, V. (2005) The essence of dataflow programming. In Central European Functional Programming School (CEFP), Horváth, Z. (ed), Lecture Notes in Computer Science, vol. 4164. Springer, pp. 135167.Google Scholar
Wadge, W. W., & Ashcroft, E. A. (1985) LUCID, the Dataflow Programming Language. San Diego, CA: Academic Press Professional, Inc.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.