Open RalfJung opened 10 years ago
The code is not first-order recursive. We are going to address this in a future version of Thorin.
Same problem here: https://github.com/AnyDSL/imbatracer/commits/forever
btw what does "!" means in the endless_mangling example?
A function fn foo(x: int) -> !
has type fn(int) -> !
which means that the function is a continuation. Calling this function does not return. An expression, calling a continuation has type <no-return>
.
fn foo(x: int) -> int
is syntactic sugar for fn foo(x: int, return: fn(int) -> !) -> !
.
Some seemingly harmless changes can make the impala memory usage explode. See the branch https://github.com/AnyDSL/imbatracer/commits/memleak of imbatracer. The last commit adds a simple (10-line) file that's not even used, which triggers the problem. Another example triggering the problem is adding an external function call as in https://github.com/AnyDSL/imbatracer/commit/b2eaa4a7295f8a275030b74fe915e230a74f6970.