3 ms·
I'm not disagreeing that if you're developing a Web app, embedding logical or constraint programming techniques into a JavaScript API could make sense. OTOH, th
by tannhaeuser 9y ago
I'm not disagreeing that if you're developing a Web app, embedding logical or constraint programming techniques into a JavaScript API could make sense. OTOH, there's an obvious way for data exchange between JavaScript and Prolog, in that JSON can be be parsed by using Prolog's embedded `op/2` predicate and operator-precedence parser for defining custom DSLs.
- jononor 9y agoWhat would be the workflow in Prolog if I want to import a set of facts from an external source, like a database/JSON/CSV?
- tannhaeuser 9y agoJSON could be parsed as a term by Prolog, with suitable priority/associativity definitions for the comma, colon, and curly brace operators. For CSV, you could write a DCG grammar for the particular file format at hand. Integration with a relational DB, itself being based on logic, would be very different. Most Prologs have APIs to map tables to predicates.