[{"data":1,"prerenderedAt":284},["ShallowReactive",2],{"project-14227122":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":29,"sentiment":30,"stance_mix":31,"scored_comments":35,"aspects":36,"strip":43,"post_text":45,"what":46,"said":68,"maker_in_thread":158,"shape":165,"grid":169,"attempts":246,"same_week":247,"maker_shows":41,"maker_hidden":276,"reader_version":277,"card":278},"14227122","Z80 Compiler Visualization","It's all done in a worker running asm.js modules.","maker","Show HN: Z80 Compiler Visualization","http:\u002F\u002F8bitworkshop.com\u002Fviz.html","8bitworkshop.com","sehugg",1493481354,2017,109,33,411,2242,19,"notable","dev_tools","online compiler explorer","web_app",[24,25,26,27,28],"z80 compiler","sdcc","asm.js","c to assembly","retro computing","roasted",-0.125,{"positive":32,"neutral":33,"mixed":33,"critical":34},4,1,6,12,{"idea":37,"performance":40,"execution":42},{"positive":38,"critical":39},3,0,{"positive":39,"critical":41},2,{"positive":33,"critical":32},[38,44,33,39,39,39,39,39,39,39,33,39,39,33,44,39,39,39,39,39,38,39,44,39,39,33,44,39,39,33,39,33,39],5,null,{"problem":45,"audience":45,"pricing":45,"motivation":45,"time_to_build":45,"stack":47,"openness":67,"stage":67,"team_size":67},[48,54,57,63],{"value":49,"source":7,"evidence":50},"JavaScript",[51],{"id":52,"by":11,"text":53},"14227529","It's all done in a worker running asm.js modules. I've found it to be fastest on Firefox. Would love to speed it up; haven't found the magic emscripten flags yet.",{"value":26,"source":7,"evidence":55},[56],{"id":52,"by":11,"text":53},{"value":58,"source":7,"evidence":59},"WebAssembly (attempted)",[60],{"id":61,"by":11,"text":62},"14228577","Actually, I'd like to try WebAssembly, but I keep getting \"TypeError: Module.asm.__GLOBAL__I_000101 is undefined\" errors when trying to run it.",{"value":64,"source":7,"evidence":65},"Emscripten",[66],{"id":52,"by":11,"text":53},"unknown",{"praise":69,"objections":93,"requests":116,"questions":131,"alternatives":136},[70,82],{"value":71,"source":72,"evidence":73},"Impressive tool for seeing how C compiles to Z80 code","commenter",[74,78],{"id":75,"by":76,"text":77},"14227181","rcarmo","This is amazing. It's particularly neat to watch how it handles things like \"x * 16 + 500000\" by splitting integers and using bit rotation.",{"id":79,"by":80,"text":81},"14227749","skavish","wow! this is awesome! I especially like that you can pass compiler options, like -O3 and see the magic :) I wish I had something like that back in the days when I was optimizing…",{"value":83,"source":72,"evidence":84},"Nice nostalgia for Z80 and TI calculator programming",[85,89],{"id":86,"by":87,"text":88},"14229256","Xcelerate","This brings back a lot of memories. I remember in high school printing out a sheet of Z80 opcodes (at size 6 font), writing a program on a sheet of paper, and then manually…",{"id":90,"by":91,"text":92},"14228223","geori","Ahh. I remember doing lots of TI82\u002F83 calculator programming in Z80 and never considering using a C to Z80 compiler since it was so suboptimal. C was considered slow and a memory…",[94,101,105],{"value":95,"source":72,"evidence":96},"Called it a live preview rather than a visualization",[97],{"id":98,"by":99,"text":100},"14227442","trevyn","Nice, but I wouldn't call it a visualization. More like a \"live preview\" or \"instant compiler\" or something. Also, why is it so laggy? It feels like it's being sent to a server…",{"value":102,"source":72,"evidence":103},"Feels laggy despite running in JavaScript",[104],{"id":98,"by":99,"text":100},{"value":106,"source":72,"evidence":107},"Generated code includes unnecessary optimizations misses",[108,112],{"id":109,"by":110,"text":111},"14228347","vardump","Code generation is probably missing somewhat trivial optimizations. Here's one example: ``` int func(int x) { return x * 1; } ``` ...still produces unnecessary stack…",{"id":113,"by":114,"text":115},"14227990","dorfsmay","uh! Adding a number to itself for multiplication by 2 instead of one quick shift to the left?",[117,124],{"value":118,"source":72,"evidence":119},"Add a Z80 superoptimizer web tool",[120],{"id":121,"by":122,"text":123},"14228229","richard_shelton","It would be nice to have a superoptimizer for Z80 in a form of web tool. You provide a C expression to it and the tool will return in turn the shortest code sequence. Demosceners…",{"value":125,"source":72,"evidence":126},"Support the 8085 processor",[127],{"id":128,"by":129,"text":130},"14229767","sytelus","Given that Z80 is super easy to learn assembly language, this is a great introduction on how C code would internally. I would suggest give the option for 8085 too as the its so…",[132],{"value":133,"source":72,"evidence":134},"Why is it laggy and is it server-side",[135],{"id":98,"by":99,"text":100},[137,144,151],{"value":138,"source":72,"evidence":139},"godbolt.org Compiler Explorer",[140],{"id":141,"by":142,"text":143},"14227378","jacobparker","I really like stuff like this. This tool is amazing for C++: https:\u002F\u002Fgodbolt.org\u002F It's really handy for popular architectures and it's nice that it has \"real\" compilers (GCC vs.…",{"value":145,"source":72,"evidence":146},"SDCC compiler",[147],{"id":148,"by":149,"text":150},"14228761","faragon","Still not being very efficient generating Z80 code, the SDCC is amazing! :-) P.S. SDCC mirror in GitHub: https:\u002F\u002Fgithub.com\u002Fsvn2github\u002Fsdcc",{"value":152,"source":72,"evidence":153},"Hisoft Devpac",[154],{"id":155,"by":156,"text":157},"14227459","mtkd","at the time Z80 was popular ('87 ish) there were few\u002Fno tools outside of Hisoft Devpac (http:\u002F\u002Fwww.secarica.ro\u002Fimages\u002Fzx\u002Fgenp351.gif) neither was there any internet \u002F forums etc.…",{"comments":38,"answered":41,"key":159},[160,161,162],{"id":52,"text":53},{"id":61,"text":62},{"id":163,"text":164},"14228037","The Z80 has no 16-bit shift instruction, but has 16-bit add\u002Fsubtract :)",{"commenters":166,"max_depth":44,"maker_replies":38,"first_comment_mins":167,"lifespan_hours":168},23,10,38,[170,172,175,177,179,181,183,186,188,191,194,196,200,202,205,207,208,210,212,214,217,219,220,221,223,227,229,231,234,237,238,240,242],[121,39,38,171,122,39],"project\u002Fneutral\u002Fidea",[173,39,44,174,110,39],"14228384","project\u002Fpositive\u002Fidea",[98,33,33,176,99,39],"project\u002Fcritical\u002Fperformance",[52,33,39,178,11,33],"project\u002Fneutral\u002Fperformance",[61,33,39,180,11,33],"maker\u002Fneutral\u002Fnone",[86,41,39,182,87,39],"other\u002Fneutral\u002Fnone",[184,41,39,182,185,39],"14229808","chairmanwow",[187,41,39,182,87,39],"14230049",[189,41,39,182,190,39],"14230508","mikeknoop",[192,41,39,182,193,39],"14235886","stevekemp",[109,38,33,195,110,39],"project\u002Fcritical\u002Fexecution",[197,38,39,198,199,39],"14228950","commenter\u002Fneutral\u002Fexecution","Lerc",[201,38,39,198,110,39],"14229114",[203,38,33,195,204,39],"14231071","Questron",[75,32,44,206,76,39],"project\u002Fpositive\u002Fexecution",[155,32,39,182,156,39],[209,32,39,182,110,39],"14228452",[211,32,39,182,156,39],"14228570",[213,32,39,182,110,39],"14229276",[215,32,39,182,216,39],"14230832","timthorn",[90,44,38,218,91,39],"project\u002Fmixed\u002Fperformance",[141,34,39,182,142,39],[79,34,44,174,80,39],[222,34,39,182,149,39],"14230807",[224,225,39,182,226,39],"14228057",7,"ravishah",[148,228,33,176,149,39],8,[128,230,44,174,129,39],9,[232,230,39,182,233,39],"14229855","andrepd",[235,230,39,182,236,39],"14230118","ucs",[113,167,33,195,114,39],[163,167,39,239,11,33],"maker\u002Fneutral\u002Fexecution",[241,167,33,195,110,39],"14228494",[243,244,39,182,245,39],"14230785",11,"Digit-Al",[],[248,253,257,262,267,272],{"id":249,"name":250,"points":251,"category":252},"14226889","jacquesmattheij.com",1264,"hardware",{"id":254,"name":255,"points":256,"category":20},"14254357","Cone",418,{"id":258,"name":259,"points":260,"category":261},"14240626","Kryptonite",338,"security_privacy",{"id":263,"name":264,"points":265,"category":266},"14212054","Helio Workstation",305,"creative",{"id":268,"name":269,"points":270,"category":271},"14245538","VPS Comparison",228,"infrastructure",{"id":273,"name":274,"points":275,"category":20},"14210877","Pygit",208,false,"v2",{"id":279,"name":5,"line":6,"ai":276,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":280,"top":18,"kw":281,"maker":11,"domain":10,"tier":19,"attempts":39,"strip":282,"url":9,"mix":283,"praise":71,"objection":95,"sub":21},14227122,-0.12,[24,25,26,27,28],"351000000010015000003050015001010",[32,33,33,34],1793990958405]