periph-play: create an interactive web ui to run adhoc programs
Opened this issue · 0 comments
maruel commented
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 sendsSIGTERM
to the process.