(C)LP到JavaScript的轻量级编译
Lightweight compilation of (C)LP to JavaScript
摘要:
我们提出并评估了一个编译器从Prolog(和扩展)到JavaScript,这使得它可以使用(约束)逻辑编程来开发Web应用程序的客户端,同时符合当前的行业标准。以JavaScript为目标使得(C)LP程序可在几乎每一个现代计算设备中执行,而从用户的角度来看没有额外的软件要求。反过来,使用非常高级的高级语言有助于开发高质量的复杂软件。该编译器是Ciao系统的后端,支持Ciao系统的大部分功能,包括其模块系统和基于包的丰富语言扩展机制。我们提出了一个编译过程的概述和运行时系统的详细描述,包括模块化编译成单独的JavaScript代码的支持。我们证明了编译器的成熟度,通过测试它与复杂的代码,如CLP(FD)库写在Prolog与属性变量。最后,我们通过测量运行在主要JavaScript引擎上的一些LP和CLP(FD)基准测试的性能来验证我们的建议。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。