1. 29

  2. 5

    Wow, this is going to be cool! One of the biggest gripes I have with both Ruby and Python is that it’s so hard to understand what is happening when your program is no longer making forward progress and your logs just stop. When I try to sample the process, I just get code from the interpreter executing some generic byte code operations. If I’m lucky, the code is calling into some C library or implementation and I can infer where in the code the program has halted or is looping over or is spending most of it’s time.

    1. 3

      Have you tried DTrace? Ruby has been instrumented since 2.0. Most of the popular language runtimes are!

      1. 2

        My vague impression is that Python code “ought” to be easy to pull a stack trace out of, without needing to modify your program, provided you have debug symbols for the interpreter, because you can walk the Python stack automatically in gdb with a script that knows which C functions correspond to bytecode evaluation and which of their local variables correspond to line numbers and function names - see py-bt on https://wiki.python.org/moin/DebuggingWithGdb

        1. 1

          Visual studio made some really impressive stuff for seamlessly switching between c++ and python callstacks. https://docs.microsoft.com/en-us/visualstudio/python/debugging-mixed-mode

        2. 2

          Agreed! One of our Ruby apps has a section that seems far too slow for no apparent reason. Last time I worked on it, I spent a day or so fiddling with profilers, to no avail. Anything that makes that easier is a good thing for the Ruby ecosystem.