mthom/scryer-prolog

Created Dec 23, 2020 · View the mthom/scryer-prolog repository page

A modern Prolog implementation written mostly in Rust.

Want this for your repo?

Render a free sample of any GitHub repo in seconds.

Visualize your own →

Contributors

18

Lines of Code

5,335

From

Oct 29, 2016

To

Dec 22, 2020

About mthom/scryer-prolog

Scryer Prolog is a modern implementation of ISO Prolog written primarily in Rust. It aspires to be for Prolog what GHC is for Haskell: an industrial-strength, open-source production environment that also serves as a testbed for research in logic and constraint programming. The project passes all conformity tests for ISO Prolog syntax, variable names handling, and the dif/2 constraint predicate.

The implementation is built on the Warren Abstract Machine, a theoretical computational model for Prolog execution, with Phase 1 completing the core WAM features including lists, cuts, indexing, and last-call optimization. Phase 2 extends this foundation with numerous advanced features: ISO-compliant exception handling, a module system, arithmetic supporting bignum and rational numbers, definite clause grammars, attributed variables for constraint programming, delimited continuations for tabling, streams and socket support, and two constraint logic programming libraries for boolean and integer domains. The system includes a compact internal representation for strings that provides up to 24-fold memory reduction compared to traditional list-based character storage, making it particularly suited for text processing tasks.

Scryer Prolog targets a broad audience from students and educators learning logic programming to researchers exploring constraint logic programming techniques. The project provides precompiled binaries for multiple platforms, supports compilation via Rust's cargo package manager, and includes WebAssembly support. It comes with extensive built-in libraries covering list processing, input/output, debugging, type checking, and various other functionality, making it suitable both as a general-purpose Prolog system and as a platform for specialized constraint-solving applications.

Share this video