skip to main content
10.1145/1273920.1273942acmconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
Article

Putting declarative programming into the web: translating curry to javascript

Published:14 July 2007Publication History

ABSTRACT

We propose a framework to construct web-oriented user interfaces in a high-level way by exploiting declarative programming techniques. Such user interfaces are intended to manipulate complex data in a type-safe way, i.e., it is ensured that only typecorrect data is accepted by the interface, where types can be specified by standard types of a programming language as well as any computable predicate on the data. The interfaces are web based, i.e., the data can be manipulated with standard web browsers without any specific requirements on the client side. However, if the client's browser has JavaScript enabled, one could also check the correctness of the data on the client side providing immediate feedback to the user. In order to release the application programmer from the tedious details to interact with JavaScript, we propose an approach where the programmer must only provide a declarative description of the requirements of the user interface from which the necessary JavaScript programs and HTML forms are automatically generated. This approach leads to a very concise and maintainable implementation of web-based user interfaces. We demonstrate an implementation of this concept in the declarative multi-paradigm language Curry where the integrated functional and logic features are exploited to enable the high level of abstraction proposed in this paper.

References

  1. E. Albert, M. Hanus, F. Huch, J. Oliver, and G. Vidal. Operational Semantics for Declarative Multi-Paradigm Languages. Journal of Symbolic Computation, Vol. 40, No. 1, pp. 795--829, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Antoy. Definitional Trees. In Proc. of the 3rd International Conference on Algebraic and Logic Programming, pp. 143--157. Springer LNCS 632, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Antoy. Constructor-based Conditional Narrowing. In Proc. of the 3rd International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP 2001), pp. 199--206. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, Vol. 47, No. 4, pp. 776--822, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. Antoy and M. Hanus. Functional Logic Design Patterns. In Proc. of the 6th International Symposium on Functional an Logic Programming (FLOPS 2002), pp. 67--87. Springer LNCS 2441, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Antoy and M. Hanus. Overlapping Rules and Logic Variables in Functional Logic Programs. In Proceedings of the 22nd International Conference on Logic Programming (ICLP 2006), pp. 87--101. Springer LNCS 4079, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. C. Brabrand, A. Møller, M. Ricky, and M. I. Schwartzbach. Power-Forms: Declarative Client-side Form Field Validation. World Wide Web Journal, Vol. 3, No. 4, pp. 205--214, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Brabrand, A. Møller, and M. I. Schwartzbach. The <bigwig> Project. ACM Transactions on Internet Technology, Vol. 2, No. 2, pp. 79--114, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Cabeza and M. Hermenegildo. Internet and WWW Programming using Computational Logic Systems. In Workshop on Logic Programming and the Internet, 1996. See also http://clip.dia.fi.upm.es/Software/pillow/.Google ScholarGoogle Scholar
  10. J. Correas, J. M. Gómez, M. Carro, D. Cabeza, and M. Hermenegildo. A Generic Persistence Model for (C)LP Systems (and Two Useful Implementations). In Proc. of the Sixth International Symposium on Practical Aspects of Declarative Languages (PADL'04), pp. 104--119. Springer LNCS 3057, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  11. D. Coutts, D. Stewart, and R. Leshchinsky. Rewriting Haskell Strings. In Proc. 9th International Symposium on Practical Aspects of Declarative Languages (PADL 2007), pp. 50--64. Springer LNCS 4354, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Fischer. A Functional Logic Database Library. In Proc. of the ACM SIGPLAN 2005 Workshop on Curry and Functional Logic Programming (WCFLP 2005), pp. 54--59. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. Flanagan. JavaScript: The Definitive Guide. O'Reilly, 5th edition edition, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. Giesl, P. Schneider-Kamp, and R. Thiemann. AProVE 1.2: Automatic Termination Proofs in the Dependency Pair Framework. In Proceedings of the 3rd International Joint Conference on Automated Reasoning (IJCAR '06), pp. 281--286. Springer LNCS 4130, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming, Vol. 19&20, pp. 583--628, 1994.Google ScholarGoogle Scholar
  16. M. Hanus. A Unified Computation Model for Functional and Logic Programming. In Proc. of the 24th ACM Symposium on Principles of Programming Languages (Paris), pp. 80--93, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Hanus. High-Level Server Side Web Scripting in Curry. In Proc. of the Third International Symposium on Practical Aspects of Declarative Languages (PADL'01), pp. 76--92. Springer LNCS 1990, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Hanus. Dynamic Predicates in Functional Logic Programs. Journal of Functional and Logic Programming, Vol. 2004, No. 5, 2004.Google ScholarGoogle Scholar
  19. M. Hanus. CurryBrowser: A Generic Analysis Environment for Curry Programs. In Proc. of the 16th Workshop on Logic-based Methods in Programming Environments (WLPE'06), pp. 61--74, 2006.Google ScholarGoogle Scholar
  20. M. Hanus. Reporting Failures in Functional Logic Programs. In Proc. of the 15th International Workshop on Functional and (Constraint) Logic Programming (WFLP 2006), pp. 49--62, 2006.Google ScholarGoogle Scholar
  21. M. Hanus. Type-Oriented Construction of Web User Interfaces. In Proceedings of the 8th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP'06), pp. 27--38. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Hanus, S. Antoy, B. Braßel, M. Engelke, K. Höppner, J. Koj, P. Niederau, R. Sadre, and F. Steiner. PAKCS: The Portland Aachen Kiel Curry System. Available at http://www.informatik.uni-kiel.de/~pakcs/, 2007.Google ScholarGoogle Scholar
  23. M. Hanus and C. Prehofer. Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming, Vol. 9, No. 1, pp. 33--75, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Hanus (ed.). Curry: An Integrated Functional Logic Language (Vers. 0.8.2). Available at http://www.informatik.uni-kiel.de/~curry, 2006.Google ScholarGoogle Scholar
  25. S. H. Huseby. Innocent Code: A Security Wake-Up Call for Web Programmers. Wiley, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. Johnsson. Lambda Lifting: Transforming Programs to Recursive Functions. In Functional Programming Languages and Computer Architecture, pp. 190--203. Springer LNCS 201, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. D. A. Ladd and J. C. Ramming. Programming the Web: An Application-Oriented Language for Hypermedia Services. In 4th International World Wide Web Conference, 1995.Google ScholarGoogle Scholar
  28. F. Lóopez-Fraguas and J. Sánchez-Hernández. TOY: A Multiparadigm Declarative System. In Proc. of RTA'99, pp. 244--247. Springer LNCS 1631, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. E. Meijer. Server Side Web Scripting in Haskell. Journal of Functional Programming, Vol. 10, No. 1, pp. 1--18, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. S. Peyton Jones, editor. Haskell 98 Language and Libraries -The Revised Report. Cambridge University Press, 2003.Google ScholarGoogle Scholar
  31. R. Plasmeijer and P. Achten. The Implementation of iData -A Case Study in Generic Programming. In Proc. of the 17th International Workshop on Implementation and Application of Functional Languages (IFL 2005). Trinity College, University of Dublin, Technical Report TCD-CS-2005-60, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. R. Plasmeijer and P. Achten. iData for the World Wide Web - Programming Interconnected Web Forms. In Proc. of the 8th International Symposium on Functional and Logic Programming (FLOPS 2006), pp. 242--258. Springer LNCS 3945, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. A. Sandholm and M. I. Schwartzbach. A Type System for Dynamic Web Documents. In Proc. of the 27th ACM Symposium on Principles of Programming Languages, pp. 290--301, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. P. Thiemann. Modelling HTML in Haskell. In International Workshop on Practical Aspects of Declarative Languages (PADL' 00), pp. 263--277. Springer LNCS 1753, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. P. Thiemann. WASH/CGI: Server-side Web Scripting with Sessions and Typed, Compositional Forms. In 4th International Symposium on Practical Aspects of Declarative Languages (PADL 2002), pp. 192--208. Springer LNCS 2257, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. P. Wadler. How to Declare an Imperative. ACM Computing Surveys, Vol. 29, No. 3, pp. 240--263, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Putting declarative programming into the web: translating curry to javascript

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                PPDP '07: Proceedings of the 9th ACM SIGPLAN international conference on Principles and practice of declarative programming
                July 2007
                240 pages
                ISBN:9781595937698
                DOI:10.1145/1273920

                Copyright © 2007 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 14 July 2007

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • Article

                Acceptance Rates

                Overall Acceptance Rate230of486submissions,47%

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader