Description
I'm implementing Peano's natural number with Algebra Data Type in C#: https://gist.github.com/hez2010/39af351442c1b71a46e194bca72abfde
However, due to JIT cannot eliminate recursive calls, I got stackoverflow exception during runtime if the number is large enough.
To reproduce, execute c * c * c with above code.
This doesn't happen to Haskell (using ghc 9), so I think JIT should also be able to transform those calls to jmps for deep recursive calls.
Configuration
.NET 6 Preview 7
category:cq
theme:basic-cq
Description
I'm implementing Peano's natural number with Algebra Data Type in C#: https://gist.github.com/hez2010/39af351442c1b71a46e194bca72abfde
However, due to JIT cannot eliminate recursive calls, I got stackoverflow exception during runtime if the number is large enough.
To reproduce, execute
c * c * cwith above code.This doesn't happen to Haskell (using ghc 9), so I think JIT should also be able to transform those
calls tojmps for deep recursive calls.Configuration
.NET 6 Preview 7
category:cq
theme:basic-cq