This is a creation in Article, where the information may have evolved or changed.
From the go language, cloud power
1 Package Main2 3 Import (4 "io"5 "Log"6 "net/http"7 "OS"8 "os/exec"9 "StrConv"Ten ) One A varUniq = Make (chanint) - - func init () { the go func () { - forI: =0; ; i++ { -Uniq <-I - } + }() - } + A Func Main () { at ifERR: = OS. Chdir (OS. TempDir ()); Err! =Nil { - log. Fatal (ERR) - } - -http. Handlefunc ("/", FrontPage) -http. Handlefunc ("/compile", Compile) inLog. Fatal (http. Listenandserve ("127.0.0.1:1234", nil)) - } to +Func FrontPage (w http. Responsewriter, _ *http. Request) { -W.write ([]byte(frontPage)) the } * $Func Err (w http. Responsewriter, e error)BOOL {Panax Notoginseng ifE! =Nil { -W.write ([]byte(E.error ())) the return true + } A return false the } + -Func Compile (w http. Responsewriter, req *http. Request) { $x: ="Play_"+ StrConv. Itoa (<-uniq) +". Go" $ -F, E: =OS. Create (x) - ifErr (W, e) { the return - }Wuyi the defer OS. Remove (x) - defer f.close () Wu -_, E =io. Copy (f, req. Body) About ifErr (W, e) { $ return - } - f.close () - ACMD: = Exec.command ("Go","Run", X) +O, E: =cmd.combinedoutput () the ifErr (W, e) { - return $ } the the w.write (o) the } the - ConstFrontPage = ' <!doctype html> in the<script> the varreq; About function Compile () { the varProg = document.getElementById ("Edit"). Value; the varreq =NewXMLHttpRequest (); theReq.onreadystatechange =function () { + if(!req | | req.readystate! =4) - return; thedocument.getElementById ("Output"). InnerHTML =Req.responsetext;Bayi } theReq.open ("POST","/compile",true); theReq.setrequestheader ("Content-type","Text/plain;charset=utf-8"); - req.send (Prog); - } the the</script> the the<body> -<textarea rows=" -"cols=" the"Id="Edit"spellcheck="false"> the the Package Main theImport"FMT" 94 Func Main () { theFmt. Println ("Hello, World") the } the</textarea>98<button onclick="compile ();">run</button> About<div id="Output"></div> -</body>101102`