A new Python framework called WAMpy speeds up the tedious work of writing Prolog programs automatically.
Researchers built WAMpy, a system that compiles Prolog clauses into NumPy array-based instructions for the Warren Abstract Machine, the standard execution model for Prolog. It's built for a specific job: generating and testing many small candidate programs against a fixed set of background rules, then evaluating which ones work - a process called program synthesis. The framework uses Numba's just-in-time compiler to speed up the performance-critical parts, and it supports partial recompilation so it doesn't have to rebuild everything from scratch each time a hypothesis changes. In benchmarks of repeated compile-and-evaluate cycles, WAMpy outperformed SWI-Prolog, the most widely used Prolog implementation, accessed through Python via its Janus interface.
Program synthesis - having software write other software by trial and error - lives or dies on how fast you can generate and discard bad candidates. General-purpose Prolog systems like SWI-Prolog were built to run one program well, not to be restarted thousands of times a second, so the overhead adds up fast in search-heavy synthesis loops. WAMpy's targeted redesign suggests that purpose-built tooling for narrow but repetitive AI workloads - rather than retrofitting general tools - stays the more reliable path to speed.
It's a plumbing improvement, not a new idea, but search-based synthesis is only as good as the plumbing underneath it.