3 ms·
I really wish there was "regex for prolog", ie: when pounding away in JavaScript be able to do: let options = { foo: 1, bar: 2, ... } ```prolog $X
by ramses0 2y ago
I really wish there was "regex for prolog", ie: when pounding away in JavaScript be able to do:
let options = { foo: 1, bar: 2, ... }
```prolog
$X :- fromJson( options )
Solution = Optimize( $X )
...
```
...like writing a whole web app in prolog sounds terrifying (same as writing a whole web app in regex), but recognizing and having some excellent interop between "modes" is obviously useful for regex, sometimes sql is supported in other languages, but even with the usefulness of prolog outcomes, there's almost never been that convenient "this section is logic" in the same way that we've universally adopted "regex" for string matching.
- Avshalom 2y agoYou might want http://tau-prolog.org/documentation#js http://tau-prolog.org/documentation#js
- andrewflnr 2y agoIt's been a while since I used it, but look at the miniKanren implementations for your favorite programming language (js in your case, but there are a lot). It's basically a stripped-down version of logic programming.
- qu1j0t3 2y agoIt may "sound terrifying" but it's likely to be much more pleasant than you think: https://github.com/Anniepoo/swiplwebtut/blob/master/web.adoc https://github.com/Anniepoo/swiplwebtut/blob/master/web.adoc