Haskell Boards the Ferry

Database-Supported Program Execution for Haskell
  • George Giorgidze
  • Torsten Grust
  • Tom Schreiber
  • Jeroen Weijers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6647)


Relational database management systems can be used as a coprocessor for general-purpose programming languages, especially for those program fragments that carry out data-intensive and data-parallel computations. In this paper we present a Haskell library for database-supported program execution. Data-intensive and data-parallel computations are expressed using familiar combinators from the standard list prelude and are entirely executed on the database coprocessor. Programming with the expressive list comprehension notation is also supported. The library, in addition to queries of basic types, supports computations over arbitrarily nested tuples and lists. The implementation avoids unnecessary data transfer and context switching between the database coprocessor and the programming language runtime by ensuring that the number of generated relational queries is only determined by the program fragment’s type and not by the database size.


Query Language Relational Query Relational Database Management System List Order Program Fragment 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
  2. 2.
    Database Supported Haskell,
  3. 3.
    The Glasgow Haskell Compiler,
  4. 4.
    Blelloch, G.E., Sabot, G.W.: Compiling Collection-Oriented Languages onto Massively Parallel Computers. Journal of Parallel and Distributed Computing 8, 119–134 (1990)CrossRefGoogle Scholar
  5. 5.
    Boncz, P.A., Kersten, M.L.: MIL primitives for querying a fragmented world. The VLDB Journal 8, 101–119 (1999)CrossRefGoogle Scholar
  6. 6.
    Chakravarty, M.M.T., Keller, G.: More Types for Nested Data Parallel Programming. In: Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP), Montreal, Canada, pp. 94–105. ACM, New York (2000)CrossRefGoogle Scholar
  7. 7.
    Chakravarty, M.M.T., Leshchinskiy, R., Jones, S.P., Keller, G., Marlow, S.: Data Parallel Haskell: a status report. In: Proceedings of the 2007 Workshop on Declarative Aspects of Multicore Programming (DAMP), Nice, France, pp. 10–18. ACM, New York (2007)Google Scholar
  8. 8.
    Cooper, E., Lindley, S., Wadler, P., Yallop, J.: Links: Web programming without tiers. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2006. LNCS, vol. 4709, pp. 266–296. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  9. 9.
    Giorgidze, G., Nilsson, H.: Mixed-level Embedding and JIT Compilation for an Iteratively Staged DSL. In: Mariño, J. (ed.) WFLP 2010. LNCS, vol. 6559, pp. 48–65. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  10. 10.
    Grust, T., Mayr, M., Rittinger, J.: Let SQL Drive the XQuery Workhorse (XQuery Join Graph Isolation). In: Proceedings of the 13th International Conference on Extending Database Technology (EDBT), Lausanne, Switzerland, pp. 147–158. ACM, New York (2010)CrossRefGoogle Scholar
  11. 11.
    Grust, T., Mayr, M., Rittinger, J., Sakr, S., Teubner, J.: A SQL: 1999 Code Generator for the Pathfinder XQuery Compiler. In: Proceedings of the 2007 ACM SIGMOD International Conference on Management of Data (SIGMOD), Beijing, China, pp. 1162–1164. ACM, New York (2007)CrossRefGoogle Scholar
  12. 12.
    Grust, T., Mayr, M., Rittinger, J., Schreiber, T.: FERRY: Database-Supported Program Execution. In: Proceedings of the 35th SIGMOD International Conference on Management of Data (SIGMOD), Providence, RI, USA, pp. 1063–1066. ACM, New York (2009)CrossRefGoogle Scholar
  13. 13.
    Grust, T., Rittinger, J., Schreiber, T.: Avalanche-Safe LINQ Compilation. In: Proceedings of the 36th International Conference on Very Large Databases (VLDB), Singapore, pp. 162–172. VLDB Endowment (September 2010)Google Scholar
  14. 14.
    Hudak, P.: Modular Domain Specific Languages and Tools. In: Proceedings of Fifth International Conference on Software Reuse (ICSR), pp. 134–142 (June 1998)Google Scholar
  15. 15.
    Jones, S.P., Leshchinskiy, R., Keller, G., Chakravarty, M.M.T.: Harnessing the Multicores: Nested Data Parallelism in Haskell. In: IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS), Bangalore, India, vol. 2, pp. 383–414 (2008) Schloss Dagstuhl–Leibniz-Zentrum fuer InformatikGoogle Scholar
  16. 16.
    Jones, S.P., Wadler, P.: Comprehensive Comprehensions. In: Proceedings of the ACM SIGPLAN Workshop on Haskell, Freiburg, Germany, pp. 61–72. ACM, New York (2007)CrossRefGoogle Scholar
  17. 17.
    Leijen, D., Meijer, E.: Domain Specific Embedded Compilers. In: Proceedings of the 2nd Conference on Domain-Specific Languages (DSL), Austin, Texas, United States, pp. 109–122. ACM, New York (1999)CrossRefGoogle Scholar
  18. 18.
    Limsoon, W.: Kleisli, a functional query system. Journal of Functional Programming 10, 19–56 (2000)CrossRefGoogle Scholar
  19. 19.
    Mainland, G.: Why It’s Nice to be Quoted: Quasiquoting for Haskell. In: Proceedings of the ACM SIGPLAN Workshop on Haskell, Freiburg, Germany, pp. 73–82. ACM, New York (2007)CrossRefGoogle Scholar
  20. 20.
    Mainland, G., Morrisett, G.: Nikola: Embedding Compiled GPU Functions in Haskell. In: Proceedings of the Third ACM Haskell Symposium on Haskell, Baltimore, Maryland, USA, pp. 67–78. ACM, New York (2010)CrossRefGoogle Scholar
  21. 21.
    Meijer, E., Beckman, B., Bierman, G.: LINQ: Reconciling Objects, Relations and XML in the NET Framework. In: Proceedings of the 2006 ACM SIGMOD International Conference on Management of Data (SIGMOD), Chicago, IL, USA, pp. 706–706. ACM, New York (2006)CrossRefGoogle Scholar
  22. 22.
    Peterson, J., Hammond, K.: Haskell 1.4: A Non-strict, Purely Functional Language. Technical Report YALEU/DCS/RR-1106, Department of Computer Science. Yale University (1997)Google Scholar
  23. 23.
    Jones, S.P. (ed.): Haskell 98 Language and Libraries – The Revised Report. Cambridge University Press, Cambridge (2003)zbMATHGoogle Scholar
  24. 24.
    Rhiger, M.: A Foundation for Embedded Languages. ACM Transactions on Programming Languages and Systems (TOPLAS) 25, 291–315 (2003)CrossRefGoogle Scholar
  25. 25.
    Sheard, T., Jones, S.P.: Template Meta-programming for Haskell. In: Proceedings of the ACM SIGPLAN Workshop on Haskell, Pittsburgh, PA, USA, pp. 1–16. ACM, New York (October 2002)CrossRefGoogle Scholar
  26. 26.
    Syme, D.: Leveraging.NET Meta-programming Components from F#: Integrated Queries and Interoperable Heterogeneous Execution. In: Proceedings of the 2006 Workshop on ML, Portland, Oregon, USA, pp. 43–54. ACM, New York (2006)CrossRefGoogle Scholar
  27. 27.
    Van den Bussche, J.: Simulation of the nested relational algebra by the flat relational algebra, with an application to the complexity of evaluating powerset algebra expressions. Theoretical Computer Science 254, 363–377 (2001)MathSciNetCrossRefzbMATHGoogle Scholar
  28. 28.
    Wadler, P.: Views: A way for pattern matching to cohabit with data abstraction. In: Proceedings of the 14th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL), Munich, West Germany, pp. 307–313. ACM, New York (1987)CrossRefGoogle Scholar
  29. 29.
    Wadler, P.: Comprehending monads. In: Proceedings of the 1990 ACM Conference on LISP and Functional Programming (LFP), Nice, France, pp. 61–78. ACM, New York (1990)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • George Giorgidze
    • 1
  • Torsten Grust
    • 1
  • Tom Schreiber
    • 1
  • Jeroen Weijers
    • 1
  1. 1.Wilhelm-Schickard-Institut für InformatikEberhard Karls Universität TübingenGermany

Personalised recommendations