C# team did something similar when it first came out, I can't remember what it was called. You wrote a module and submitted the code to run on their servers. It was a similar 'critter' game where your code hunted for food, tried to reproduce, and competed with other code running in the same sandbox. There was a limited energy budget which was the main constraint on your code and meant you had to conserve energy and optimize your moves in order for your organism to thrive.
It was a really neat way to learn the language and highlighted the security of the interpreter that they could sandbox your code.
I'm sure there must be precursors to even that, probably written in Smalltalk or Mumps or something.