Kragen Javier Sitaker explores a synthesis between array languages like APL and relational/constraint programming paradigms, proposing a multidirectional inference system that preserves the strengths of both approaches.
In his thought-provoking essay, Kragen Javier Sitaker presents a compelling vision for combining the expressive power of array languages with the flexible reasoning capabilities of constraint logic programming. At the heart of this proposal lies the concept of treating mathematical relationships not as one-directional computations but as bidirectional constraints that can be leveraged in multiple ways.
The core insight centers on transforming how we model relationships between variables. Instead of defining computations like ".vol = π.r²·.h" as simple assignments, Sitaker suggests interpreting them as equations that hold true across all defined scenarios. This transformation enables a more powerful form of reasoning where the same relationship can be used to compute any missing variable given the others, creating a multidirectional inference system reminiscent of miniKANREN or Prolog.
This approach builds upon several established concepts while proposing novel combinations. Sitaker connects his ideas to "A principled rethinking of array languages like APL," particularly the concept of array conformability, and to Wadler's "Views" as found in OMeta. The author suggests that this synthesis could preserve the "yumminess of implicit loops" characteristic of array languages while adding the constraint-solving capabilities of logic programming.
A significant contribution of this essay is the exploration of conflict resolution strategies. Sitaker contrasts three approaches: specificity ordering (similar to CSS), backtracking (as in Prolog), and consistency checking (treating conflicting definitions as program errors). Each approach offers different trade-offs in terms of flexibility, determinism, and error detection.
The practical applications of such a system are particularly intriguing. Sitaker's cylinder example demonstrates how complex physical relationships could be modeled naturally, with properties like volume and surface area defined as constraints rather than fixed computations. This could revolutionize how scientific and engineering problems are approached in programming, allowing for more intuitive modeling of multidimensional relationships.
The author also wisely addresses the challenges of numerical relationships, suggesting that interval arithmetic or affine arithmetic could help resolve underconstrained systems and determine whether apparent differences between computed values represent true inconsistencies or merely rounding errors.
Sitaker connects these ideas to his previous work, including "Relational modeling" and "More thoughts on powerful primitives," showing how this concept has evolved in his thinking. The references to miniKANREN, Prolog, and constraint satisfaction indicate that this proposal builds upon established research while pushing in new directions.
The most forward-looking aspect of this essay is its recognition that different design choices in resolving conflicts between definitions could lead to "interestingly different languages that work for different purposes." This suggests a rich space for language exploration, potentially yielding specialized tools for scientific computing, knowledge representation, or constraint-based reasoning.
While the essay doesn't delve deeply into implementation challenges or performance considerations, it opens up a fascinating avenue for programming language research. The synthesis of array-oriented programming with constraint logic could yield systems that are both expressive in their mathematical modeling and computationally powerful in their reasoning capabilities.
For those interested in exploring these concepts further, Sitaker's previous work on Relational modeling and More thoughts on powerful primitives provide additional context. The connection to miniKANREN, a domain-specific embedded language for relational programming, offers a concrete starting point for understanding how multidirectional inference might be implemented in practice.
This essay stands as a thoughtful contribution to the ongoing evolution of programming paradigms, suggesting that the most powerful systems of the future may not be purely array-oriented or purely logic-based, but rather a synthesis that captures the strengths of both approaches.
Comments
Please log in or register to join the discussion