Skip to content

Optimizations to avoid python recursion limit #31

@mikesol

Description

@mikesol

For programs with deep monadic stacks used to traverse recursive structures, the python recursion limit is often hit. Setting a higher recursion limit via sys.setrecursionlimit fixes the problem most of the time, but even with very high recursion limits the issue still appears sometimes.

Are there any optimizations that can be done on the code-gen level to help with this? Ie turning tail recursion into loops, creating functions that take multiple arguments to get rid of currying when possible, etc. I'm not sure what's possible, but it'd be nice to keep a running list here and see if we can tackle any of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions