[{"data":1,"prerenderedAt":367},["ShallowReactive",2],{"project-18315292":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":39,"post_text":41,"what":42,"said":56,"maker_in_thread":123,"shape":135,"grid":140,"attempts":329,"same_week":330,"maker_shows":18,"maker_hidden":359,"reader_version":360,"card":361},"18315292","BASIC","A BASIC interpreter in Go","title","Show HN: I wrote a BASIC interpreter in Go","https:\u002F\u002Fgithub.com\u002Fskx\u002Fgobasic","github.com","stevekemp",1540639836,2018,144,76,286,2155,14,"notable","languages","interpreter","cli",[24,25,26,27],"basic interpreter","go","retro programming","bbc basic","debated",0.056,{"positive":31,"neutral":31,"mixed":32,"critical":33},3,1,5,12,{"execution":36,"idea":38},{"positive":32,"critical":37},4,{"positive":32,"critical":32},[40,40,40,40,40,33,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,33,40,40,40,31,32,32,32,31,32,31,40,40],0,null,{"problem":41,"audience":41,"pricing":41,"motivation":41,"time_to_build":41,"stack":43,"openness":54,"stage":55,"team_size":55},[44],{"value":45,"source":46,"evidence":47},"Go","maker",[48,50],{"id":49},"post",{"id":51,"by":52,"text":53},"18315498","tyingq","``` $ echo 'PRINT 3+4∗5' > test.bas $ go run main.go test.bas 34 $ echo 'PRINT (3+4*5)' > test.bas $ go run main.go test.bas 23 $ echo 'PRINT (3+4)*5' > test.bas $ go run main.go…","open_source","unknown",{"praise":57,"objections":70,"requests":88,"questions":96,"alternatives":101},[58],{"value":59,"source":60,"evidence":61},"Fun project that brings back memories of retro BASIC","commenter",[62,66],{"id":63,"by":64,"text":65},"18315808","JoeAltmaier","A fun project! I had a buddy tried this, wrote it in C++ over a week. Had console, graphics, formatting and networking (I think). The trick was first a parser, then use C++…",{"id":67,"by":68,"text":69},"18316669","donatj","Oooh wonderful! I wrote hundreds of games as a kid in QBasic and have had the idea for years to write a QBasic to JavaScript transpiler so I could actually showcase some of them…",[71,82],{"value":72,"source":60,"evidence":73},"Expression evaluator bugs: 3+4*5 gives wrong result",[74,75,79],{"id":51,"by":52,"text":53},{"id":76,"by":77,"text":78},"18315665","rpeden","In the first case, maybe it's treating the '+' as string concatenation - so 3+4 is giving 34? Then it's just dropping the 5 because it can't multiply a string and a number.…",{"id":80,"by":52,"text":81},"18315677","Ahh, you're correct. ``` go run main.go \u002Fdev\u002Ftty PRINT 1+2*5,\"\\n\" ^D 12 ```",{"value":83,"source":60,"evidence":84},"Division by zero handling is wrong",[85],{"id":86,"by":52,"text":87},"18315560","Don't know if it's the same bug, but \"PRINT 1\u002F0\" returns 1. \"PRINT (1\u002F0)\" prints nothing. Using \"LET a=1\u002F0\" raises a div by zero error. Also, \"LET a=1%0\" panics.",[89],{"value":90,"source":60,"evidence":91},"Fix expression evaluation precedence bugs",[92],{"id":93,"by":94,"text":95},"18315533","jacquesm","Yes, but it should not require that LET statement. The expression evaluator looks subtly broken.",[97],{"value":98,"source":60,"evidence":99},"Why does PRINT 3+4*5 output 34?",[100],{"id":51,"by":52,"text":53},[102,109,116],{"value":103,"source":60,"evidence":104},"Gorilla.bas and other classic BASIC games",[105],{"id":106,"by":107,"text":108},"18315877","deckarep","Does anyone remember some installs shipped with a game called gorilla.bas? A fun little game where you had two gorillas across a cityscape and the whole idea was to take turns…",{"value":110,"source":60,"evidence":111},"True BASIC",[112],{"id":113,"by":114,"text":115},"18317815","vram22","Yes, I read that there were some more structured-programming-oriented BASICs that came out some time after the structured programming movement started [1]. IIRC, one such BASIC…",{"value":117,"source":60,"evidence":118},"Peter Norvig's Python BASIC",[119],{"id":120,"by":121,"text":122},"18315984","vfinn","Peter Norvig did one for Python, and it's pretty cool: https:\u002F\u002Fgithub.com\u002Fnorvig\u002Fpytudes\u002Fblob\u002Fmaster\u002Fipynb\u002FBASIC.ipynb",{"comments":124,"answered":31,"key":125},6,[126,129,132],{"id":127,"text":128},"18317234","After I got the tokenizer working the first thing I did was implement \"PRINT\" and \"GOTO\". Specifically so that I could write: ``` 10 PRINT \"STEVE IS AWESOME!\" 20 GOTO 10 ```…",{"id":130,"text":131},"18318775","I think seeing the code would be interesting, not just for me but for others too.",{"id":133,"text":134},"18320417","Ideally post to github so everbody can read. But failing that my domain is steve.fi, and my email address is steve@.",{"commenters":136,"max_depth":137,"maker_replies":124,"first_comment_mins":138,"lifespan_hours":139},40,11,60,35,[141,145,149,151,153,155,157,159,162,165,167,170,171,173,174,176,178,181,184,186,189,191,193,195,197,199,202,204,206,208,210,211,214,216,219,221,223,225,227,229,232,235,238,241,244,245,247,250,252,255,258,261,263,267,270,273,276,279,282,284,288,290,293,294,296,297,299,301,303,304,309,312,316,320,323,326],[142,40,40,143,144,40],"18315726","other\u002Fneutral\u002Fnone","mrspeaker",[146,32,40,147,148,40],"18315460","commenter\u002Fneutral\u002Fnone","jimnotgym",[150,32,40,147,94,40],"18315529",[152,32,40,147,148,40],"18315810",[154,32,40,147,94,40],"18315836",[156,32,40,147,148,40],"18315872",[158,32,40,147,94,40],"18315909",[160,32,40,147,161,40],"18316109","protomyth",[163,32,40,147,164,40],"18316459","reificator",[127,32,40,166,11,32],"maker\u002Fneutral\u002Fnone",[168,32,33,169,94,40],"18317652","maker\u002Fpositive\u002Fnone",[130,32,40,147,11,32],[172,32,40,147,94,40],"18319644",[133,32,40,166,11,32],[175,32,40,147,94,40],"18320449",[177,32,40,147,94,40],"18323624",[179,32,40,147,180,40],"18316048","dragonwriter",[182,32,40,147,183,40],"18315878","opless",[185,32,40,147,94,40],"18315900",[187,32,40,147,188,40],"18317409","laumars",[190,32,40,147,94,40],"18317640",[192,32,40,147,188,40],"18318314",[194,32,40,147,94,40],"18318426",[196,32,40,143,188,40],"18319581",[198,32,40,143,94,40],"18319639",[200,32,40,143,201,40],"18320238","tonyedgecombe",[203,32,40,143,114,40],"18317845",[205,32,40,143,188,40],"18318272",[207,32,40,143,94,40],"18318435",[209,32,40,143,114,40],"18320094",[113,32,40,143,114,40],[212,32,40,143,213,40],"18318260","EvanAnderson",[215,32,40,143,114,40],"18320099",[217,32,40,147,218,40],"18315564","pjmlp",[220,32,40,147,148,40],"18315821",[222,32,40,147,218,40],"18315975",[106,224,40,143,107,40],2,[226,224,40,143,52,40],"18316005",[228,224,40,143,107,40],"18316801",[230,224,40,143,231,40],"18316178","xigency",[233,224,40,143,234,40],"18317646","MrBuddyCasino",[236,224,40,143,237,40],"18317742","xtagon",[239,224,40,143,240,40],"18318774","Intermernet",[242,224,40,143,243,40],"18318857","nineteen999",[120,31,40,143,121,40],[246,31,40,143,52,40],"18316030",[248,31,40,147,249,40],"18316093","elcomet",[251,31,40,147,52,40],"18316140",[253,31,40,147,254,40],"18316508","dboon",[256,31,40,147,257,40],"18318599","gnulinux",[259,31,40,147,260,40],"18316889","GordonS",[63,37,33,262,64,40],"project\u002Fpositive\u002Fexecution",[264,37,40,265,266,40],"18316653","commenter\u002Fneutral\u002Fexecution","marktangotango",[268,33,40,143,269,40],"18315589","vmlinuz",[271,33,40,143,272,40],"18316962","jonsen",[274,124,40,143,275,40],"18317037","tniemi",[277,124,40,143,278,40],"18317364","abecedarius",[280,124,40,143,281,40],"18318117","peteri",[283,124,40,143,201,40],"18320249",[285,286,31,287,94,40],"18315465",7,"project\u002Fneutral\u002Fexecution",[51,286,32,289,52,40],"project\u002Fcritical\u002Fexecution",[291,286,40,292,11,32],"18315523","maker\u002Fneutral\u002Fexecution",[93,286,32,289,94,40],[295,286,40,292,11,32],"18315537",[86,286,32,289,52,40],[298,286,40,292,11,32],"18315680",[300,286,31,292,94,40],"18315623",[76,286,31,302,77,40],"project\u002Fmixed\u002Fexecution",[80,286,32,289,52,40],[305,306,31,307,308,40],"18318611",8,"project\u002Fneutral\u002Fidea","jhallenworld",[67,310,33,311,68,40],9,"project\u002Fpositive\u002Fidea",[313,310,32,314,315,40],"18316741","project\u002Fcritical\u002Fidea","lixtra",[317,318,40,143,319,40],"18315443",10,"mikivujkovic",[321,318,40,143,322,40],"18315783","hsnewman",[324,318,40,143,325,40],"18315919","rustcharm",[327,318,40,143,328,40],"18317282","wedowhatwedo",[],[331,336,341,346,351,355],{"id":332,"name":333,"points":334,"category":335},"18321709","Algojammer",309,"dev_tools",{"id":337,"name":338,"points":339,"category":340},"18335723","SQL Trainer",303,"learning_science",{"id":342,"name":343,"points":344,"category":345},"18339215","Jobs Done",263,"productivity",{"id":347,"name":348,"points":349,"category":350},"18339551","InvaderZ",253,"games",{"id":352,"name":353,"points":354,"category":335},"18307747","TeXMe",209,{"id":356,"name":357,"points":358,"category":335},"18328410","Vespene",180,false,"v2",{"id":362,"name":5,"line":6,"ai":359,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":363,"top":18,"kw":364,"maker":11,"domain":10,"tier":19,"attempts":40,"strip":365,"url":9,"mix":366,"praise":59,"objection":72,"sub":21},18315292,0.06,[24,25,26,27],"0000050000000000000000000005000311131300",[31,31,32,33],1794036570991]