{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2023,10,10]],"date-time":"2023-10-10T12:50:56Z","timestamp":1696942256239},"reference-count":30,"publisher":"Cambridge University Press (CUP)","issue":"4-5","license":[{"start":{"date-parts":[[2012,9,5]],"date-time":"2012-09-05T00:00:00Z","timestamp":1346803200000},"content-version":"unspecified","delay-in-days":66,"URL":"https:\/\/www.cambridge.org\/core\/terms"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Theory and Practice of Logic Programming"],"published-print":{"date-parts":[[2012,7]]},"abstract":"<jats:title>Abstract<\/jats:title><jats:p>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<jats:italic>packages<\/jats:italic>. 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.<\/jats:p>","DOI":"10.1017\/s1471068412000336","type":"journal-article","created":{"date-parts":[[2012,9,5]],"date-time":"2012-09-05T11:28:45Z","timestamp":1346844525000},"page":"755-773","source":"Crossref","is-referenced-by-count":4,"title":["Lightweight compilation of (C)LP to JavaScript"],"prefix":"10.1017","volume":"12","author":[{"given":"JOSE F.","family":"MORALES","sequence":"first","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"R\u00c9MY","family":"HAEMMERL\u00c9","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"MANUEL","family":"CARRO","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"MANUEL V.","family":"HERMENEGILDO","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"56","published-online":{"date-parts":[[2012,9,5]]},"reference":[{"key":"S1471068412000336_ref27","unstructured":"Warren D. 1983. An Abstract Prolog Instruction Set. Technical Report 309, Artificial Intelligence Center, SRI International, 333 Ravenswood Ave, Menlo Park CA 94025."},{"key":"S1471068412000336_ref26","doi-asserted-by":"publisher","DOI":"10.1145\/2076022.1993497"},{"key":"S1471068412000336_ref24","volume-title":"Colloquium on Implementation of Constraint and LOgic Programming Systems (ICLP associated workshop)","author":"Pineda","year":"2002"},{"key":"S1471068412000336_ref20","unstructured":"Loitsch F. and Serrano M. 2007. Hop client-side compilation. In TFP 2007: Draft Proceedings of the 8th Symposium on Trends in Functional Programming."},{"key":"S1471068412000336_ref19","volume-title":"The Java Virtual Machine Specification","author":"Lindholm","year":"1996"},{"key":"S1471068412000336_ref16","doi-asserted-by":"publisher","DOI":"10.1007\/10704567_7"},{"key":"S1471068412000336_ref13","doi-asserted-by":"publisher","DOI":"10.1016\/j.scico.2005.02.006"},{"key":"S1471068412000336_ref12","first-page":"219","article-title":"An overview of Ciao and its design philosophy","volume":"12","author":"Hermenegildo","year":"2012","journal-title":"TPLP"},{"key":"S1471068412000336_ref11","unstructured":"Google. V8 Javascript Engine. https:\/\/developers.google.com\/v8\/design."},{"key":"S1471068412000336_ref10","doi-asserted-by":"publisher","DOI":"10.1145\/1542476.1542528"},{"key":"S1471068412000336_ref9","unstructured":"ECMA International. 2009. ECMAScript Language Specification, Standard ECMA-262, Edition 5. Technical Report September. Available at http:\/\/wiki.ecmascript.org."},{"key":"S1471068412000336_ref8","unstructured":"Demoen B. 2002. Dynamic attributes, their hProlog implementation, and a first evaluation. Technical Report CW 350, Department of Computer Science, K.U. Leuven, Leuven, Belgium. October."},{"key":"S1471068412000336_ref7","unstructured":"Cs C. and Zhou N.-F. 2007. A register-free abstract Prolog machine with jumbo instructions. In International Conference on Logic Programming."},{"key":"S1471068412000336_ref6","doi-asserted-by":"publisher","DOI":"10.1016\/0743-1066(95)00121-2"},{"key":"S1471068412000336_ref4","doi-asserted-by":"publisher","DOI":"10.1017\/S147106840100117X"},{"key":"S1471068412000336_ref3","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-52753-2"},{"key":"S1471068412000336_ref30","doi-asserted-by":"crossref","first-page":"301","DOI":"10.1145\/2048147.2048224","volume-title":"Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion","author":"Zakai","year":"2011"},{"key":"S1471068412000336_ref5","doi-asserted-by":"publisher","DOI":"10.1145\/74878.74884"},{"key":"S1471068412000336_ref18","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0024181"},{"key":"S1471068412000336_ref29","doi-asserted-by":"publisher","DOI":"10.1017\/S1471068407003237"},{"key":"S1471068412000336_ref17","doi-asserted-by":"crossref","unstructured":"Howe J. M. and King A. 2010. A pearl on sat solving in prolog. In FLOPS. 165\u2013174.","DOI":"10.1007\/978-3-642-12251-4_13"},{"key":"S1471068412000336_ref1","doi-asserted-by":"crossref","DOI":"10.7551\/mitpress\/7160.001.0001","volume-title":"Warren's Abstract Machine, A Tutorial Reconstruction","author":"Ait-Kaci","year":"1991"},{"key":"S1471068412000336_ref21","volume-title":"Proc. of APLAS'08","author":"Maffeis","year":"2008"},{"key":"S1471068412000336_ref14","first-page":"260","volume-title":"Proceedings of the 1992 International Symposium on Programming Language Implementation and Logic Programming","author":"Holzbaur","year":"1992"},{"key":"S1471068412000336_ref28","unstructured":"Wielemaker J. and Anjewierden A. 2002. An architecture for making object-oriented systems available from prolog. In WLPE. 97\u2013110."},{"key":"S1471068412000336_ref23","first-page":"32","volume-title":"Proceedings of the 10th Int'l. ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming (PPDP'08)","author":"Morales","year":"2008"},{"key":"S1471068412000336_ref25","unstructured":"Tarau P. 2011a. The binprolog experience: Architecture and implementation choices for continuation passing prolog and first-class logic engines. CoRR abs\/1102.1178."},{"key":"S1471068412000336_ref15","unstructured":"Holzbaur C. 1995. OFAI clp(q,r) manual, edition 1.3.3. Technical Report TR-95-09, Austrian Research Institute for Artificial Intelligence, Vienna."},{"key":"S1471068412000336_ref22","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-24836-1_7"},{"key":"S1471068412000336_ref2","volume-title":"PPDP'10 - Proc. of the 12th Int'l. ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming","author":"Bolz","year":"2010"}],"container-title":["Theory and Practice of Logic Programming"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.cambridge.org\/core\/services\/aop-cambridge-core\/content\/view\/S1471068412000336","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2022,1,28]],"date-time":"2022-01-28T07:22:31Z","timestamp":1643354551000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.cambridge.org\/core\/product\/identifier\/S1471068412000336\/type\/journal_article"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2012,7]]},"references-count":30,"journal-issue":{"issue":"4-5","published-print":{"date-parts":[[2012,7]]}},"alternative-id":["S1471068412000336"],"URL":"https:\/\/doi.org\/10.1017\/s1471068412000336","relation":{},"ISSN":["1471-0684","1475-3081"],"issn-type":[{"value":"1471-0684","type":"print"},{"value":"1475-3081","type":"electronic"}],"subject":[],"published":{"date-parts":[[2012,7]]}}}