HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
mthom
scryer-prolog
Rust2018–2026
mthom / scryer-prolog

scryer-prolog

A modern Prolog implementation written mostly in Rust.

20Distinct people
81Mentions
2Explicit recommenders
2.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A modern Prolog implementation written mostly in Rust.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

(Will be continued in Part 13) It will take me to read this book, but I love it! I'll be following along in https://github.com/mthom/scryer-prolog (written in Rust) so one…

sitkack used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 1:56:48 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year81 dated mentions

Observed mentions: 2018-02-26 18:34:13 UTC to 2026-08-05 20:11:30 UTC.

0510152018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 14 mentions; 0 submissions, 14 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 8 mentions; 2 submissions, 6 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 5 mentions; 2 submissions, 3 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 10 mentions; 5 submissions, 5 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 16 mentions; 7 submissions, 9 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 13 mentions; 5 submissions, 8 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC211
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC817
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC14014
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC826
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC523
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC1055
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC1679
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC1358
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC514

What Hacker News says

10 sources
Djot is the markup syntax that is used for the documentation of Scryer Prolog, using a parser written in Prolog: https://github.com/aarroyoc/djota It works well so far. One of the few limitations I noticed so far pertains to the formatting of tables. For instance, consider the table used in library(format) to describe control sequences: https://github.com/mthom/scryer-prolog/blob/b0566e41503a6c8d... It contains several entries that span multiple lines, yet are meant to denote only a single row of the table, such as: % | `~Nr` | where N is an integer between 2 and 36: format the | % | | next argument, which must be an integer, in radix N. | % | | The characters "a" to "z" are used for radices 10 to 36. | % | | If N is omitted, it defaults to 8 (octal).
Read the rest
| It appears that Djot requires to write the entire entry in one long line, otherwise it gets formatted as shown currently at: https://www.scryer.pl/format.html From a readability perspective in the source file itself, a very long line is suboptimal. Maybe there is a way to retain optimal readability in the source file, and still get the intended rendering?
In Djot is a light markup syntax
There's a nice book[1][2] about Prolog, with modern characteristics. Moreover, there are things like ProbLog[3] and DeepProbLog[4] that allow you to use probabilistic reasoning and power of machine learning. I am personally looking forward for Scryer Prolog[5] to achieve its goals. [1] https://www.metalevel.at/prolog [2] https://github.com/triska/the-power-of-prolog [3] https://github.com/ML-KULeuven/problog [4] https://github.com/ML-KULeuven/deepproblog [5] https://github.com/mthom/scryer-prolog
In Why did Prolog lose steam? (2010)
Very nice! This solution uses the library predicate list_to_set/2, relating a (known) list Ls0 of elements to a list Ls without duplicates, where the elements occur in the same order in which they first appear in Ls0. I think it is interesting to consider how such a relation can be described in Prolog, and also how efficient it can be. An immediate solution suggests itself, considering the elements of Ls0 in the order they appear, and keeping track of the elements that have already been "seen". If an element is encountered that has already been seen, ignore it, otherwise it is part of the list Ls we want to describe. We can use a list to keep track of elements that have already been encountered: list_to_set(Ls0, Ls) :- phrase(firsts(Ls0, []), Ls). firsts([], _) --> []. firsts([L|Ls], Seen) --> ( { me
Read the rest
mber(L, Seen) } -> [] ; [L] ), firsts(Ls, [L|Seen]). This works correctly if the list is ground: ?- list_to_set("Corvus corax", Ls). Ls = "Corvus cax". Yet, this solution has a very severe drawback: It is worst-case quadratic in the number of elements, and thus not usable for long lists: ?- length(_, E), E #> 10, N #= 2^E, numlist(1, N, Ls0), time(list_to_set(Ls0, Ls)). yielding: % CPU time: 0.222s E = 11, N = 2048, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; % CPU time: 0.880s E = 12, N = 4096, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; % CPU time: 3.518s E = 13, N = 8192, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; ... . So, how to improve it? Well, it may be tempting to use for example a hash or an AVL tree to keep track of the "seen" elements, so that it can be more efficiently decided whether an element has already been encountered. And indeed, that is easy to do, and reduces the runtime considerably. For example, using the commonly available library(assoc) for AVL trees, providing O(log(N)) lookup: list_to_set(Ls0, Ls) :- empty_assoc(A0), phrase(firsts(Ls0, A0), Ls). firsts([], _) --> []. firsts([L|Ls], A0) --> ( { get_assoc(L, A0, _) } -> [] ; [L] ), { put_assoc(L, A0, t, A) }, firsts(Ls, A). With this simple change, we get for the query above: % CPU time: 0.034s E = 11, N = 2048, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; % CPU time: 0.070s E = 12, N = 4096, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; % CPU time: 0.155s E = 13, N = 8192, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; ... . The most interesting part is that we can do significantly better, by leveraging Prolog's logic variables to propagate the information whether elements have already been encountered, yielding a very efficient solution where sorting the list Ls0 (or rather: the list of pairs LVs0, where we associate with each element of Ls0 a logic variable that can be used to propagate information by unifying it with other variables and more concrete terms) dominates the asymptotic complexity: list_to_set(Ls0, Ls) :- maplist(with_var, Ls0, LVs0), keysort(LVs0, LVs), same_elements(LVs), pick_firsts(LVs0, Ls). pick_firsts([], []). pick_firsts([E-V|EVs], Fs0) :- ( V == visited -> Fs0 = Fs ; V = visited, Fs0 = [E|Fs] ), pick_firsts(EVs, Fs). with_var(E, E-_). same_elements([]). same_elements([EV|EVs]) :- foldl(unify_same, EVs, EV, _). unify_same(E-V, Prev-Var, E-V) :- ( Prev == E -> Var = V ; true ). We now get significantly improved performance: % CPU time: 0.003s E = 11, N = 2048, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; % CPU time: 0.006s E = 12, N = 4096, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; % CPU time: 0.013s E = 13, N = 8192, Ls0 = [1,2,3,4,5,...], Ls = [1,2,3,4,5,...] ; ... . And this is indeed how list_to_set/2 is implemented for example in Scryer Prolog's library(lists): https://github.com/mthom/scryer-prolog/blob/fd19128530f68c46...
In Solving a Dungeons and Dragons riddle using Prolog

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.