pls help me debug this it stops after 1000 lines

pls help me debug this it stops after 1000 lines

A Conspiracy Theorist Is Talking Shirt $21.68

Shopping Cart Returner Shirt $21.68

A Conspiracy Theorist Is Talking Shirt $21.68

  1. 2 months ago
    Anonymous

    just use a while loop homie lol lmao

    • 2 months ago
      Anonymous

      >not using recursion everywhere so that everyone has to acknowledge your gigabrain
      Lmao moron

      • 2 months ago
        Anonymous

        >watches lain once
        >learns lisp
        >studies cs and learns real languages
        >uses recursion everywhere so that everyone has to acknowledge your brainrot

      • 2 months ago
        Anonymous

        using recursion is always a midwit's choice, considering some problems are really hard to write down in a for loop

        • 2 months ago
          Anonymous

          Recursive functions are good if you're trying to do stuff like

          that problem has a recursive structure, monkey man
          return an objects type, check its parent if it has no type:
          def recurse(obj):
          return recurse(obj.parent) if not obj.type else obj.type

          def foo(obj):
          while not obj.type: obj = obj.parent
          return obj.type

          where you have some horrible object/dict you want to traverse.

          https://i.imgur.com/SRDLccP.png

          pls help me debug this it stops after 1000 lines

          is just a moron

          • 2 months ago
            Anonymous

            no they aren't, they're always inferior in every single way, you either pay for them at runtime or at compile time, all because you were too lazy to write a while loop and your own stack

          • 2 months ago
            Anonymous

            The compiler will optimise that out. Python can't but still it's sometimes nicer to write than a bunch of nested while loops

          • 2 months ago
            Anonymous

            >compile time is not important!
            ok midwit you clearly never did anything important

            >all because you were too lazy to write a while loop and your own stack
            and? what's wrong with utilizing the stack already given to me?

            shitty performance and stack isn't very big so you're solving fizzbuzzer problems if you never hit the limit

          • 2 months ago
            Anonymous

            time is not important!
            It's literally not. Chromium takes hours to compile and that's one of the most important software projects on the planet.

            Expensive compile time can be solved with compiler caches (ccache, sccache, etc) and throwing more hardware at the problem.

          • 2 months ago
            Anonymous

            my prediction for incoming low IQ take left me speechless because if it could go any lower it might wrap around to infinity and that basically doesn't happen in math, see https://www.youtube.com/watch?v=rHIkrotSwcc

            >shitty performance and stack isn't very big so you're solving fizzbuzzer problems if you never hit the limit
            devils advocate here, but (computationally) harder problems have shallow stacks, e.g. N-Queens will never hit the stack limit

            ok, compute me a factorial of 6 gorillion without TCO unrolling it into a vectorized for loop

          • 2 months ago
            Anonymous

            i don't think you read what i said, O(n) is not "computationally hard"

          • 2 months ago
            Anonymous

            It doesn't have to be computationally hard, you clearly don't understand how computers work.

          • 2 months ago
            Anonymous

            computationally hard problems have shallow stacks; if they did not have shallow stacks they would not finish
            you need to read my 2 posts:
            1 -

            >shitty performance and stack isn't very big so you're solving fizzbuzzer problems if you never hit the limit
            devils advocate here, but (computationally) harder problems have shallow stacks, e.g. N-Queens will never hit the stack limit

            2 -

            i don't think you read what i said, O(n) is not "computationally hard"

            google translate if you have to

          • 2 months ago
            Anonymous

            also traversing a tree isn't very computationally hard, that's about one of the only places I can think of where recursion is easier to understand AND has a shallow stack requirement by design.

          • 2 months ago
            Anonymous

            a beautiful thing in cs is that trees show up everywhere
            also:
            >In computational complexity theory, a computational hardness assumption is the hypothesis that a particular problem cannot be solved efficiently (where efficiently typically means "in polynomial time"). It is not known how to prove (unconditional) hardness for essentially any useful problem.

          • 2 months ago
            Anonymous

            it seems like academiagays once again prove that they don't understand efficiency in real machines and have to yap with their muh le academic quotes about irrelevant things

          • 2 months ago
            Anonymous

            >doesnt understand term
            >doesnt google it
            >uses it incorrectly
            >keeps arguing
            many such cases

          • 2 months ago
            Anonymous

            yes I'm not going to google something irrelevant just because you don't understand why allocating stack frames every time you multiply two numbers isn't a good idea, moron

          • 2 months ago
            Anonymous

            >shitty performance and stack isn't very big so you're solving fizzbuzzer problems if you never hit the limit
            devils advocate here, but (computationally) harder problems have shallow stacks, e.g. N-Queens will never hit the stack limit

          • 2 months ago
            Anonymous

            >all because you were too lazy to write a while loop and your own stack
            and? what's wrong with utilizing the stack already given to me?

          • 2 months ago
            Anonymous

            nothing, but if only you knew how beautiful things could really be

  2. 2 months ago
    Anonymous

    hello sir
    you need to set bigger recursion depth

    • 2 months ago
      Anonymous

      You’re overflowing the stack (max recursion depth). Python doesn’t have a tail call optimization like a functional language does, so it can’t infinitely do recursion like this. If you want to add more depth, read about this:

      https://docs.python.org/3/library/sys.html#sys.setrecursionlimit

      C is what I want it to be. If that's not the case for you, you simply got filtered.

      your stack is too small.

      >No TCO
      Lmao shitlang

      • 2 months ago
        Anonymous

        Would that even work here? A static analyzer sees unbounded recursion that can only stop if print() throws an error. You get TCO in lower languages with the optimizer turned on, but only if you code that error condition explicitly.
        int repeat_indefinitely() {
        int result = puts("and they don't stop coming");
        if (result != EOF) return repeat_indefinitely();
        else return result;
        }

  3. 2 months ago
    Anonymous

    *and they don't stop cooming

  4. 2 months ago
    Anonymous

    You’re overflowing the stack (max recursion depth). Python doesn’t have a tail call optimization like a functional language does, so it can’t infinitely do recursion like this. If you want to add more depth, read about this:

    https://docs.python.org/3/library/sys.html#sys.setrecursionlimit

    • 2 months ago
      Anonymous

      according to IQfy, C is functional now

      • 2 months ago
        Anonymous

        C is what I want it to be. If that's not the case for you, you simply got filtered.

        • 2 months ago
          Anonymous

          Based and C pilled.
          >"nooooo c doesn't do x so it can't be y!"
          >uses meme language with x and y, and also a runtime implementing x and y and written in c

      • 2 months ago
        Anonymous

        C has no guaranteed TCO imperative. The Linux kernel uses computed goto which is a GCC compiler extension.

        C is what I want it to be. If that's not the case for you, you simply got filtered.

        Cultist brainlet.

      • 2 months ago
        Anonymous

        moron reading comprehension

      • 2 months ago
        Anonymous

        "Functional implies TCO. TCO. Therefore functional."
        You are guilty of
        https://en.wikipedia.org/wiki/Affirming_the_consequent

        And C doesn't guarantee TCO. It's just available as a compiler optimization in the most commonly used implementations.

        • 2 months ago
          Anonymous

          yes yes I don't care about your low IQ cope, the only relevant compilers implement it for obvious reasons, just look at this vectorized beauty: https://godbolt.org/z/sraxW1qf7

          • 2 months ago
            Anonymous

            >-O3
            Black person that's what

            "Functional implies TCO. TCO. Therefore functional."
            You are guilty of
            https://en.wikipedia.org/wiki/Affirming_the_consequent

            And C doesn't guarantee TCO. It's just available as a compiler optimization in the most commonly used implementations.

            said.

          • 2 months ago
            Anonymous

            he said that C compilers don't generate it, because C compilers suck, it's funny how with C++ I get both based abstractions AND good optimizations, C++ chads can't keep winning!

  5. 2 months ago
    Anonymous

    your stack is too small.

  6. 2 months ago
    Anonymous

    Typical troony programmer. Recursion is not made for that. Use a while loop like a real man.

  7. 2 months ago
    Anonymous

    Increasing the recursion limit: Python has a default maximum recursion depth of 1000. If a function exceeds this limit, it can be increased using the sys. setrecursionlimit(n) function

  8. 2 months ago
    Anonymous

    import sys
    print(sys.getrecursionlimit())

    sys.setrecursionlimit(1500)

    but b***h pls just use a loop

    • 2 months ago
      Anonymous

      >but b***h pls just use a loop
      With good languages, the compiler/transpiler/interpreter will do this without you having to write an ugly loop.

      • 2 months ago
        Anonymous

        this is your brain on lisp
        def repeat_infinitely() -> None:
        print("Black folk tongue my anus")
        repeat_indefinitely()

        repeat_indefinitely()

        while 1: print("Black folk tongue my anus")

        • 2 months ago
          Anonymous

          Do this with a more complex use case now...

          • 2 months ago
            ebassi

            stop being unclear, give me a use case

          • 2 months ago
            Anonymous

            Business logic that does stuff on an item, let's say the item can have a parent and so on, at a certain step if a condition is met, you'll need to do same for the parent if it exists.

          • 2 months ago
            Anonymous

            that problem has a recursive structure, monkey man
            return an objects type, check its parent if it has no type:
            def recurse(obj):
            return recurse(obj.parent) if not obj.type else obj.type

            def foo(obj):
            while not obj.type: obj = obj.parent
            return obj.type

      • 2 months ago
        Anonymous

        [...]
        [...]
        [...]
        >No TCO
        Lmao shitlang

        Good languages do this on purpose because when some pootard accidentally writes a recursive function without even realising it you do actually want it to stop/crash at some point.

    • 2 months ago
      Anonymous

      loops are not always the answer, recursion is more powerful.

      • 2 months ago
        Anonymous

        >recursion is not always the answer, goto is more powerful
        pick the tool for the job moron, calling print() infinitely is a loops job

      • 2 months ago
        Anonymous

        No one is writing Ackerman's function in a project.

      • 2 months ago
        Anonymous

        they're both equally powerful. look up the Church-Turing thesis

  9. 2 months ago
    Anonymous

    Why the frick wouldn't you use a while loop

  10. 2 months ago
    Anonymous

    >not returning from your function, just calling it again from inside itself
    Absolute clown. There would be an error at the end of those prints but you cropped it out because you're a fricking clown.

  11. 2 months ago
    Anonymous

    hehe, indians practice open defecation on a large scale...

  12. 2 months ago
    Anonymous

    >repeat_infinitely()
    Are people really this mentally disabled that they need extra hardcoded functions that do literally nothing but calling a while loop? Are pythoners really THIS stupid? Is this the future of programming languages? Getting rid of barebone structures and replace it with dumbed down functions?

  13. 2 months ago
    Anonymous

    Forth doesn't have this problem.

  14. 2 months ago
    Anonymous

    [...]

    last should be

    >doesnt understand term
    >doesnt google it
    >uses it incorrectly
    >keeps arguing
    many such cases

  15. 2 months ago
    Anonymous

    [...]

    I'm not confused at all, you just don't seem to understand why stack isn't meant for your academia bullshit

    • 2 months ago
      Anonymous

      what academia bullshit? when did i say stack was needed? i was the one person who did iterative (not recursive) dp for day 12
      why are you trying to save face on an anonymous imageboard? just close the tab

      • 2 months ago
        Anonymous

        keep posting more academia bullshit then pretending you didn't, recursion is for Black folk, and I'm a white man, sorry that's just how this world works

        Recursion is just a tool.
        It can be used badly, it can be used properly. But sometimes it is the best tool to use.

        you can also hammer in a nail with a brick, doesn't mean you'd actually do it

        • 2 months ago
          Anonymous

          so point to the post 🙂

          • 2 months ago
            Anonymous

            you can find it somewhere in

            [...]

            if you look hard enough, you should probably stick to posting only there from now on

          • 2 months ago
            Anonymous

            i accept your apology

          • 2 months ago
            Anonymous

            also add my matrix b***h boy @w2wymjrx:private.coffee

        • 2 months ago
          Anonymous

          >you can also hammer in a nail with a brick, doesn't mean you'd actually do it
          If you have no better tool.

  16. 2 months ago
    Anonymous

    Recursion is just a tool.
    It can be used badly, it can be used properly. But sometimes it is the best tool to use.

  17. 2 months ago
    Anonymous

    If you run it in Safari it will run forever

    • 2 months ago
      Anonymous

      Oops I thought this was JS at a glance, PyPy might optimize this

  18. 2 months ago
    Anonymous

    this is a tech support thread and probably a bait/flamewar thread

  19. 2 months ago
    Anonymous

    >he doesn't know what a stack is
    You have to go back.

Your email address will not be published. Required fields are marked *