HVM icon indicating copy to clipboard operation
HVM copied to clipboard

fixed-point combinator hangs when using more than one thread

Open nivkner opened this issue 1 year ago • 1 comments

using the following code:

Y = λf ((λx (f (x x))) (λx (f (x x))))

Factorial = λf (λn ( U60.if (== n 0) 1 (* n (f (- n 1)))))

(Main n) = (((Y) Factorial) n)

the following command hangs: hvm run -f fixed_point.hvm "(Main 5)"

whereas the following command terminates with 120 as expected: hvm run -f fixed_point.hvm "(Main 5)" --debug

tested on commit d3367849ec92a043ebf04fe537e9b74c516347b6, with rust nightly-2023-03-01

Edit: might be a deadlock of some sort, which debugging prevents by serializing execution. since similar results are gotten when specifying -t 1 instead

nivkner avatar Apr 08 '23 13:04 nivkner