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.
- 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 ScholarDigital Library
- S. Antoy. Definitional Trees. In Proc. of the 3rd International Conference on Algebraic and Logic Programming, pp. 143--157. Springer LNCS 632, 1992. Google ScholarDigital Library
- 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 ScholarDigital Library
- S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, Vol. 47, No. 4, pp. 776--822, 2000. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- D. Flanagan. JavaScript: The Definitive Guide. O'Reilly, 5th edition edition, 2006. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- M. Hanus. Dynamic Predicates in Functional Logic Programs. Journal of Functional and Logic Programming, Vol. 2004, No. 5, 2004.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
- M. Hanus and C. Prehofer. Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming, Vol. 9, No. 1, pp. 33--75, 1999. Google ScholarDigital Library
- M. Hanus (ed.). Curry: An Integrated Functional Logic Language (Vers. 0.8.2). Available at http://www.informatik.uni-kiel.de/~curry, 2006.Google Scholar
- S. H. Huseby. Innocent Code: A Security Wake-Up Call for Web Programmers. Wiley, 2003. Google ScholarDigital Library
- T. Johnsson. Lambda Lifting: Transforming Programs to Recursive Functions. In Functional Programming Languages and Computer Architecture, pp. 190--203. Springer LNCS 201, 1985. Google ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- E. Meijer. Server Side Web Scripting in Haskell. Journal of Functional Programming, Vol. 10, No. 1, pp. 1--18, 2000. Google ScholarDigital Library
- S. Peyton Jones, editor. Haskell 98 Language and Libraries -The Revised Report. Cambridge University Press, 2003.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- P. Wadler. How to Declare an Imperative. ACM Computing Surveys, Vol. 29, No. 3, pp. 240--263, 1997. Google ScholarDigital Library
Index Terms
- Putting declarative programming into the web: translating curry to javascript
Recommendations
Type-oriented construction of web user interfaces
PPDP '06: Proceedings of the 8th ACM SIGPLAN international conference on Principles and practice of declarative programmingThis paper proposes a new technique for the high-level construction of type-safe web-oriented user interfaces. Our approach is useful to equip applications processing structured data with interfaces to manipulate these data in an efficient and ...
Flapjax: a programming language for Ajax applications
OOPSLA '09: Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applicationsThis paper presents Flapjax, a language designed for contemporary Web applications. These applications communicate with servers and have rich, interactive interfaces. Flapjax provides two key features that simplify writing these applications. First, it ...
Flapjax: a programming language for Ajax applications
OOPSLA '09This paper presents Flapjax, a language designed for contemporary Web applications. These applications communicate with servers and have rich, interactive interfaces. Flapjax provides two key features that simplify writing these applications. First, it ...
Comments