@Dennis The way I was checking how many elements were on each stack was forcing the main stack to be evaluated more strictly, because there were more checks as it's a more complex (multi-layered, sectioned) stack. So if enough operations were performed on either the left or right stacks before the result of said operations was required, the call stack exploded because the runtime had to dive all the way down to where the value was returned.
Credit for thinking about that, and for the idea for the fix both go to @Potato44, who mentioned a similar symptom occurring in Haskell, and reminded me about head-strict lists which were fixed in Clean since the last time I'd checked them, so now the first few elements of each stack are always evaluated at all times.
@Dennis also thanks for pulling, once again please?
@Dennis Could this be being caused by TIOs ram-compression thingy? tio.run/##S8ksKqn8/9/QAAr0HrVPN6jWrlX8//… <- that runs fine, but remove one zero from the large number and it blows the heap
@Dennis The issue mentioned just a few messages above ^ has been fixed now, could you pull Dirty again please. Unfortunately TIO / Linux Dirty in general will take a large performance hit until the marking GC is fixed, but it will work sensibly until then.
Thank you, Dennis, for having an unnecessarily large maximum request size that lets me dump a serialized version of my company's entire database in the Input field that I can play around with without instantiating a new project locally every time I want to test something.
@Οurous What mathematica used to have was that commonly curried functions were manually overrided in the standard library to take just one argument, so you could still do cool functional programming tricks, but now you can do cooler functional programming tricks.