[{"data":1,"prerenderedAt":505},["ShallowReactive",2],{"project-6656419":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":45,"post_text":49,"what":50,"said":81,"maker_in_thread":201,"shape":203,"grid":208,"attempts":467,"same_week":468,"maker_shows":38,"maker_hidden":497,"reader_version":498,"card":499},"6656419","Robot Game","Game where you write Python robots to fight other players","title","Show HN: Game where you write Python robots to fight other players","http:\u002F\u002Frobotgame.org","robotgame.org","_g2lm",1383339913,2013,142,98,145,1739,9,"notable","games","programming battle game","web_app",[24,25,26,27],"python","programming game","robot battle","ai competition","curious",0.088,{"positive":31,"neutral":32,"mixed":33,"critical":18},13,51,1,74,{"execution":36,"idea":39,"docs":41,"design":42,"privacy":43,"performance":44},{"positive":37,"critical":38},2,8,{"positive":38,"critical":40},0,{"positive":33,"critical":40},{"positive":33,"critical":40},{"positive":33,"critical":33},{"positive":40,"critical":40},[33,46,46,33,46,47,40,40,46,47,40,46,33,33,46,46,46,46,47,46,33,46,48,46,46,40,48,47,37,46,46,37,46,48,40,47,47,46,47,48],3,5,4,null,{"problem":49,"audience":51,"pricing":49,"motivation":49,"time_to_build":49,"stack":63,"openness":79,"stage":80,"team_size":79},{"value":52,"source":53,"evidence":54},"Programmers who want to write bots to compete","inferred",[55,59],{"id":56,"by":57,"text":58},"6657460","special","Oh, this is right up my street. I love the minimal UI.",{"id":60,"by":61,"text":62},"6658759","Xephyrous","I'm having a lot of fun with this. I'll submit something soon. You swallow all exceptions and make the robot guard instead. This is nice, but it makes it hard to develop, because…",[64,75],{"value":65,"source":66,"evidence":67},"Python","commenter",[68,72],{"id":69,"by":70,"text":71},"6657279","brandonhsiao","Any suggestions for the language? The game and site are written in Python so that seemed most natural, plus it's a high-level language with a simple syntax. I could add more if…",{"id":73,"by":70,"text":74},"6657282","To be honest I copied it from `safe_builtins` from RestrictedPython: https:\u002F\u002Fpypi.python.org\u002Fpypi\u002FRestrictedPython I realize this is annoying, and ideally I shouldn't even be…",{"value":76,"source":66,"evidence":77},"RestrictedPython",[78],{"id":73,"by":70,"text":74},"unknown","prototype",{"praise":82,"objections":92,"requests":125,"questions":156,"alternatives":175},[83],{"value":84,"source":66,"evidence":85},"Fun concept and clean minimal UI",[86,87,91],{"id":56,"by":57,"text":58},{"id":88,"by":89,"text":90},"6657290","taber","Really cool idea! High five for you",{"id":60,"by":61,"text":62},[93,112],{"value":94,"source":66,"evidence":95},"Python cannot be safely sandboxed",[96,100,104,108],{"id":97,"by":98,"text":99},"6658503","praptak","As pointed out in another subthread, Python code is practically impossible to sandbox. Most competition isolate player code by running it in a separate process which has the…",{"id":101,"by":102,"text":103},"6657518","jerf","You may want to bear in mind that, at least last I knew, the official position of the CPython dev team is that it is not possible to sandbox CPython. If they can't do it.... At…",{"id":105,"by":106,"text":107},"6658217","gamegoblin","I am working on a marginally similar concept (interface in browser, battles on server) game, but I chose Lua as the scripting language since it is much easier to sandbox. I could…",{"id":109,"by":110,"text":111},"6662406","sitkack","Id run in docker containers or zerovm. You _cannot_ sandbox Python.",{"value":113,"source":66,"evidence":114},"Sandbox escape found, server security holes",[115,118,121],{"id":116,"by":70,"text":117},"6658381","I was looking through the code and saw someone submitted this but didn't run it: ``` def x(): g = yield yield g.gi_frame.f_back.f_back g = x() g.next() frame = g.send(g)…",{"id":119,"by":70,"text":120},"6658570","The problem is that he managed to essentially bypass my jail. He could've wiped my server if he'd wanted.",{"id":122,"by":123,"text":124},"6672955","lemiffe","Sad, I spent two days writing a program I was sure to beat all the rest. Now I won't be able to run it :( Hope you fix the \"gaping security holes\" soon (whilst keeping the code…",[126,138,148],{"value":127,"source":66,"evidence":128},"Use process isolation or language-neutral communication such as HTTP",[129,130,134],{"id":97,"by":98,"text":99},{"id":131,"by":132,"text":133},"6662640","code_duck","Make it language neutral - communicate by HTTP. That would also greatly reduce security concerns.",{"id":135,"by":136,"text":137},"6659153","asdddd333","What is the advantage of trying to sandbox native python code? Why not expose a RESTful API and let people implement in whatever language they want and not have to worry about…",{"value":139,"source":66,"evidence":140},"Add replay viewer or better match logs",[141,145],{"id":142,"by":143,"text":144},"6657202","cosarara97","It looks like I won. There's no log from the battle, though, so if I had lost I wouldn't know what to improve. In the page for the battle there's just some kind of weird string…",{"id":146,"by":70,"text":147},"6657258","Yeah, that's the game data (zlib + base64). I'm working on making some sort of replay viewer in JS.",{"value":149,"source":66,"evidence":150},"Support more languages or write bots in any language",[151,152],{"id":135,"by":136,"text":137},{"id":153,"by":154,"text":155},"6659629","aerique","The Google AI challenges had the bots communicate over stdin and stdout with the game server meaning they could be programmed in any language.",[157,164],{"value":158,"source":66,"evidence":159},"What methods are used to sandbox untrusted code",[160],{"id":161,"by":162,"text":163},"6657334","benhamner","Brandon - what methods are you using to run untrusted Python code in a secure sandbox?",{"value":165,"source":66,"evidence":166},"Why certain builtins are disabled",[167,171],{"id":168,"by":169,"text":170},"6657163","shoo","interesting! Question regarding the security restrictions - why disable built-ins such as `all`, `set`, `list`, `enumerate`, `min`, `sum`, `sorted`, etc?",{"id":172,"by":173,"text":174},"6657511","michaelmior","Many of the builtins that are disabled seem quite harmless to me (especially something like \"min\"). Curious how you decided which ones to disable.",[176,187,194],{"value":177,"source":66,"evidence":178},"Robocode",[179,183],{"id":180,"by":181,"text":182},"6657626","nilkn","Is this anything like Robocode? http:\u002F\u002Frobocode.sourceforge.net\u002F Because I had an amazing time in high school doing some local Robocode competitions. This could really bring some…",{"id":184,"by":185,"text":186},"6657494","fbnt","Or, more notably, Robocode (http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRobocode)",{"value":188,"source":66,"evidence":189},"Crobots",[190],{"id":191,"by":192,"text":193},"6657244","pmiller2","Similar to crobots (http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCrobots).",{"value":195,"source":66,"evidence":196},"Core War",[197],{"id":198,"by":199,"text":200},"6657789","bigiain","So did anyone else ever play Core War back in the mid '80s? http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCore_War I wonder whether modern virtualization techniques are secure enough to allow you…",{"comments":40,"answered":40,"key":202},[],{"commenters":204,"max_depth":205,"maker_replies":40,"first_comment_mins":206,"lifespan_hours":207},65,7,22,79,[209,211,213,216,219,222,225,228,231,232,236,237,239,242,245,247,250,253,255,258,261,265,268,272,275,277,279,280,282,283,284,287,290,293,296,298,301,304,307,309,311,313,314,317,320,323,327,330,333,337,339,342,343,344,346,350,352,354,355,357,360,363,365,366,371,374,377,379,382,384,386,389,391,394,398,401,402,405,409,413,414,416,420,423,425,428,430,432,436,438,442,445,449,453,456,458,461,464],[116,40,33,210,70,40],"project\u002Fcritical\u002Fexecution",[97,40,46,212,98,40],"project\u002Fneutral\u002Fexecution",[214,40,46,212,215,40],"6658671","Erwin",[217,40,46,212,218,40],"6658683","tluyben2",[220,40,46,212,221,40],"6659139","throwaway0094",[223,40,46,212,224,40],"6658532","Kiro",[226,40,46,212,227,40],"6658556","Marazan",[229,40,46,212,230,40],"6658560","grey-area",[119,40,33,210,70,40],[233,40,40,234,235,40],"6658813","commenter\u002Fneutral\u002Fnone","bhuztez",[109,40,33,210,110,40],[180,33,47,238,181,40],"project\u002Fpositive\u002Fidea",[240,37,47,238,241,40],"6657726","smilliken",[243,37,40,234,244,40],"6657868","kirubakaran",[198,46,40,246,199,40],"other\u002Fneutral\u002Fnone",[248,46,40,246,249,40],"6657816","blueblob",[251,46,40,246,252,40],"6658364","lennel",[254,46,40,246,199,40],"6658414",[256,46,40,246,257,40],"6658616","lawn",[259,48,46,212,260,40],"6658819","Ihmahr",[262,47,46,263,264,40],"6657432","project\u002Fneutral\u002Fdocs","oneeyedpigeon",[266,47,46,267,70,40],"6657606","maker\u002Fneutral\u002Fdocs",[269,47,46,270,271,40],"6657704","project\u002Fmixed\u002Fdocs","sonier",[60,273,47,274,61,40],6,"project\u002Fpositive\u002Fexecution",[276,273,40,234,70,40],"6658832",[278,273,40,234,61,40],"6659372",[161,205,46,212,162,40],[281,205,46,212,70,40],"6657371",[172,205,46,212,173,40],[101,205,33,210,102,40],[285,205,40,234,286,40],"6657594","pearjuice",[288,205,40,246,289,40],"6658665","jsmeaton",[291,205,46,212,292,40],"6657680","maxjus",[294,205,33,210,295,40],"6657808","oakwhiz",[297,205,46,212,249,40],"6657823",[299,205,46,263,300,40],"6661249","ybaumes",[302,205,46,212,303,40],"6657894","dbaupp",[305,205,46,212,306,40],"6659284","Breakthrough",[308,38,46,263,61,40],"6658044",[310,38,46,267,70,40],"6658309",[191,18,46,312,192,40],"project\u002Fneutral\u002Fidea",[184,18,46,312,185,40],[315,18,40,246,316,40],"6658644","jacques_chester",[318,18,40,246,319,40],"6658677","alexkus",[321,18,47,238,322,40],"6659059","DanBC",[324,325,46,312,326,40],"6657318",10,"bloometal",[328,325,40,246,329,40],"6658196","anilgulecha",[331,325,40,246,332,40],"6658253","hayksaakian",[334,335,46,336,70,40],"6656564",11,"maker\u002Fneutral\u002Fnone",[338,335,33,210,143,40],"6656961",[340,335,46,341,70,40],"6657003","maker\u002Fneutral\u002Fexecution",[142,335,46,212,143,40],[146,335,46,212,70,40],[345,335,33,210,143,40],"6657444",[347,348,47,238,349,40],"6659686",12,"drblast",[351,348,47,238,70,40],"6659732",[353,348,46,312,349,40],"6660609",[105,31,40,246,106,40],[356,31,46,336,70,40],"6658243",[358,31,46,212,359,40],"6658280","xenophobik",[361,31,40,234,362,40],"6658840","dividuum",[364,31,40,234,106,40],"6659116",[153,31,40,234,154,40],[367,368,46,369,370,40],"6657058",14,"project\u002Fneutral\u002Fdesign","L8D",[372,368,47,373,70,40],"6657297","maker\u002Fpositive\u002Fidea",[375,376,46,263,61,40],"6658450",15,[378,376,46,267,70,40],"6658572",[380,376,47,381,61,40],"6658590","maker\u002Fpositive\u002Fdocs",[122,383,33,210,123,40],16,[385,383,46,341,70,40],"6673075",[387,388,46,341,70,40],"6658269",17,[69,390,46,369,70,40],18,[392,390,46,369,393,40],"6657587","tarikjn",[395,390,46,396,397,40],"6657679","project\u002Fneutral\u002Fprivacy","anonymoushn",[399,390,46,396,400,40],"6657817","wtracy",[131,390,46,369,132,40],[135,403,33,404,136,40],19,"project\u002Fcritical\u002Fprivacy",[406,407,46,396,408,40],"6657533",20,"picomancer",[410,411,46,396,412,40],"6658653",21,"ismail",[168,206,46,369,169,40],[73,206,46,415,70,40],"maker\u002Fneutral\u002Fprivacy",[417,206,47,418,419,40],"6657295","maker\u002Fpositive\u002Fprivacy","languagehacker",[421,206,46,396,422,40],"6661376","chrismonsanto",[424,206,40,234,110,40],"6662420",[426,206,40,234,427,40],"6662560","shykes",[429,206,40,234,110,40],"6663132",[431,206,40,234,422,40],"6663330",[433,434,47,238,435,40],"6657988",23,"darylteo",[437,434,40,246,192,40],"6658043",[439,434,47,440,441,40],"6658924","maker\u002Fpositive\u002Fexecution","UndeadKernel",[443,434,46,267,444,40],"6659380","ksrm",[446,447,46,448,70,40],"6657034",24,"maker\u002Fneutral\u002Fperformance",[450,451,46,312,452,40],"6658247",25,"mydpy",[454,451,46,455,70,40],"6658442","maker\u002Fneutral\u002Fidea",[88,457,47,238,89,40],26,[459,460,46,263,260,40],"6658996",27,[462,460,46,263,463,40],"6659358","gwillem",[56,465,47,466,57,40],28,"project\u002Fpositive\u002Fdesign",[],[469,474,479,484,488,493],{"id":470,"name":471,"points":472,"category":473},"6681238","Kite",387,"productivity",{"id":475,"name":476,"points":477,"category":478},"6670113","volafile",218,"consumer_social",{"id":480,"name":481,"points":482,"category":483},"6668551","RinohType",153,"dev_tools",{"id":485,"name":486,"points":487,"category":473},"6673834","penflip.com",148,{"id":489,"name":490,"points":491,"category":492},"6655503","The Health Sherpa",126,"web_saas",{"id":494,"name":495,"points":496,"category":473},"6653827","Wanderlust",117,false,"v2",{"id":500,"name":5,"line":6,"ai":497,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":501,"top":18,"kw":502,"maker":11,"domain":10,"tier":19,"attempts":40,"strip":503,"url":9,"mix":504,"praise":84,"objection":94,"sub":21},6656419,0.09,[24,25,26,27],"1331350035031133335313433045233234055354",[31,32,33,18],1793990899152]