CHR.js: A CHR Implementation in JavaScript

Autor: Falco Nogatz, Thom Frühwirth, Dietmar Seipel
Rok vydání: 2018
Předmět:
Zdroj: Rules and Reasoning ISBN: 9783319999050
RuleML+RR
DOI: 10.1007/978-3-319-99906-7_9
Popis: Constraint Handling Rules (CHR) is usually compiled to logic programming languages. While there are implementations for imperative programming languages such as C and Java, its most popular host language remains Prolog. In this paper, we present Chr.js, a CHR system implemented in JavaScript, that is suitable for both the server-side and interactive client-side web applications. Chr.js provides (i) an interpreter, which is based on the asynchronous execution model of JavaScript, and (ii) an ahead-of-time compiler, resulting in synchronous constraint solvers with better performances. Because of the great popularity of JavaScript, Chr.js is the first CHR system that runs on almost all and even mobile devices, without the need for an additional runtime environment. As an example application we present the Chr.js Playground, an offline-capable web-interface which allows the interactive exploration of CHRs in every modern browser.
Databáze: OpenAIRE