[{"data":1,"prerenderedAt":337},["ShallowReactive",2],{"project-21841368":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":31,"aspects":32,"strip":35,"post_text":37,"what":38,"said":70,"maker_in_thread":140,"shape":142,"grid":147,"attempts":300,"same_week":301,"maker_shows":196,"maker_hidden":330,"reader_version":331,"card":332},"21841368","gc","A simple garbage collector for C","title","Show HN: A simple garbage collector for C","https:\u002F\u002Fgithub.com\u002Fmkirchner\u002Fgc","github.com","mkirchner",1576810136,2019,192,60,201,2195,10,"notable","languages","garbage collector library","library",[24,25,26,27],"garbage collector","c","mark and sweep","memory management","curious",0,{"positive":29,"neutral":31,"mixed":29,"critical":29},8,{"idea":33,"performance":34},{"positive":29,"critical":29},{"positive":29,"critical":29},[36,36,36,29,29,29,29,29,29,29,29,36,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,36,29,29,36,29],3,null,{"problem":39,"audience":37,"pricing":37,"motivation":51,"time_to_build":37,"stack":59,"openness":68,"stage":69,"team_size":69},{"value":40,"source":41,"evidence":42},"Automatic memory management in C without manual free calls.","commenter",[43,47],{"id":44,"by":45,"text":46},"21842940","antoinealb","The usecase for this project (according to the README) is: > The original motivation for gc is my desire to write my own LISP in C, entirely from scratch - and that required…",{"id":48,"by":49,"text":50},"21843653","hu3","Second paragraph in README: > The focus of gc is to provide a conceptually clean implementation of a mark-and-sweep GC, without delving into the depths of architecture-specific…",{"value":52,"source":41,"evidence":53},"Maker wanted to write a LISP interpreter in C from scratch, which needed garbage collection.",[54,55],{"id":44,"by":45,"text":46},{"id":56,"by":57,"text":58},"21842929","devinalvaro","As the author mentioned in the README, it's going to be used for the LISP interpreter he\u002Fshe is writing from scratch.",[60],{"value":61,"source":41,"evidence":62},"C",[63,67],{"id":64,"by":65,"text":66},"21842840","davnicwil","Just out of interest for people not familiar with C, latest goings on there etc, what's the usecase where you'd want a garbage collector in C? My (very surface level)…",{"id":48,"by":49,"text":50},"open_source","unknown",{"praise":71,"objections":80,"requests":103,"questions":111,"alternatives":120},[72],{"value":73,"source":41,"evidence":74},"Good for learning and a clean implementation of mark-and-sweep.",[75,76],{"id":48,"by":49,"text":50},{"id":77,"by":78,"text":79},"21841714","kickscondor","Cool! Thanks for this - and the link to orangeduck’s work (which further points to Cello.)",[81,92],{"value":82,"source":41,"evidence":83},"Conservative stack scanning can keep memory alive by coincidence and is slow.",[84,88],{"id":85,"by":86,"text":87},"21843542","Rochus","How about efficiency? Looks like the collector has to scan through all allocated memory and the whole stack to check whether there could be a pointer. And if any data looks like…",{"id":89,"by":90,"text":91},"21844559","gwbas1c","Typically, new garbage collected languages use the Boehm garbage collector (GC for C) in early versions, and then implement their own once they have time to fully optimize their…",{"value":93,"source":41,"evidence":94},"Adding or writing a GC for C is strange or pointless to some.",[95,99],{"id":96,"by":97,"text":98},"21843861","jeen02","Writing a GC for C is pretty strange.",{"id":100,"by":101,"text":102},"21844538","funcDropShadow","I have to second GP, writing a GC for C is strange. Not because it is written in C, but for C. State of the art efficient and low latency GC pose requirements on the memory…",[104],{"value":105,"source":41,"evidence":106},"Support for compiling TypeScript or AssemblyScript to WASM.",[107],{"id":108,"by":109,"text":110},"21843414","touchpadder","Can it help with compiling Typescript to WASM? i.e. in https:\u002F\u002Fgithub.com\u002FAssemblyScript\u002Fassemblyscript",[112,116],{"value":113,"source":41,"evidence":114},"What is the use case for a garbage collector in C?",[115],{"id":64,"by":65,"text":66},{"value":117,"source":41,"evidence":118},"How does it differ from the Boehm GC?",[119],{"id":85,"by":86,"text":87},[121,129,133],{"value":122,"source":41,"evidence":123},"Boehm GC",[124,125],{"id":89,"by":90,"text":91},{"id":126,"by":127,"text":128},"21841634","shakna","The Boehm GC seems to do both internally.",{"value":130,"source":41,"evidence":131},"Cello",[132],{"id":77,"by":78,"text":79},{"value":134,"source":41,"evidence":135},"PureRC in AssemblyScript",[136],{"id":137,"by":138,"text":139},"21845177","maxgraey","AssemblyScript already has tiny hybrid garbage collector (PureRC) which use deferred ARC and GC only for cyclic references:…",{"comments":29,"answered":29,"key":141},[],{"commenters":143,"max_depth":144,"maker_replies":29,"first_comment_mins":145,"lifespan_hours":146},44,6,67,21,[148,150,151,152,155,159,162,163,166,168,169,171,174,177,179,182,185,189,193,194,198,200,203,206,208,211,213,216,218,220,223,226,230,233,236,239,241,244,247,249,251,253,256,259,261,263,266,269,271,274,277,280,282,284,285,289,293,294,296,299],[64,29,36,149,65,29],"project\u002Fneutral\u002Fidea",[56,29,36,149,57,29],[44,29,36,149,45,29],[153,29,36,149,154,29],"21843219","tjpnz",[156,29,29,157,158,29],"21843804","commenter\u002Fneutral\u002Fidea","pdpi",[160,29,29,161,158,29],"21843812","commenter\u002Fneutral\u002Fnone",[96,29,29,157,97,29],[164,29,29,161,165,29],"21843991","Koshkin",[167,29,29,157,158,29],"21844334",[100,29,29,157,101,29],[170,29,29,161,158,29],"21844884",[172,29,29,161,173,29],"21846225","mypalmike",[175,29,29,157,176,29],"21843979","de_watcher",[89,29,29,178,90,29],"other\u002Fneutral\u002Fnone",[180,29,29,157,181,29],"21845756","weberc2",[183,29,29,178,184,29],"21848327","djmips",[186,29,29,187,188,29],"21844957","other\u002Fneutral\u002Fidea","andrepd",[190,191,36,149,192,29],"21841606",1,"tekknolagi",[126,191,29,178,127,29],[195,196,29,178,197,29],"21841670",2,"swiley",[199,196,29,178,127,29],"21841712",[201,196,29,161,202,29],"21841766","gnulinux",[204,196,29,161,205,29],"21841783","saagarjha",[207,196,29,161,127,29],"21841809",[209,196,29,161,210,29],"21842013","Twirrim",[212,196,29,161,127,29],"21842654",[214,196,29,178,215,29],"21842659","simias",[217,196,29,161,127,29],"21842676",[219,196,29,161,215,29],"21842941",[221,196,29,178,222,29],"21843210","cyphar",[224,196,29,178,225,29],"21841832","skolskoly",[227,196,29,228,229,29],"21841883","other\u002Fpositive\u002Fnone","jonas21",[231,196,29,228,232,29],"21842044","BubRoss",[234,196,29,178,235,29],"21842188","adtac",[237,196,29,178,238,29],"21842422","seventh-chord",[240,196,29,178,215,29],"21842623",[242,196,29,178,243,29],"21843256","Gibbon1",[245,196,29,178,246,29],"21843751","augustk",[248,196,29,178,215,29],"21842593",[250,196,29,178,205,29],"21842609",[252,196,29,178,215,29],"21842637",[254,196,29,178,255,29],"21844447","Someone",[257,196,29,178,258,29],"21842610","dgellow",[260,196,29,178,205,29],"21842669",[262,196,29,228,258,29],"21844144",[264,196,29,178,265,29],"21842703","cshenton",[267,196,29,178,268,29],"21843473","kitd",[270,196,29,178,197,29],"21844460",[272,196,29,178,273,29],"21842851","haecceity",[275,196,29,178,276,29],"21843126","cesarb",[278,196,29,178,279,29],"21843155","maccard",[281,196,29,178,222,29],"21843207",[85,36,36,283,86,29],"project\u002Fneutral\u002Fperformance",[48,36,36,149,49,29],[286,287,29,178,288,29],"21843986",4,"jhammond1",[290,291,29,178,292,29],"21845759",5,"mrobot",[77,144,29,228,78,29],[108,295,36,149,109,29],7,[297,295,29,161,298,29],"21844396","techntoke",[137,295,29,178,138,29],[],[302,307,312,316,321,325],{"id":303,"name":304,"points":305,"category":306},"21858226","Angeldust",716,"games",{"id":308,"name":309,"points":310,"category":311},"21855986","22120",406,"infrastructure",{"id":313,"name":314,"points":310,"category":315},"21874772","Gameslab","hardware",{"id":317,"name":318,"points":319,"category":320},"21880446","Cats of Jasnah",367,"learning_science",{"id":322,"name":323,"points":324,"category":320},"21851495","Mandarin Tone Trainer",237,{"id":326,"name":327,"points":328,"category":329},"21843382","Fellowage",186,"web_saas",false,"v2",{"id":333,"name":5,"line":6,"ai":330,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":334,"maker":11,"domain":10,"tier":19,"attempts":29,"strip":335,"url":9,"mix":336,"praise":73,"objection":82,"sub":21},21841368,[24,25,26,27],"3330000000030000000000000000000000030030",[29,31,29,29],1794036584196]