
Description
Prolog is a joy at small scale and painful at large: every predicate shares one flat namespace, reusing a chunk of reasoning means copying it, and moving to another Prolog implementation means editing the source again. Logtalk targets exactly that — it layers objects, protocols and categories on top of standard Prolog so code splits into units that compile and test on their own, while the inference engine underneath stays the one you know.
It is not a rival language but a transcompiler: you write Logtalk, it emits code for the backend Prolog, and SWI, SICStus, GNU Prolog, ECLiPSe and others all qualify, so switching backends costs no source changes. Both prototype and class/instance hierarchies are supported, alongside event-driven and multi-threaded programming. The distribution ships a full toolchain — documentation generation, unit tests, coverage and entity diagrams — plus a large set of readable examples.
Objects and protocols: predicates live inside objects with their own namespaces, interfaces are declared as standalone protocols, and categories compose horizontally into several objects and support hot patching.
Two inheritance models: prototypes and classes with instances both work, and several independent hierarchies can coexist, so each problem gets the model that fits it.
Backend independence: running as a transcompiler over standards-compliant Prolog systems means one source tree survives a change of compiler.
Developer tooling: API documentation, a unit test framework, coverage reports and entity diagrams come in the box, so the engineering scaffolding is not yours to build.
Events and threads: event-driven programming is built in, and capable backends also get high-level multi-threaded reasoning.
It is not a rival language but a transcompiler: you write Logtalk, it emits code for the backend Prolog, and SWI, SICStus, GNU Prolog, ECLiPSe and others all qualify, so switching backends costs no source changes. Both prototype and class/instance hierarchies are supported, alongside event-driven and multi-threaded programming. The distribution ships a full toolchain — documentation generation, unit tests, coverage and entity diagrams — plus a large set of readable examples.
Features
Objects and protocols: predicates live inside objects with their own namespaces, interfaces are declared as standalone protocols, and categories compose horizontally into several objects and support hot patching.
Two inheritance models: prototypes and classes with instances both work, and several independent hierarchies can coexist, so each problem gets the model that fits it.
Backend independence: running as a transcompiler over standards-compliant Prolog systems means one source tree survives a change of compiler.
Developer tooling: API documentation, a unit test framework, coverage reports and entity diagrams come in the box, so the engineering scaffolding is not yours to build.
Events and threads: event-driven programming is built in, and capable backends also get high-level multi-threaded reasoning.
