Hi,
I’m new to Prolog, and just started reading Bratko’s book. On another project I’ve been working on a custom build system for compiling a C++ project. Currently that uses Python. It seems like Prolog might help for that kind of thing, but I’d need some replacement for Python’s imperative functions that do the following. Does SWI Prolog have them?
- Start a subprocess and read it’s stdout and stderr, as it comes back
- Split a thread or somehow allow parallel calls to #1. The python code throttles the amount of parallelism there with a semaphore.
- Parse json (clang-scan-deps reports dependencies between C++ files this way)
I’m so new to Prolog I’m not sure it will help me here, but I wanted to play around with it as I read the book. I can see I need to re-wire my brain a bit. There are number of things that make a build system confusing. You specify a lot of rules for how to handle different files, or different build conditions. Then you need rules for how to combine the rules. There’s also the DAG (directed acyclic graph) and dependency analysis - figuring out which files need to be compiled (or “precompiled” now, if using C++20 modules) before others.
Anyway, as I was writing that build-system code I got the feeling I was creating a poor man’s logical inference engine, so now I’m here.
Rob