Expression Pattern Language (eXPL) combines two programming paradigms: Logic and Imperative. This fits well with how the mind works using patterns to find and shape soutions to problems. The Logic paradigm is manifest in the following ways:
- A query defines the program goal
- Data structures combine when logically equivalent
- A solution is found by chaining together modular evaluation stages
However, eXPL is not like a logic programming language in that it allows procedural instructions to be used to arrive at the solution. This in contrast to the expectation that the program declares a problem which the underlying system works out how to solve.
The mix of paradigms started as an experiment, with inspiration from the "Logikus" logic programming language developed for the book "Building Parsers with Java" by the late Steven John Metsker, published in 2001. Here is a eXPL example of a simple query, originally implemented in Logikus. It selects from a list, cities at elevation above 5,000 feet:
Disadvantages
It is fair to say eXPL is a data-centric language rather than a general purpose one. That being said, it can readily be pressed into service to perform algorithms associated with processing data, such as sorting. It's unification engine has been designed with efficiency in mind, but it's performance will never match that of a highly optimized Java runtime engine.
Some people may also be disappointed that there is no theory behind the design of the eXPL language, as many languages have come from the academic world based on models on how a computer should operate. But why not design a computer language with only real-world problem solving in mind, perhaps making programming enjoyable too?
Missing in action are classes, generics, lamdas, annotations and even multi-dimensional arrays. These things are important in general purpose programming, but increase complexity and time and effort to learn the language. Finally, there currently are no libraries avaliable for eXPL and no user community active to write them, but Java libraries are readily accessible to eXPL using function calls and a little Java coding.
Advantages
There is a lot more to eXPL, as you can see in the eXPL Reference, but already some positives are apparent:
- Data has a generic format which is easy to work with and allows type to implied
- Data is handled cohesively record by record, rather than fetching fragments
- Data is processed with some degree of automation, raising the level of abstraction in the code
- Data is evaluated using expressions co-located with the data, reducing the effort required to follow the program's logic
- Templates shape the format and logic of the required solution in a comprehensible manner
- Query statements can provide a high-level declaration of the intent of the program
