Ensody is my personal research project developing a declarative, synthesizing programming language assisted by artificial intelligence (statistics ;).

My hypothesis is that most of the thinking patterns when solving programming problems are actually very similar and not "AGI-complicated". We spend a lot of effort coordinating state, building abstractions and building workarounds for insufficient abstractions (e.g. when optimizing code). Code reuse is limited by the flexibility of our abstractions and performance requirements.

I believe that most of this problem is caused by non-declarative programming (imperative or even functional). We are much too explicit about how individual code is executed and this makes it almost impossible to create clean abstractions that can be freely combined into an efficient and correct program. It's algorithms all the way down.

For example, there's always a more-or-less fixed execution order in our code. Even a declarative language like Prolog can't abstract this aspect away (e.g. cut operator and rule ordering). While an advanced compiler can relax some of the execution order, it just doesn't have enough information to understand what the code does and what the true relations/dependencies between different lines of code are (at least beyond memory read/write dependencies).

In other words, we are over-specifying the execution and under-specifying the meaning behind the code.

Ensody tries to give the compiler sufficient meaning and degrees of freedom to combine code in a more human-like way. One major aspect of Ensody is a specification language that makes this combination process close-to-linear (for the compiler) and obvious (for the developer) while preserving the correctness of each individual piece of code. It should also allow for sufficiently fast compilation - even if this requires some differential caching/pre-compiling solution to be practical.