[{"data":1,"prerenderedAt":165},["ShallowReactive",2],{"project-3836417":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":39,"post_text":30,"what":40,"said":66,"maker_in_thread":107,"shape":113,"grid":117,"attempts":129,"same_week":130,"maker_shows":34,"maker_hidden":158,"reader_version":159,"card":160},"3836417","PyAutoC","Autowrap C functions at runtime for the Python\u002FC API","title","Show HN: Autowrap C functions at runtime for the Python\u002FC API","https:\u002F\u002Fgithub.com\u002Forangeduck\u002FPyAutoC","github.com","orangeduck",1334321316,2012,7,6,1458,1677,87,"shown","dev_tools","c to python bindings","library",[24,25,26,27,28],"python c api","c bindings","embedding python","autowrap c functions","ctypes alternative","quiet",null,{"positive":32,"neutral":33,"mixed":32,"critical":34},0,1,2,3,{"idea":37,"design":38},{"positive":32,"critical":32},{"positive":32,"critical":34},[35,32,33,33,32,32],{"problem":41,"audience":30,"pricing":30,"motivation":48,"time_to_build":30,"stack":52,"openness":65,"stage":65,"team_size":65},{"value":42,"source":43,"evidence":44},"Wrapping C functions for Python embedded in an existing C codebase, which Cython and ctypes handle poorly","maker",[45],{"id":46,"by":11,"text":47},"3836566","By runtime I mean that the functions which are avaliable are registered at runtime - rather than being statically wrapped or converted by some previous tool in the toolchain.…",{"value":49,"source":43,"evidence":50},"Helping embed Python in an existing C codebase",[51],{"id":46,"by":11,"text":47},[53,61],{"value":54,"source":55,"evidence":56},"C","inferred",[57],{"id":58,"by":59,"text":60},"3836489","Erwin","What do you mean \"runtime\" ? You have to compile some C code with macros to wrap a unique type signature for each function you want to wrap, so this seems to require a…",{"value":62,"source":55,"evidence":63},"Python",[64],{"id":58,"by":59,"text":60},"unknown",{"praise":67,"objections":68,"requests":85,"questions":86,"alternatives":91},[],[69,77,81],{"value":70,"source":71,"evidence":72},"Uses macros with naked primitive type names, which feels unnatural for C","commenter",[73],{"id":74,"by":75,"text":76},"3836745","unwind","For my money, something that looks like a C API with very obviously impossible things going on (passing \"naked\" names of primitive types like int and float) makes my personal…",{"value":78,"source":71,"evidence":79},"Seems to need a compile step, unlike ctypes runtime FFI",[80],{"id":58,"by":59,"text":60},{"value":82,"source":71,"evidence":83},"Cython\u002FPyrex already do this more cleanly",[84],{"id":58,"by":59,"text":60},[],[87],{"value":88,"source":71,"evidence":89},"What is meant by runtime, given a compile step is needed",[90],{"id":58,"by":59,"text":60},[92,96,100],{"value":93,"source":71,"evidence":94},"Pyrex\u002FCython",[95],{"id":58,"by":59,"text":60},{"value":97,"source":71,"evidence":98},"ctypes",[99],{"id":58,"by":59,"text":60},{"value":101,"source":71,"evidence":102},"boost.python",[103],{"id":104,"by":105,"text":106},"3836784","rollypolly","Reminds me of boost.python, which is also macro-heavy.",{"comments":34,"answered":33,"key":108},[109,110],{"id":46,"text":47},{"id":111,"text":112},"3836804","Fair enough, I agree that it isn't the prettiest or most natural of code but it isn't any \"magic\" too far beyond convention. Without C++ templates this is the only way to achieve…",{"commenters":114,"max_depth":115,"maker_replies":34,"first_comment_mins":116,"lifespan_hours":34},4,5,17,[118,120,121,123,124,126],[58,32,35,119,59,32],"project\u002Fneutral\u002Fidea",[46,32,32,119,11,33],[74,32,33,122,75,32],"project\u002Fcritical\u002Fdesign",[104,32,33,122,105,32],[111,32,32,125,11,33],"project\u002Fneutral\u002Fdesign",[127,32,32,128,75,32],"3837006","commenter\u002Fneutral\u002Fdesign",[],[131,136,140,145,150,155],{"id":132,"name":133,"points":134,"category":135},"3832877","Firebase",526,"infrastructure",{"id":137,"name":138,"points":139,"category":20},"3841370","Rails One Click",92,{"id":141,"name":142,"points":143,"category":144},"3838516","Word Wars",61,"productivity",{"id":146,"name":147,"points":148,"category":149},"3844235","Puppy Showdown",59,"consumer_social",{"id":151,"name":152,"points":153,"category":154},"3833393","Microryza",58,"learning_science",{"id":156,"name":157,"points":153,"category":20},"3834643","Shortly",false,"v2",{"id":161,"name":5,"line":6,"ai":158,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":30,"top":18,"kw":162,"maker":11,"domain":10,"tier":19,"attempts":32,"strip":163,"url":9,"mix":164,"praise":-1,"objection":70,"sub":21},3836417,[24,25,26,27,28],"301100",[32,33,32,34],1793990880375]