Putting declarative programming into the web: translating curry to javascript

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.

[1]  Manuel V. Hermenegildo,et al.  The PiLLoW/Ciao library for INTERNET/WWW programming using computational logic systems , 1996 .

[2]  Michael Hanus,et al.  Reporting Failures in Functional Logic Programs , 2007, WFLP.

[3]  Rinus Plasmeijer,et al.  The Implementation of iData - A Case Study in Generic Programming , 2006 .

[4]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[5]  Jürgen Giesl,et al.  Automatic Termination Proofs in the Dependency Pair Framework , 2006, IJCAR.

[6]  Michael Hanus,et al.  A unified computation model for functional and logic programming , 1997, POPL '97.

[7]  Philip Wadler,et al.  How to declare an imperative , 1997, CSUR.

[8]  Claus Brabrand,et al.  PowerForms: Declarative client-side form field validation , 2004, World Wide Web.

[9]  Sergio Antoy Constructor-based conditional narrowing , 2001, PPDP '01.

[10]  David Flanagan,et al.  JavaScript: The Definitive Guide , 1996 .

[11]  Michael Hanus,et al.  The Integration of Functions into Logic Programming: From Theory to Practice , 1994, J. Log. Program..

[12]  Rinus Plasmeijer,et al.  Programming Interconnected Web Forms , 2006 .

[13]  Sebastian Fischer A functional logic database library , 2005, WCFLP '05.

[14]  Ramin Sadre,et al.  Pakcs: The portland aachen kiel curry system , 2000 .

[15]  Michael Hanus,et al.  High-Level Server Side Web Scripting in Curry , 2001, PADL.

[16]  Anders Sandholm,et al.  A type system for dynamic Web documents , 2000, POPL '00.

[17]  Marinus J. Plasmeijer,et al.  The Implementation of iData , 2005, IFL.

[18]  S. Griffis EDITOR , 1997, Journal of Navigation.

[19]  Rachid Echahed,et al.  A needed narrowing strategy , 2000, JACM.

[20]  M. Hanus,et al.  Curry: An Integrated Functional Logic Language , 2003 .

[21]  Erik Meijer Server side web scripting in Haskell , 2000, J. Funct. Program..

[22]  Michael Hanus,et al.  Dynamic Predicates in Functional Logic Programs , 2004, J. Funct. Log. Program..

[23]  Sverre H. Huseby Innocent Code: A Security Wake-Up Call for Web Programmers , 2004 .

[24]  Peter Thiemann,et al.  WASH/CGI: Server-Side Web Scripting with Sessions and Typed, Compositional Forms , 2002, PADL.

[25]  Claus Brabrand,et al.  The < bigwig > Project , 2022 .

[26]  Michael Hanus,et al.  Type-oriented construction of web user interfaces , 2006, PPDP '06.

[27]  Michael Hanus,et al.  Functional Logic Design Patterns , 2002, FLOPS.

[28]  Francisco Javier López-Fraguas,et al.  TOY: A Multiparadigm Declarative System , 1999, RTA.

[29]  Germán Vidal,et al.  Operational semantics for declarative multi-paradigm languages , 2005, J. Symb. Comput..

[30]  Christian Prehofer,et al.  Higher-order narrowing with definitional trees , 1999, Journal of Functional Programming.

[31]  Roman Leshchinskiy,et al.  Rewriting Haskell Strings , 2007, PADL.

[32]  Thomas Johnsson,et al.  Lambda Lifting: Treansforming Programs to Recursive Equations , 1985, FPCA.

[33]  Sergio Antoy Definitional Trees , 1992, ALP.

[34]  Michael Hanus,et al.  Overlapping Rules and Logic Variables in Functional Logic Programs , 2006, ICLP.

[35]  Peter Thiemann Modeling HTML in Haskell , 2000, PADL.

[36]  M. Hanus A Generic Analysis Environment for Curry Programs , 2007, ArXiv.

[37]  J. Christopher Ramming,et al.  Programming the Web: An Application-Oriented Language for Hypermedia Service Programming , 1996, World Wide Web journal.