[{"data":1,"prerenderedAt":299},["ShallowReactive",2],{"project-10919564":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":27,"sentiment":28,"stance_mix":29,"scored_comments":34,"aspects":35,"strip":41,"post_text":42,"what":43,"said":74,"maker_in_thread":135,"shape":144,"grid":148,"attempts":260,"same_week":261,"maker_shows":31,"maker_hidden":291,"reader_version":292,"card":293},"10919564","py14","Python to C++14 transpiler","title","Show HN: Python to C++14 transpiler","https:\u002F\u002Fgithub.com\u002Flukasmartinelli\u002Fpy14","github.com","morgenkaffee",1453041752,2016,96,44,394,2264,18,"notable","languages","transpiler","cli",[24,21,25,26],"python to c++","c++14 templates","python compiler","curious",-0.217,{"positive":30,"neutral":31,"mixed":32,"critical":33},1,7,0,5,13,{"idea":36,"execution":38,"design":40},{"positive":30,"critical":37},2,{"positive":32,"critical":39},3,{"positive":32,"critical":32},[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,33,30,39,30,32,30,39,39,39,32,32,39,39,39,30,32],null,{"problem":44,"audience":42,"pricing":42,"motivation":52,"time_to_build":42,"stack":60,"openness":71,"stage":72,"team_size":73},{"value":45,"source":46,"evidence":47},"Translates Python code into C++14, mainly to showcase C++14 templates","commenter",[48],{"id":49,"by":50,"text":51},"10922710","haberman","Key sentence: \"The goal is to showcase the power of C++14 templates and not to create a fully functional transpiler.\" Viewed through that lens, this is a really novel and cool…",{"value":53,"source":54,"evidence":55},"Showcase the power of C++14 templates; the maker has no compiler design background","maker",[56,57],{"id":49,"by":50,"text":51},{"id":58,"by":11,"text":59},"10923156","You are right. C++ is quite different to Python and so it should be called a compiler. But it fits the project since I don't have any background or experience in compiler design.",[61,67],{"value":62,"source":63,"evidence":64},"Python","inferred",[65],{"id":66},"post",{"value":68,"source":63,"evidence":69},"C++14",[70],{"id":49,"by":50,"text":51},"open_source","prototype","unknown",{"praise":75,"objections":80,"requests":110,"questions":111,"alternatives":119},[76],{"value":77,"source":46,"evidence":78},"Novel and cool demonstration of C++14 templates",[79],{"id":49,"by":50,"text":51},[81,88,99],{"value":82,"source":46,"evidence":83},"Only works on a statically typeable subset of Python",[84],{"id":85,"by":86,"text":87},"10923314","Sharlin","Should be noted that this only works on a \"statically typeable\" subset of Python where every variable has a de facto static type inferred at the first assignment. For instance,…",{"value":89,"source":46,"evidence":90},"Similar to existing projects like Pythran and Nuitka",[91,95],{"id":92,"by":93,"text":94},"10922888","Joky","This seems to me to be very close to what Pythran [0] is doing (since 2011), except that Pythran includes some type inference and bridge with Python code. So view through that…",{"id":96,"by":97,"text":98},"10922895","Fede_V","There's a few similar process. Shedskin, Nuitka, Pythran, etc. They are all pretty cool projects, and worth looking into just to learn new techniques.",{"value":100,"source":46,"evidence":101},"Debate over whether 'transpiler' is a valid term",[102,106],{"id":103,"by":104,"text":105},"10923097","pjmlp","It is called a compiler even it outputs code in another language, transpiler is some neologism from JavaScript developers without a background in compiler design.",{"id":107,"by":108,"text":109},"10923136","srean","> It is called a compiler even it outputs code in another language Indeed and most compilers do exactly that. Cant help getting a little annoyed whenever I hear this 'transpiler'…",[],[112],{"value":113,"source":46,"evidence":114},"How does the generated C++ know which template types support the \u003C= operator?",[115],{"id":116,"by":117,"text":118},"10923350","seivan","Would someone be kind to explain how the transpiler\u002Fcompiler knows that num of T1 generic(?) type can be used with the \u003C= operator? Or that something the user themselves have to…",[120,124,131],{"value":121,"source":46,"evidence":122},"Pythran",[123],{"id":92,"by":93,"text":94},{"value":125,"source":46,"evidence":126},"Nuitka",[127],{"id":128,"by":129,"text":130},"10924717","anon4","There is also nuitka - http:\u002F\u002Fnuitka.net\u002F",{"value":132,"source":46,"evidence":133},"Shedskin",[134],{"id":96,"by":97,"text":98},{"comments":39,"answered":30,"key":136},[137,138,141],{"id":58,"text":59},{"id":139,"text":140},"10923413","Yes you would have to program in a subset of python. But type annotations are not always needed. For the array I do a little hackery. You can define the array without an initial…",{"id":142,"text":143},"10923432","It is all magic of Clang or GCC. Once you call the template with T1 the C++ compiler will enforce that your passed type supports the \u003C= operator.",{"commenters":145,"max_depth":33,"maker_replies":39,"first_comment_mins":146,"lifespan_hours":147},32,894,31,[149,151,152,154,157,159,162,164,167,170,173,175,177,179,182,185,188,191,194,197,199,202,204,207,209,212,215,217,219,221,223,225,228,231,232,235,238,239,242,244,247,250,253,257],[103,32,32,150,104,32],"other\u002Fneutral\u002Fnone",[107,32,32,150,108,32],[58,32,32,153,11,30],"maker\u002Fneutral\u002Fnone",[155,32,32,150,156,32],"10923195","jmgao",[158,32,32,150,86,32],"10923274",[160,32,32,150,161,32],"10923226","nimitkalra",[163,32,32,150,104,32],"10923254",[165,32,32,150,166,32],"10923644","kqr",[168,32,32,150,169,32],"10923335","omaranto",[171,32,32,150,172,32],"10923409","chrisseaton",[174,32,32,150,104,32],"10923967",[176,32,32,150,172,32],"10924275",[178,32,32,150,104,32],"10924635",[180,32,32,150,181,32],"10923450","agumonkey",[183,32,32,150,184,32],"10923487","tormeh",[186,32,32,150,187,32],"10923645","lmm",[189,32,32,150,190,32],"10923673","poizan42",[192,32,32,150,193,32],"10923733","throwaway999888",[195,32,32,150,196,32],"10925180","Symmetry",[198,32,32,150,156,32],"10927273",[200,32,32,150,201,32],"10923822","kitd",[203,32,32,150,104,32],"10923981",[205,32,32,150,206,32],"10924117","Ded7xSEoPKYNsDd",[208,32,32,150,104,32],"10924625",[210,32,32,150,211,32],"10924446","drvortex",[213,32,32,150,214,32],"10925035","programmer_man",[49,30,33,216,50,32],"project\u002Fpositive\u002Fidea",[92,30,30,218,93,32],"project\u002Fcritical\u002Fidea",[128,30,39,220,129,32],"project\u002Fneutral\u002Fidea",[85,37,30,222,86,32],"project\u002Fcritical\u002Fexecution",[139,37,32,224,11,30],"maker\u002Fneutral\u002Fexecution",[226,37,30,222,227,32],"10924107","exprx",[229,37,30,222,230,32],"10925436","marvy",[96,39,39,220,97,32],[233,39,39,234,108,32],"10923064","project\u002Fneutral\u002Fnone",[116,236,39,237,117,32],4,"project\u002Fneutral\u002Fdesign",[142,236,32,237,11,30],[240,236,32,150,241,32],"10923528","inglor",[243,236,39,237,117,32],"10923601",[245,236,39,237,246,32],"10924099","jschwartzi",[248,236,39,237,249,32],"10925599","aldanor",[251,33,30,218,252,32],"10924623","techdragon",[254,33,32,255,256,32],"10924931","commenter\u002Fneutral\u002Fnone","anc84",[258,33,32,255,259,32],"10925203","marktangotango",[],[262,267,272,277,282,286],{"id":263,"name":264,"points":265,"category":266},"10930718","Nativefier",162,"dev_tools",{"id":268,"name":269,"points":270,"category":271},"10908987","OSwatch",150,"productivity",{"id":273,"name":274,"points":275,"category":276},"10938510","Chatlio",136,"web_saas",{"id":278,"name":279,"points":280,"category":281},"10915761","IPalyzer",123,"infrastructure",{"id":283,"name":284,"points":285,"category":276},"10924533","CMS.js",117,{"id":287,"name":288,"points":289,"category":290},"10941966","resdet",113,"learning_science",false,"v2",{"id":294,"name":5,"line":6,"ai":291,"cat":20,"year":13,"points":14,"comments":15,"rec":27,"s":295,"top":18,"kw":296,"maker":11,"domain":10,"tier":19,"attempts":32,"strip":297,"url":9,"mix":298,"praise":77,"objection":82,"sub":21},10919564,-0.22,[24,21,25,26],"0000000000000000000000005131013330033310",[30,31,32,33],1793990936474]