Lightweight compilation of (C)LP to JavaScript

Morales Caballero, José Francisco and Haemmerlé, R. and Carro Liñares, Manuel and Hermenegildo, Manuel V. (2012). Lightweight compilation of (C)LP to JavaScript. "Theory and Practice of Logic Programming", v. 12 (n. 4-5); pp. 755-733. ISSN 1471-0684.


Title: Lightweight compilation of (C)LP to JavaScript
  • Morales Caballero, José Francisco
  • Haemmerlé, R.
  • Carro Liñares, Manuel
  • Hermenegildo, Manuel V.
Item Type: Article
Título de Revista/Publicación: Theory and Practice of Logic Programming
Date: July 2012
ISSN: 1471-0684
Volume: 12
Freetext Keywords: Prolog, Ciao, Logic programming system, Implementation of Prolog, Modules, JavaScript, Web, Sistemas de programación lógica, Implementación de Prolog, Modulos.
Faculty: Facultad de Informática (UPM)
Department: Inteligencia Artificial
Creative Commons Licenses: Recognition - No derivative works - Non commercial

Full text

[thumbnail of HERME_NB_2012-1.pdf]
PDF - Requires a PDF viewer, such as GSview, Xpdf or Adobe Acrobat Reader
Download (1MB) | Preview


We present and evaluate a compiler from Prolog (and extensions) to JavaScript which makes it possible to use (constraint) logic programming to develop the client side of web applications while being compliant with current industry standards. Targeting JavaScript makes (C)LP programs executable in virtually every modern computing device with no additional software requirements from the point of view of the user. In turn, the use of a very high-level language facilitates the development of high-quality, complex software. The compiler is a back end of the Ciao system and supports most of its features, including its module system and its rich language extension mechanism based on packages. We present an overview of the compilation process and a detailed description of the run-time system, including the support for modular compilation into separate JavaScript code. We demonstrate the maturity of the compiler by testing it with complex code such as a CLP(FD) library written in Prolog with attributed variables. Finally, we validate our proposal by measuring the performance of some LP and CLP(FD) benchmarks running on top of major JavaScript engines.

More information

Item ID: 14834
DC Identifier:
OAI Identifier:
DOI: 10.1017/S1471068412000336
Deposited by: Biblioteca Facultad de Informatica
Deposited on: 12 Apr 2013 06:34
Last Modified: 21 Apr 2016 14:40
  • Logo InvestigaM (UPM)
  • Logo GEOUP4
  • Logo Open Access
  • Open Access
  • Logo Sherpa/Romeo
    Check whether the anglo-saxon journal in which you have published an article allows you to also publish it under open access.
  • Logo Dulcinea
    Check whether the spanish journal in which you have published an article allows you to also publish it under open access.
  • Logo de Recolecta
  • Logo del Observatorio I+D+i UPM
  • Logo de OpenCourseWare UPM