This is an automated archive made by the Lemmit Bot.

The original was posted on /r/programminglanguages by /u/Obj3ctDisoriented on 2024-04-03 22:02:37.


As I am sure many of you are aware, Donald Knuth proposed a test program to verify the proper scope

resolution in Algol Compilers, which he called “The man or boy test”. in the early 1960s as many new compilers were coming out, and not all of them had properly implemented recursion/nested procedure scope resolution. The problem with the test, is that the test its self is difficult to verify, as the nature of the program involves multiple, very deep recursive calls across various scopes.

I’ve been able to test my interpreter up to k=3 and the output matches the table on wikipedia, however for values of k > 3, no matter how much I increase stack/memory space, one of them runs out before the program terminates, which is really frustrating and so got me thinking.

Is there some kind of newer “man or boy” test that is actually realistically computable? And if not, how could we go about developing one? It should simultaneously test name resolution across, recursion, and the proper implementation of either call by name or closures.