[{"data":1,"prerenderedAt":388},["ShallowReactive",2],{"project-11555527":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":35,"aspects":36,"strip":44,"post_text":45,"what":46,"said":97,"maker_in_thread":178,"shape":187,"grid":191,"attempts":351,"same_week":352,"maker_shows":33,"maker_hidden":380,"reader_version":381,"card":382},"11555527","QBE","a new compiler back end","title","Show HN: QBE – a new compiler back end","http:\u002F\u002Fc9x.me\u002Fcompile\u002F","c9x.me","mpu",1461419778,2016,241,68,102,2264,5,"notable","languages","compiler backend","library",[21,24,25,26,27],"ssa ir","c compiler","llvm alternative","embeddable compiler","curious",0.053,{"positive":31,"neutral":32,"mixed":33,"critical":34},7,19,1,3,30,{"idea":37,"performance":39,"design":41,"execution":42,"docs":43},{"positive":38,"critical":33},4,{"positive":34,"critical":40},0,{"positive":40,"critical":33},{"positive":40,"critical":40},{"positive":40,"critical":40},[18,34,18,34,18,34,34,40,34,40,40,34,40,40,40,34,34,33,40,40,40,40,40,40,40,34,40,40,34,34,40,34,18,34,34,34,18,34,33,18],null,{"problem":47,"audience":57,"pricing":45,"motivation":66,"time_to_build":45,"stack":75,"openness":95,"stage":96,"team_size":96},{"value":48,"source":49,"evidence":50},"Provides a small compiler back end as an alternative to LLVM for use cases that do not need its full scope.","maker",[51,54],{"id":52,"by":11,"text":53},"11556074","It's an alternative if you fit in the use case. I did not try to clone LLVM.",{"id":55,"by":11,"text":56},"11555922","Thank you for your words. It is often called NIH, but eh, I learned a lot! And I think that I made some modest improvements over LLVM, you can check them out in my comparison at…",{"value":58,"source":59,"evidence":60},"compiler writers who want a small embeddable back end","inferred",[61,62],{"id":52,"by":11,"text":53},{"id":63,"by":64,"text":65},"11556616","tinco","Looks good! I know your target is 70% of the performance, but is there any fundamental reason to QBE that it couldn't be more? Suppose I ported my compiler from LLVM to QBE (I…",{"value":67,"source":49,"evidence":68},"Keep code short and simple while offering a usable alternative to LLVM.",[69,72],{"id":70,"by":11,"text":71},"11556717","It's only a goal I set to myself, if we can do better, heck let's do it! Keeping the code short, on the other hand, is really something I care about.",{"id":73,"by":11,"text":74},"11556045","It's much much smaller (I think libfirm is over 100kloc, QBE is about 6k). But the major difference is the IL: I use a human-readable and easily-printable text IL. This means…",[76,88],{"value":77,"source":78,"evidence":79},"C","commenter",[80,84],{"id":81,"by":82,"text":83},"11556373","Drup","> Its small size serves both its aspirations of correctness ... No, a compiler (hell, a software) written in C is not correct, period. If you want a C compiler that has slight…",{"id":85,"by":86,"text":87},"11558103","gnuvince","This is a wonderful idea! As a compiler person, I'm excited to see how well this works and wish you all the success in the world. > QBE aims to be a pure C embeddable backend…",{"value":89,"source":78,"evidence":90},"Myrddin",[91],{"id":92,"by":93,"text":94},"11557906","andrewchambers","My qbe C frontend is actually written in myrddin which is a lot like rust\u002Focaml. To be honest, C is not well suited to places where there is adversarial input such as servers,…","open_source","unknown",{"praise":98,"objections":115,"requests":127,"questions":146,"alternatives":164},[99,111],{"value":100,"source":78,"evidence":101},"Admired goal of small, simple compiler design",[102,106,107],{"id":103,"by":104,"text":105},"11555861","gravypod","I've always found this sort of \"I'm going to make my own\" approche as being the best for innovation. I really hope this goes through and continues development.",{"id":85,"by":86,"text":87},{"id":108,"by":109,"text":110},"11557699","riscy","At times I feel that LLVM is quite a monster, and I really like your goals of keeping things small & simple. Kudos! Can you expand on your point about \"LLVM does NOT provide full…",{"value":112,"source":78,"evidence":113},"Useful for education due to small size",[114],{"id":81,"by":82,"text":83},[116,120],{"value":117,"source":78,"evidence":118},"A compiler written in C cannot be fully correct; CompCert is preferable",[119],{"id":81,"by":82,"text":83},{"value":121,"source":78,"evidence":122},"Using C is risky for correctness; suggested safer languages like OCaml",[123],{"id":124,"by":125,"text":126},"11556199","nickpsecurity","Interesting project mpu. I like the stuff here: http:\u002F\u002Fc9x.me\u002Fcompile\u002Fdoc\u002Fllvm.html Especially the optimizations that get you the first 70%. I've been asking optimization people…",[128,135],{"value":129,"source":78,"evidence":130},"Benchmarks of compile times against other compilers",[131],{"id":132,"by":133,"text":134},"11556461","azakai","Any benchmarks of compile times vs other compilers?",{"value":136,"source":78,"evidence":137},"Support for C++ calling or coroutines",[138,142],{"id":139,"by":140,"text":141},"11556122","hobo_mark","> Very good compatibility with C code How much harder would it be to call C++?",{"id":143,"by":144,"text":145},"11556241","Ace17","Can QBE do coroutines (e.g 'yield')? Or maybe it's a front-end issue only?",[147,154],{"value":148,"source":78,"evidence":149},"How does it compare to libfirm?",[150],{"id":151,"by":152,"text":153},"11555977","npx","How does this compare to libfirm[1]? 1. http:\u002F\u002Fpp.ipd.kit.edu\u002Ffirm\u002F",{"value":155,"source":78,"evidence":156},"How does the SSA handling differ from LLVM's stack slots?",[157,161],{"id":158,"by":159,"text":160},"11556115","munin","> Implementing SSA construction is hard. To save its users from having to implement it, LLVM provides stack slots. This means that one increment of a variable v will be composed…",{"id":162,"by":159,"text":163},"11556451","> you can simply emit non-ssa form and QBE will fixup things for you That's exactly what LLVM does though, except the \"non-SSA form\" involves loads\u002Fstores to alloca'd values. The…",[165,170,174],{"value":166,"source":78,"evidence":167},"LLVM",[168,169],{"id":158,"by":159,"text":160},{"id":55,"by":11,"text":56},{"value":171,"source":78,"evidence":172},"libfirm",[173],{"id":151,"by":152,"text":153},{"value":175,"source":78,"evidence":176},"CompCert",[177],{"id":81,"by":82,"text":83},{"comments":179,"answered":180,"key":181},11,2,[182,183,184],{"id":55,"text":56},{"id":70,"text":71},{"id":185,"text":186},"11559350","I actually decided to take more time to answer your comment more throughly than others. Also, I TA'd twice the class from where you linked the article below, so I know about it :).",{"commenters":188,"max_depth":31,"maker_replies":179,"first_comment_mins":189,"lifespan_hours":190},29,78,144,[192,194,196,198,200,202,205,206,210,213,216,217,221,224,226,228,230,232,233,235,236,238,240,242,244,246,248,249,253,255,258,260,263,266,268,271,274,276,277,279,281,283,285,287,291,292,295,297,301,304,308,310,313,315,317,320,321,324,326,328,331,334,336,338,341,344,347,349],[103,40,18,193,104,40],"project\u002Fpositive\u002Fidea",[55,40,40,195,11,33],"maker\u002Fneutral\u002Fnone",[63,40,34,197,64,40],"project\u002Fneutral\u002Fperformance",[70,40,40,199,11,33],"project\u002Fneutral\u002Fidea",[201,40,18,193,64,40],"11556757",[203,40,34,204,104,40],"11556773","project\u002Fneutral\u002Fdesign",[85,33,18,193,86,40],[207,33,40,208,209,40],"11558434","other\u002Fneutral\u002Fidea","sitkack",[211,33,40,208,212,40],"11559227","marmaduke",[214,33,34,199,215,40],"11559973","jiyinyiyong",[124,180,34,204,125,40],[218,180,40,219,220,40],"11556886","commenter\u002Fneutral\u002Fnone","eatonphil",[222,180,40,223,125,40],"11558329","other\u002Fneutral\u002Fnone",[92,180,34,225,93,40],"project\u002Fneutral\u002Fexecution",[227,180,40,219,125,40],"11558043",[229,180,40,219,93,40],"11558270",[231,180,40,219,125,40],"11558333",[185,180,40,195,11,33],[234,180,40,223,125,40],"11560221",[108,34,34,195,109,40],[237,34,40,223,93,40],"11557894",[239,34,40,219,109,40],"11558046",[241,34,40,219,93,40],"11558078",[243,34,40,219,11,33],"11559570",[245,34,40,219,109,40],"11559827",[151,38,34,247,152,40],"project\u002Fneutral\u002Fnone",[73,38,40,204,11,33],[250,38,34,251,252,40],"11595711","project\u002Fneutral\u002Fdocs","swah",[158,18,33,254,159,40],"project\u002Fcritical\u002Fdesign",[256,18,40,223,257,40],"11556200","jklontz",[259,18,40,219,159,40],"11556216",[261,18,40,262,64,40],"11556605","other\u002Fneutral\u002Fperformance",[264,18,40,262,265,40],"11556787","wlievens",[267,18,40,262,109,40],"11557627",[269,18,40,223,270,40],"11559236","sklogic",[272,18,40,273,11,33],"11556381","maker\u002Fneutral\u002Fdesign",[275,18,40,204,11,33],"11556375",[162,18,40,219,159,40],[278,18,40,219,11,33],"11556493",[280,18,40,219,109,40],"11557604",[282,18,40,223,270,40],"11559210",[284,18,40,223,125,40],"11561355",[286,18,34,204,93,40],"11557896",[288,289,34,199,290,40],"11556066",6,"mioelnir",[52,289,40,199,11,33],[293,289,40,223,294,40],"11556195","dang",[296,289,40,223,11,33],"11556400",[298,289,33,299,300,40],"11556309","project\u002Fcritical\u002Fnone","chubot",[302,31,18,193,303,40],"11556234","nickysielicki",[305,306,40,223,307,40],"11556437",8,"danbruc",[143,309,34,247,144,40],9,[311,309,40,223,312,40],"11556357","ante_annum",[314,309,40,223,93,40],"11558019",[132,316,34,197,133,40],10,[318,316,18,319,93,40],"11558021","project\u002Fpositive\u002Fperformance",[139,179,34,247,140,40],[322,179,34,247,323,40],"11556139","KenoFischer",[325,179,34,247,133,40],"11556457",[327,179,34,199,93,40],"11558256",[329,179,34,247,330,40],"11557976","ori_b",[332,333,34,199,212,40],"11559244",12,[335,333,18,319,93,40],"11559581",[337,333,34,197,212,40],"11561513",[339,333,34,340,93,40],"11561558","project\u002Fmixed\u002Fperformance",[81,342,33,343,82,40],13,"project\u002Fcritical\u002Fidea",[345,342,40,346,11,33],"11556396","maker\u002Fneutral\u002Fidea",[348,342,40,223,125,40],"11561332",[350,342,18,319,93,40],"11558014",[],[353,358,363,367,371,375],{"id":354,"name":355,"points":356,"category":357},"11542005","Bootstrap 4 cheat sheet",847,"dev_tools",{"id":359,"name":360,"points":361,"category":362},"11540265","colornet",219,"ai",{"id":364,"name":365,"points":366,"category":357},"11542123","bot-wat",171,{"id":368,"name":369,"points":370,"category":20},"11577585","Type Inference",136,{"id":372,"name":373,"points":374,"category":20},"11560874","Intro.js",126,{"id":376,"name":377,"points":378,"category":379},"11547646","FocusBook",122,"productivity",false,"v2",{"id":383,"name":5,"line":6,"ai":380,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":384,"top":18,"kw":385,"maker":11,"domain":10,"tier":19,"attempts":40,"strip":386,"url":9,"mix":387,"praise":100,"objection":117,"sub":21},11555527,0.05,[21,24,25,26,27],"5353533030030003310000000300330353335315",[31,32,33,34],1794036543678]