[{"data":1,"prerenderedAt":465},["ShallowReactive",2],{"project-17093051":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":46,"what":47,"said":80,"maker_in_thread":170,"shape":179,"grid":182,"attempts":427,"same_week":428,"maker_shows":33,"maker_hidden":457,"reader_version":458,"card":459},"17093051","Cannoli","A compiler for a subset of Python written in Rust","title","Show HN: Cannoli – A compiler for a subset of Python written in Rust","https:\u002F\u002Fgithub.com\u002Fjoncatanio\u002Fcannoli","github.com","joncatanio",1526576108,2018,292,94,92,2155,5,"legend","dev_tools","compiler","cli",[24,25,26,27],"python compiler","rust","ahead-of-time compilation","python performance","mixed",0.192,{"positive":31,"neutral":32,"mixed":33,"critical":34},7,10,1,3,21,{"idea":37,"performance":39,"design":40,"docs":42,"execution":43},{"positive":33,"critical":38},0,{"positive":38,"critical":38},{"positive":41,"critical":33},2,{"positive":33,"critical":38},{"positive":33,"critical":33},[38,38,38,34,34,38,38,38,33,38,34,38,34,38,38,34,38,38,38,18,38,38,38,38,38,38,38,38,38,38,38,34,34,38,34,18,18,18,34,45],4,null,{"problem":48,"audience":46,"pricing":46,"motivation":55,"time_to_build":62,"stack":68,"openness":77,"stage":78,"team_size":79},{"value":49,"source":50,"evidence":51},"Python language features that cause performance problems at runtime","maker",[52],{"id":53,"by":11,"text":54},"17093054","I recently finished the code for my thesis and wanted to share with you all :). The goal of the thesis was to evaluate language features of Python that were hypothesized to cause…",{"value":56,"source":50,"evidence":57},"Master's thesis evaluating Python language features that hurt performance",[58,59],{"id":53,"by":11,"text":54},{"id":60,"by":11,"text":61},"17093882","I've used Python quite a bit for various projects. For a compilers class I wrote a compiler in Python and had a blast. So I spoke with that advisor and decided I wanted to get a…",{"value":63,"source":50,"evidence":64},"Compiler developed for about 4 months",[65],{"id":66,"by":11,"text":67},"17096237","That work is great! > We have presented the first limit study that tries to quantify the costs of various dynamic language features in Python. This is spot on what we were doing…",[69,73],{"value":70,"source":50,"evidence":71},"Rust",[72],{"id":53,"by":11,"text":54},{"value":74,"source":50,"evidence":75},"Python",[76],{"id":53,"by":11,"text":54},"open_source","prototype","solo",{"praise":81,"objections":108,"requests":127,"questions":135,"alternatives":155},[82,90,97],{"value":83,"source":84,"evidence":85},"Thesis is well written and readable","commenter",[86],{"id":87,"by":88,"text":89},"17094684","alex_g","This is awesome! I definitely recommend reading through Jon's thesis (link on GitHub). It's well written and very readable even if you know nothing of Rust or compilers.",{"value":91,"source":50,"evidence":92},"Rust community and documentation praised",[93,94],{"id":53,"by":11,"text":54},{"id":95,"by":11,"text":96},"17096644","Hey Steve, glad to see you saw this post, now I get to personally thank you for all of your work on the Rust project. It's a really great community, it was very easy to get help…",{"value":98,"source":84,"evidence":99},"Name and logo are fun",[100,104],{"id":101,"by":102,"text":103},"17093667","harrisreynolds","Nice work Jon! The cannoli logo is great! Spun up a quick dashboard of the project here: https:\u002F\u002Fchart.ly\u002Fgithub-dashboard\u002Fjoncatanio\u002Fcannoli Not tons of revelations there, but…",{"id":105,"by":106,"text":107},"17097779","gabcoh","The name of the thesis this repo is a part of > Leave the Features: Take the Cannoli - Jonathan Catanio That's pretty good",[109,120],{"value":110,"source":84,"evidence":111},"Compiled code is unlikely to beat a JIT like PyPy",[112,116],{"id":113,"by":114,"text":115},"17093641","tathougies","Compiling to machine code is not a panacea for optimization. A optimized JIT compiler is going to blow an AOT compiler out of the water. Being smart about the machine code…",{"id":117,"by":118,"text":119},"17093654","xapata","JITs get to analyze both code and data and optimize for each machine deployed to. A static compiler can only analyze code and the machine used for compilation. If dependencies…",{"value":121,"source":84,"evidence":122},"Benchmark comparison with PyPy and CPython is unclear",[123],{"id":124,"by":125,"text":126},"17093597","metalliqaz","I am aware of PyPy but have not used it myself. My understanding of PyPy is that it gains performance improvements mainly through a hotspot JIT compiler. If Cannoli compiles the…",[128],{"value":129,"source":84,"evidence":130},"Compare against Nuitka or other Python compilers",[131],{"id":132,"by":133,"text":134},"17093920","jimnotgym","IIRC Nuitka the other Python compiler claims better performance than PyPy. Is this just years of optimisation? http:\u002F\u002Fnuitka.net\u002F",[136,142,148],{"value":137,"source":84,"evidence":138},"How do type hints affect AOT compilation speed",[139],{"id":140,"by":133,"text":141},"17093955","> As others have commented, AOT compilation is limited to the information available at compile time Does this mean that a AOT compiler could get a lot faster with pep 484 type…",{"value":143,"source":84,"evidence":144},"Why Python was chosen as the subject",[145],{"id":146,"by":114,"text":147},"17093665","Interesting project... Why python, out of curiosity?",{"value":149,"source":84,"evidence":150},"How the borrow checker handled generated code",[151],{"id":152,"by":153,"text":154},"17095183","ufo","How was your experience using Rust as a target language (instead of C)? I understand that Rust has lots of features for when you want to write code by hand but do those also help…",[156,160,164],{"value":157,"source":84,"evidence":158},"PyPy",[159],{"id":124,"by":125,"text":126},{"value":161,"source":84,"evidence":162},"Nuitka",[163],{"id":132,"by":133,"text":134},{"value":165,"source":50,"evidence":166},"Pythran",[167],{"id":168,"by":11,"text":169},"17094200","Yes :)! So I mention PEP 3107 (https:\u002F\u002Fwww.python.org\u002Fdev\u002Fpeps\u002Fpep-3107\u002F) in the thesis. This allows type annotations in the function signature. Cannoli leverages both type…",{"comments":171,"answered":172,"key":173},16,9,[174,175,178],{"id":53,"text":54},{"id":176,"text":177},"17093772","As others have commented, AOT compilation is limited to the information available at compile time. Various features of Python like dynamic typing and object\u002Fclass mutation (via…",{"id":168,"text":169},{"commenters":180,"max_depth":31,"maker_replies":171,"first_comment_mins":38,"lifespan_hours":181},50,22,[183,185,187,188,189,192,194,196,198,199,202,206,208,211,214,217,220,222,224,228,232,235,238,240,243,246,250,254,256,260,262,265,267,270,272,274,277,280,283,285,288,290,293,295,299,303,305,307,310,312,314,317,319,322,324,326,328,331,333,336,338,341,344,347,350,352,355,357,359,362,364,366,368,370,372,376,379,382,386,388,391,394,398,399,401,403,405,408,410,413,415,416,419,422],[53,38,38,184,11,33],"project\u002Fpositive\u002Fperformance",[124,38,38,186,125,38],"commenter\u002Fneutral\u002Fperformance",[113,38,38,186,114,38],[117,38,38,186,118,38],[190,38,38,186,191,38],"17093791","jcranmer",[193,38,38,186,118,38],"17097184",[176,38,38,195,11,33],"project\u002Fneutral\u002Fperformance",[140,38,34,197,133,38],"project\u002Fneutral\u002Fidea",[168,38,38,197,11,33],[200,38,34,197,201,38],"17094222","RussianCow",[203,38,38,204,205,38],"17094711","commenter\u002Fneutral\u002Fexecution","carry_bit",[207,38,38,204,153,38],"17095253",[209,38,38,186,210,38],"17095259","tetha",[212,38,38,213,201,38],"17095982","commenter\u002Fneutral\u002Fnone",[215,38,38,186,216,38],"17097686","ori_b",[218,38,38,186,219,38],"17099596","collyw",[132,38,38,221,133,38],"other\u002Fneutral\u002Fperformance",[223,38,38,213,11,33],"17094062",[225,38,38,226,227,38],"17095207","commenter\u002Fcritical\u002Fnone","sametmax",[229,38,33,230,231,38],"17094226","maker\u002Fcritical\u002Fnone","jcelerier",[233,38,38,234,11,33],"17094418","maker\u002Fneutral\u002Fnone",[236,38,38,226,237,38],"17094419","TomMarius",[239,38,38,226,231,38],"17097101",[241,38,38,226,242,38],"17098498","zodiac",[244,38,34,197,245,38],"17095494","welder",[247,38,38,248,249,38],"17096071","commenter\u002Fcritical\u002Fidea","halflings",[251,38,38,252,253,38],"17098326","commenter\u002Fneutral\u002Fidea","yorwba",[255,38,38,252,249,38],"17099546",[257,38,34,258,259,38],"17095680","maker\u002Fmixed\u002Fidea","gergo_barany",[66,38,38,261,11,33],"maker\u002Fmixed\u002Fperformance",[263,38,38,213,264,38],"17096809","Erwin",[266,38,38,234,11,33],"17097253",[268,38,38,213,269,38],"17097399","speedster217",[271,38,38,213,11,33],"17097658",[273,38,38,213,253,38],"17098224",[275,38,34,276,259,38],"17099872","maker\u002Fneutral\u002Fperformance",[278,38,38,186,279,38],"17097089","pddubs",[281,38,38,186,282,38],"17097202","dragonwriter",[284,38,38,186,118,38],"17097230",[286,38,38,213,287,38],"17099389","ptx",[289,38,38,252,259,38],"17099786",[291,38,38,252,292,38],"17100178","mpweiher",[294,38,38,252,259,38],"17100762",[296,38,38,297,298,38],"17096350","other\u002Fneutral\u002Fidea","noobermin",[300,38,38,301,302,38],"17096553","other\u002Fneutral\u002Fnone","steveklabnik",[95,38,38,304,11,33],"maker\u002Fpositive\u002Fnone",[306,38,18,304,302,38],"17096861",[308,38,38,301,309,38],"17098151","sandGorgon",[311,38,38,186,11,33],"17098297",[313,38,38,186,253,38],"17098361",[315,38,38,186,316,38],"17098789","avyfain",[318,38,38,276,11,33],"17098809",[320,38,38,186,321,38],"17098886","chubot",[323,38,38,186,321,38],"17098862",[325,38,38,186,309,38],"17098879",[327,38,38,186,292,38],"17100153",[329,38,38,301,330,38],"17098334","sanxiyn",[332,38,38,301,309,38],"17098463",[334,38,38,301,335,38],"17098890","stevekemp",[337,38,38,301,309,38],"17099100",[339,38,38,301,340,38],"17099216","xyproto",[342,38,38,301,343,38],"17098424","nudpiedo",[345,38,38,221,346,38],"17099503","rplnt",[348,38,38,301,349,38],"17099756","pjmlp",[351,38,38,301,227,38],"17100403",[353,38,38,301,354,38],"17100412","jnbiche",[356,38,38,301,349,38],"17100580",[358,38,38,301,227,38],"17100360",[360,38,38,213,361,38],"17101633","pcwalton",[363,38,38,213,227,38],"17101753",[365,38,38,213,361,38],"17101783",[367,38,38,301,340,38],"17099224",[369,38,34,195,219,38],"17099556",[371,38,38,186,302,38],"17101474",[373,33,34,374,375,38],"17093825","project\u002Fneutral\u002Fdesign","taoistextremist",[377,33,34,374,378,38],"17093873","jrs95",[380,33,34,374,381,38],"17094356","tothrowaway",[383,33,38,384,385,38],"17097172","other\u002Fneutral\u002Fdesign","tomjakubowski",[387,33,38,374,11,33],"17093912",[389,33,18,390,375,38],"17094240","project\u002Fpositive\u002Fidea",[392,33,38,393,11,33],"17094339","maker\u002Fpositive\u002Fidea",[395,33,33,396,397,38],"17096806","project\u002Fcritical\u002Fdesign","leshow",[101,41,18,304,102,38],[400,41,38,234,11,33],"17093811",[87,34,18,402,88,38],"project\u002Fpositive\u002Fdocs",[152,45,34,404,153,38],"maker\u002Fneutral\u002Fexecution",[406,45,38,407,11,33],"17095340","maker\u002Fpositive\u002Fexecution",[409,45,18,407,153,38],"17095413",[411,45,38,301,412,38],"17097843","emmelaich",[146,18,34,414,114,38],"maker\u002Fneutral\u002Fidea",[60,18,38,414,11,33],[105,417,18,418,106,38],6,"project\u002Fpositive\u002Fdesign",[420,31,18,418,421,38],"17100275","Beltiras",[423,424,33,425,426,38],"17098560",8,"project\u002Fcritical\u002Fexecution","alexnewman",[],[429,434,438,443,448,452],{"id":430,"name":431,"points":432,"category":433},"17126670","HyperApp",303,"languages",{"id":435,"name":436,"points":437,"category":20},"17105373","Vuido",192,{"id":439,"name":440,"points":441,"category":442},"17091262","HackerForums.co",175,"consumer_social",{"id":444,"name":445,"points":446,"category":447},"17098620","Easy TensorFlow",157,"learning_science",{"id":449,"name":450,"points":451,"category":433},"17112747","Gojay",153,{"id":453,"name":454,"points":455,"category":456},"17125754","Grayscale the Web",119,"productivity",false,"v2",{"id":460,"name":5,"line":6,"ai":457,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":461,"top":18,"kw":462,"maker":11,"domain":10,"tier":19,"attempts":38,"strip":463,"url":9,"mix":464,"praise":83,"objection":110,"sub":21},17093051,0.19,[24,25,26,27],"0003300010303003000500000000000330355534",[31,32,33,34],1794036566078]