didoudiaz / gprolog

GNU Prolog
Other
106 stars 13 forks source link

hand written C code lacks some garbage collection. #65

Closed Jean-Luc-Picard-2021 closed 2 months ago

Jean-Luc-Picard-2021 commented 1 year ago

Try this:

test(X) :- append(Y, X, [1,2,3|Y]). 

I get that GNU Prolog cannot run it indefinitely:

?- test(X).
X = [1,2,3] ? ;
X = [2,3,1] ? ;
X = [3,1,2] ?

?- test(X), fail; true.
%%% Dialog Window with global stack overflow
%%% After dismissing the Dialog Window GNU Prolog exists

Whereas SWI-Prolog can run it indefinitely:

?- test(X).
X = [1, 2, 3] ;
X = [2, 3, 1] ;
X = [3, 1, 2] .

?- test(X), fail; true.
%%% runs indefinitely, you can watch the thread monitor, see how memory is reclaimed
%%% Responds to Ctrl-C and can be aborted, will gracefully return to top-level 

Credits go to:

Marquee in Prolog https://stackoverflow.com/questions/77061142/marquee-in-prolog

Jean-Luc-Picard-2021 commented 2 months ago

Possibly need to close this ticket anyway, this GitHub seems to be completely dead, just like GNU Prolog. The ticket was opened 12 months ago. It was neither classified by

severity nor otherwise touched by any GNU developer.