Putting declarative programming into the web: translating curry to javascript

  • Authors:
  • Michael Hanus

  • Affiliations:
  • Institut fŠr Informatik

  • Venue:
  • Proceedings of the 9th ACM SIGPLAN international conference on Principles and practice of declarative programming
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

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.