Towards a tight integration of a functional web client language into Scala

  • Authors:
  • Christoph Höger;Martin Zuber

  • Affiliations:
  • Technische Universität Berlin;Technische Universität Berlin

  • Venue:
  • Proceedings of the 4th Workshop on Scala
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

The web has become an application platform. Therefore it is essential to bring the expressiveness and safety of established languages into the world of web development. Yet it seems hard if not impossible for any such language to succeed over JavaScript in terms of availability or acceptance. Hence, application developers are practically enforced to embrace JavaScript and at least partially implement their applications in this dynamic language. For this reasons, web applications often contain duplication between type-safe code on the server side and dynamic code on the client side. In this work we demonstrate how SL, a small, type-safe, purely functional language can be translated into JavaScript from within a Scala web service. We show how type checking and code generation of client code can be integrated into the overall build process of the web application by the means of macro evaluation. Additionally, it is possible to share data-structures between client and server by means of Scala's reflection library. This tight integration reduces code size, allows early error detection and should generally improve the ability to write good web applications.