What if Conway's Game of Life was a cloud-native serverless application in WebAssembly with WASI using TinyGo and deployed using Fermyon Spin?
Welcome to cloudlife... "Life As A Service"
Uses Vita for the Go language Game of Life implementation.
-
Clone this repo
spin build
spin up
All operations on the multiverse are applied to all existing universes.
-
POST /multiverse?n=2Creates new universes in a grid. Pass the
nquery parameter to create a specific number of universes.Returns the list of IDs for each universe that is created.
-
GET /multiverseReturns the list of IDs for each universe that has been created.
-
PUT /multiverseAdvances each universe by 1 generation.
Returns the cells for each universe after it has advanced.
-
DELETE /multiverseDeletes all universes.
All operations on a universe only apply to that specific universe.
-
POST /universeCreates a new universe.
Returns the ID for the new universe that is created.
-
GET /universe/:idReturns the current cells for the universe with the specific ID.
-
PUT /universe/:idAdvances the universe with the specific ID by 1 generation.
Returns the cells for the universe after it has advanced.
-
PUT /universe/:id?topid=:tid&bottomid=:bid&leftid=:leftid&rightid=:ridSets the neighbors for the universe with the specific ID to the universes with the respective ID and position e.g. top, bottom, left, and right. Does not advance the universe to the next generation.
-
DELETE /universe/:idDeletes the universe with the specific ID.
lifectl is a command life tool to control cloudlife applications.
cd ./cmd/lifectl
go install .
$ lifectl
NAME:
lifectl - Control your cloudlife
USAGE:
lifectl [global options] command [arguments]
COMMANDS:
start Starts a cloudlife application
run Runs the cloudlife application
stop Stops a cloudlife application
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--host value Host to use to connect to the cloudlife application (default: "http://localhost:3000")
--help, -h show help
