Skip to content

Tail call optimization #7

Closed
Closed
@sparkprime

Description

@sparkprime

The current implementations of foldl (and similar routines) rely on tail call recursion, but currently they blow the stack when operating on arrays that are too long. This can be fixed by optimizing tail calls to re-use their current stack frame.

I think an explicit construct for enabling the optimization is better than applying it for all tail calls, because then you preserve stack traces in the majority of cases where the optimization is not required.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions