1. 2

Abstract: “In general, even though Prolog is a dynamically typed language, predicates may not be called with arbitrarily typed arguments. Assumptions regarding type or mode are often made implicitly, without being directly represented in the source code. This complicates identifying the types or data structures anticipated by predicates. In consequence, Covington et al. proposed that Prolog developers should implement their own runtime type checking system. In this paper, we present a re-usable Prolog library named plspec. It offers a simple and easily extensible DSL used to specify type and structure of input and output arguments. Additionally, an elegant insertion of multiple kinds of runtime checks was made possible by using Prolog language features such as co-routining and term expansion. Furthermore, we will discuss performance impacts and possible future usage of these annotations.”

  1.  

  2. 2

    That’s an interesting idea and it’s unfortunate the performance is so terrible.

    I recently picked up a half dozen old Prolog and logic programming books, and one thing I don’t like so far (about Prolog in particular) is that it’s difficult to understand the performance characteristics of code. I suspect I’ll get the hang of it, but so far it’s nebulous.

    1. 2

      Yeah, I recall that problem when I dabbled in it. I got nothing off hand for predictability of performance. I do have a link in my collection on a Prolog designed to work with real hardware better I could submit in morning. I think I also have a CPU designed to accelerate regular Prolog but I doubt it’s practical vs full-custom x86.