HACKER Q&A
📣 hello_computer

Writing a Shell in Go, Advice


I like Go, and I'm thinking about writing a shell in it, but I'm not sure how well Go's runtime will play with fork and exec (probably not well). Any advice?


  👤 h4ck_th3_pl4n3t Accepted Answer ✓
Take a look at yaegi, it already can be used and embedded as a REPL and shell. [1]

[1] https://github.com/traefik/yaegi


👤 evnix
I think it does it very well.

Had some recent experience trying to write a shell and have it exposed over the web using websockets.

There are some parts where you wish it behaved like C but it does the job and is more than sufficient for a shell.