I didn’t realise that when you said programs should assume eval would work normally, that meant I needed to make my simulated eval take a namespace as an optional argument (and use the proper namespace containing the standard library as a default). So my program crashed whenever it simulated something that uses (eval x). There goes my clever algorithm, lol
Well, now the contest’s over I can publish an expanded version of my source code with comments. Basically it was a sort-of variation of PrudentBot designed to get cooperation from So8res’s stupid pseudo-mimics. The original variation had two conditions: if ((they cooperate with us if we cooperate) and (they defect against defectbot)) then cooperate; else defect. The second condition allows you to exploit stupid bots like cooperatebot, but since doing that causes all justicebots, etc etc to defect, I ended up removing that. (Though, looks like that was a bad idea in the end, since there were three cooperatebots submitted!)
Well, it’s not quite a true PrudentBot since PrudentBot tries to prove unconditional cooperation, rather than cooperation-if-I-cooperate.
Sorry about that. I was trying to warn people ahead of time about bugs so they could fix them, but I didn’t run sophisticated enough tests to catch that.
Oh well. I don’t think I would have won anyway. The problem seems to be that the REPL behaves very differently to non-REPL contexts, which I certainly wasn’t expecting. Actually, it looks like eval in the REPL uses the REPL namespace as a default (so for example you can type (eval '(define a 2)) (write a) and see a 2 printed out) which seems rather unconscionable to me¹, especially since the REPL namespace includes a boatload of miscellaneous modules such as racket/pretty and racket/function and probably others as well.
Possibly next time it would be useful to publish a “test harness” ahead of time which runs contestants against each other in a clean (or at least well-specified) namespace, and make it clear that the actual contest would be run using this code.
¹ Actually, now that I’ve noticed this, it looks like you could use this to write a bot that corrupts the global (REPL) namespace, and therefore the namespace of anyone trying to simulate it, maybe even forcing the opponent to cooperate by rewriting if or something. Ha!
Actually, now that I’ve noticed this, it looks like you could use this to write a bot that corrupts the global (REPL) namespace, and therefore the namespace of anyone trying to simulate it, maybe even forcing the opponent to cooperate by rewriting if or something. Ha!
I did look briefly for ways of forcing a bot running my program as a simulation to cooperate, but that sort of thing needs way too much knowledge of the programming environment for me to have a hope of succeeding.
An early attempt I had for a bot tried to save state between simulations inside the RNG seed, but that didn’t work out either...
:(
I didn’t realise that when you said programs should assume
eval
would work normally, that meant I needed to make my simulatedeval
take a namespace as an optional argument (and use the proper namespace containing the standard library as a default). So my program crashed whenever it simulated something that uses(eval x)
. There goes my clever algorithm, lolWhat did you intend your program to do? I tried to work it out from the source code but it scared me off.
Well, now the contest’s over I can publish an expanded version of my source code with comments. Basically it was a sort-of variation of PrudentBot designed to get cooperation from So8res’s stupid pseudo-mimics. The original variation had two conditions:
if ((they cooperate with us if we cooperate) and (they defect against defectbot)) then cooperate; else defect
. The second condition allows you to exploit stupid bots like cooperatebot, but since doing that causes all justicebots, etc etc to defect, I ended up removing that. (Though, looks like that was a bad idea in the end, since there were three cooperatebots submitted!)Well, it’s not quite a true PrudentBot since PrudentBot tries to prove unconditional cooperation, rather than cooperation-if-I-cooperate.
Sorry about that. I was trying to warn people ahead of time about bugs so they could fix them, but I didn’t run sophisticated enough tests to catch that.
Oh well. I don’t think I would have won anyway. The problem seems to be that the REPL behaves very differently to non-REPL contexts, which I certainly wasn’t expecting. Actually, it looks like
eval
in the REPL uses the REPL namespace as a default (so for example you can type(eval '(define a 2)) (write a)
and see a2
printed out) which seems rather unconscionable to me¹, especially since the REPL namespace includes a boatload of miscellaneous modules such asracket/pretty
andracket/function
and probably others as well.Possibly next time it would be useful to publish a “test harness” ahead of time which runs contestants against each other in a clean (or at least well-specified) namespace, and make it clear that the actual contest would be run using this code.
¹ Actually, now that I’ve noticed this, it looks like you could use this to write a bot that corrupts the global (REPL) namespace, and therefore the namespace of anyone trying to simulate it, maybe even forcing the opponent to cooperate by rewriting
if
or something. Ha!I did look briefly for ways of forcing a bot running my program as a simulation to cooperate, but that sort of thing needs way too much knowledge of the programming environment for me to have a hope of succeeding.
An early attempt I had for a bot tried to save state between simulations inside the RNG seed, but that didn’t work out either...