Earlier quoted context omitted.
"Also, having the debugging library alter the semantics of the program is 100% guaranteed to lead to bugs that are not visible when using the library, etc" Can you give an example of the kind of bug you expect to see?
say you have: x = 1 x = 2 bar() You set a breakpoint on the call to bar and examine the value of x. You would expect it to be 2, but what if the compiler had decided to move the allocation of x = 2 to after the call to bar? There's no reason why it shouldn't. You'd then see x = 1, which would confuse you.
scope.Declare("x", &x)
godebug.Line(ctx, scope, 3)
x = 1
godebug.Line(ctx, scope, 4)
x = 2
godebug.Line(ctx, scope, 5)
bar()
The value of x is visible to all of the godebug.Line calls, so the compiler should know that it can't move x = 2 to after the call to bar.