Hello HN. There's a side-project I've been wanting to work on for years, but there's one thing that keeps holding me back because it won't work without it.
It all started when I read about people running poker-bots. Systems that play poker on poker websites. I wanted to try my hand at writing a robot but I didn't want to play against humans. Those websites have rules against robotic players and I didn't want to spend time fighting that arms race. I wanted a system with an API designed for robots to interact with. I also didn't want to gamble with actual money. This would be an intellectual effort for me so I'd want all the "chips" the robots gamble with to all evaporate once one robot has been declared the winner.
Not being able to find such a venue, I wanted to try building one. Wanting to avoid human players meant that a tournament would need to be held in a closed system where all the players are completely autonomous, allowing no interaction with the outside world.
I sketched out my plan. Each developer would upload a ZIP file to my server that contained the program code. The controller code on my server would unzip and launch each player process, connecting to the stdin and stdout of each process. The controller would send event notifications into the stdin ("You have been dealt this hand.") and read player instructions from the stdout ("Discard card #3.")
That was when I realised my problem. If I allow strangers to upload any program they like, people are going to send me malicious programs. Bitcoin miners. Spam senders. All sorts of potential for evil.
I considered JavaScript as that's designed to run inside a restricted environment but it was impractical. Do I launch a web browser from my server? How does my service code communicate with the JS code? Can I stop JS code from connecting to the internet?
Even if I could work through to a practical solution, I didn't really want JS, I wanted Python.
Googling for answers led me to a set of projects that didn't quite fit the bill. Most hadn't been touched for years and others had a different security model to what I needed. If this project was going to get anywhere I'd need a partner who knows exactly how to run a process on a Linux server in a way that can't do anything other than be a poker bot.
So here I am. I'm hoping that projects like the one I described already exist and that'd be great. Maybe someone knows of a way to launch the Python interpreter but won't allow code to start reading files or connect to other services on the internet.
Or maybe I should stick with my plan B where player code runs on the developers own machines and I accept the possibility of human players as an unavoidable reality.