A New Functional-Logic Compiler for Curry: Sprite

  • Sergio AntoyEmail author
  • Andy Jost
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10184)


We introduce a new native code compiler for Curry codenamed Sprite. Sprite is based on the Fair Scheme, a compilation strategy that provides instructions for transforming declarative, non-deterministic programs of a certain class into imperative, deterministic code. We outline salient features of Sprite, discuss its implementation of Curry programs, and present benchmarking results. Sprite is the first-to-date operationally complete implementation of Curry. Preliminary results show that ensuring this property does not incur a significant penalty.


Functional logic programming Compiler implementation Operational completeness 


  1. 1.
    Antoy, S.: Definitional trees. In: Kirchner, H., Levi, G. (eds.) ALP 1992. LNCS, vol. 632, pp. 143–157. Springer, Heidelberg (1992). doi: 10.1007/BFb0013825 CrossRefGoogle Scholar
  2. 2.
    Antoy, S.: On the correctness of pull-tabbing. TPLP 11(4–5), 713–730 (2011)MathSciNetzbMATHGoogle Scholar
  3. 3.
    Antoy, S., Hanus, M.: Declarative programming with function patterns. In: Hill, P.M. (ed.) LOPSTR 2005. LNCS, vol. 3901, pp. 6–22. Springer, Heidelberg (2006). doi: 10.1007/11680093_2 CrossRefGoogle Scholar
  4. 4.
    Antoy, S., Hanus, M.: Overlapping rules and logic variables in functional logic programs. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 87–101. Springer, Heidelberg (2006). doi: 10.1007/11799573_9 CrossRefGoogle Scholar
  5. 5.
    Antoy, S., Hanus, M.: Functional logic programming. Commun. ACM 53(4), 74–85 (2010)CrossRefGoogle Scholar
  6. 6.
    Antoy, S., Johannsen, J., Libby, S.: Needed computations shortcutting needed steps. In: Middeldorp, A., van Raamsdonk, F. (eds.) Proceedings 8th International Workshop on Computing with Terms and Graphs, Vienna, 13 July 2014. Electronic Proceedings in Theoretical Computer Science, vol. 183, pp. 18–32. Open Publishing Association (2015)Google Scholar
  7. 7.
    Antoy, S., Jost, A.: Compiling a functional logic language: the fair scheme. In: 23rd International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR 2013), Madrid, pp. 129–143. Dpto. de Systems Informaticos y Computation, Universidad Complutense de Madrid, TR-11-13, September 2013Google Scholar
  8. 8.
    Braßel, B., Hanus, M., Peemöller, B., Reck, F.: KiCS2: a new compiler from Curry to Haskell. In: Kuchen, H. (ed.) WFLP 2011. LNCS, vol. 6816, pp. 1–18. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-22531-4_1 CrossRefGoogle Scholar
  9. 9.
    Braßel, B., Huch, F.: On a tighter integration of functional and logic programming. In: Shao, Z. (ed.) APLAS 2007. LNCS, vol. 4807, pp. 122–138. Springer, Heidelberg (2007). doi: 10.1007/978-3-540-76637-7_9 CrossRefGoogle Scholar
  10. 10.
    Caballero, R., Sánchez, J. (eds.): TOY: a multiparadigm declarative language (version 2.3.1) (2007).
  11. 11.
    Clang: a C language family frontend for LLVM (2016).
  12. 12.
    Echahed, R., Janodet, J.C.: On constructor-based graph rewriting systems. Technical report 985-I, IMAG (1997).
  13. 13.
    The Glasgow Haskell Compiler (2013).
  14. 14.
    Gill, A., Launchbury, J., Jones, S.L.P.: A short cut to deforestation. In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture, pp. 223–232. ACM (1993)Google Scholar
  15. 15.
    Glauert, J.R.W., Kennaway, R., Papadopoulos, G.A., Sleep, M.R.: Dactl: an experimental graph rewriting language. J. Prog. Lang. 5(1), 85–108 (1997)Google Scholar
  16. 16.
    Hanus, M. (ed.): Curry: an integrated functional logic language (Vers. 0.8.2) (2006).
  17. 17.
    Hanus, M.: Flatcurry: an intermediate representation for Curry programs (2008).
  18. 18.
    Hanus, M.: Functional logic programming: from theory to Curry. In: Voronkov, A., Weidenbach, C. (eds.) Programming Logics - Essays in Memory of Harald Ganzinger. LNCS, vol. 7797, pp. 123–168. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-37651-1_6 CrossRefGoogle Scholar
  19. 19.
    Hanus, M. (ed.): PAKCS 1.11.4: The Portland Aachen Kiel Curry system (2014).
  20. 20.
    Jones, S.L.P.: Compiling Haskell by program transformation: a report from the trenches. In: Nielson, H.R. (ed.) ESOP 1996. LNCS, vol. 1058, pp. 18–44. Springer, Heidelberg (1996). doi: 10.1007/3-540-61055-3_27 CrossRefGoogle Scholar
  21. 21.
    Jones, S.P., Santos, A.: Compilation by transformation in the Glasgow Haskell compiler. In: Hammond, K., Turner, D.N., Sansom, P.M. (eds.) Glasgow 1994, pp. 184–204. Springer, London (1995). doi: 10.1007/978-1-4471-3573-9_13 Google Scholar
  22. 22.
    Lattner, C., Adve, V.: LLVM: a compilation framework for lifelong program analysis and transformation. In: Proceedings of the International Symposium on Code Generation and Optimization: Feedback-Directed and Runtime Optimization (CGO 2004), San Jose, pp. 75–88, March 2004Google Scholar
  23. 23.
    López-Fraguas, F.J., de Dios-Castro, J.: Extra variables can be eliminated from functional logic programs. Electron. Notes Theor. Comput. Sci. 188, 3–19 (2007)CrossRefzbMATHGoogle Scholar
  24. 24.
    López Fraguas, F.J., Sánchez Hernández, J.: TOY: a multiparadigm declarative system. In: Narendran, P., Rusinowitch, M. (eds.) RTA 1999. LNCS, vol. 1631, pp. 244–247. Springer, Heidelberg (1999). doi: 10.1007/3-540-48685-2_19 CrossRefGoogle Scholar
  25. 25.
    Lux, W. (ed.): The Muenster Curry compiler (2012).
  26. 26.
    Marlow, S., Jones, S.P.: Making a fast Curry: push/enter vs. eval/apply for higher-order languages. In: Proceedings of the Ninth ACM SIGPLAN International Conference on Functional Programming (ICFP 2004), New York, pp. 4–15. ACM (2004)Google Scholar
  27. 27.
    Partain, W.: The nofib benchmark suite of Haskell programs. In: Launchbury, J., Sansom, P. (eds.) Glasgow 1992, pp. 195–202. Springer, London (1993)Google Scholar
  28. 28.
    Jones, S.L.P., Salkild, J.: The spineless tagless G-machine. In: Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture, pp. 184–201. ACM (1989)Google Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.Department of Computer SciencePortland State UniversityPortlandUSA

Personalised recommendations