Any research papers comparing CMake to Prolog?

In learning CMake see lots of similarities to Prolog.

Does any one know of a research paper that compares and contrast CMake with Prolog? Or at a higher level comparing Unix style make systems with Prolog?

Hmm. I’ve done some Prolog, but comparing it to CMake isn’t something that’s come to me before. In what ways do you see similarities?

I suspect no one as published on such things, but there might be some comparing make with it (Usenix publications would probably be the place to look first).

Remember I am new to CMake so take what I write regarding CMake with a grain of salt. For Prolog if it does not make sense don’t hold my feet to the fire but don’t be afraid to ask hard questions.

Off the top of my head at the moment is this list. I have forgot many similarities but they quickly pop to mind reading Mastering CMake and Professional CMake.

  1. Both Prolog and CMake try to solve a problem using nondeterministic means (think backward chaining or dynamic programming) to reach a deterministic solution.
  2. Both can dynamically change during execution. For CMake my understanding is that *.cmake can change how find works. For Prolog just add new clauses to a predicate. For an example of helping Prolog find source code files see:
    Using absolute_file_name/3 and user:file_search_path/2
  3. Some Prologs have quasi-quotations, e.g SWI-Prolog and while still working my way on understanding CMake, CMake seems to have LISP quotes and possibly quasi-quotations.
  4. Both have/are a Turing complete languages. While Prolog is not statically typed it does have types. CMake also is not statically typed and has the string type, not sure of the others.
  5. They can report on their search. Prolog much more so than CMake. For CMake I am only aware of –debug-find so far but the concept is there. For SWI-Prolog there is trace/0 and gtrace/0. When trace stops with a debug prompt one can inspect the state of the Prolog virtual machine and even start up a new top-level to run queries on that state. One can also do dynamic software updating with SWI-Prolog, not sure about CMake, would be nice.
  6. The more common Prologs do no use inherence and the CMake programming languages does not either. May sound insignificant to many but for those who do language design it is a major distinction.
  7. While both don’t require guards, the more seasoned programmers wield them like a sword.

While 1-3 are the heavy hitters, I know 4-7 apply to much more than this but they do add evidence.


Thanks for noting Usenix. :slightly_smiling_face:

Using make as a keyword for search is not effective. Know any other keywords that would zero in on such?

Maybe “build system”, make uses “recipes” to hold its commands, “build graph”, or “DAG” can help find some.

Make resolving build plans from especially pattern rules is a lot like logic programming. Certain things one can do with recursive make variables in GNU Make also seem similar.

Notwithstanding your list I would not consider CMake like logic programming. Nondeterminism and quasiquoting are ancillary features of Prolog not core destinguishing features of logic programming.

Being like Prolog without being like logic programming I just don’t think is that notable. Tere isn’t enough deep content with merely sharing the ancillary features to have enough material for an academic investigation.