Similar in spirit to https://play.golang.org/ and BoneScript which is on BeagleBone's default image.
The rough idea looks like:
- Create a template:
package main
import (
"log"
"periph.io/x/host/v3"
)
func main() {
if _, err := host.Init(); err != nil {
log.Fata(err)
}
{{.UserCode}}
}
- Inject the user's code in the template.
- Run
goimports -w, found at https://golang.org/x/tools/cmd/goimports
- Send the formatted user code back to the Web UI.
- Report errors. In this case, the formatted code should be sent back with highlighting.
- Stream results back via websocket.
- Expose a
Stop button that sends SIGTERM to the process.