[{"data":1,"prerenderedAt":368},["ShallowReactive",2],{"project-21915048":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":81,"maker_in_thread":190,"shape":201,"grid":205,"attempts":330,"same_week":331,"maker_shows":32,"maker_hidden":360,"reader_version":361,"card":362},"21915048","libcodr7","fundamental collections in the spirit of C","title","Show HN: libcodr7 – fundamental collections in the spirit of C","https:\u002F\u002Fgithub.com\u002Fcodr7\u002Flibcodr7","github.com","codr7",1577726988,2019,67,51,676,2195,31,"notable","languages","c data structure library","library",[24,25,26,27],"c collections","intrusive list","red-black tree","c library","curious",-0.167,{"positive":31,"neutral":32,"mixed":33,"critical":34},4,11,0,5,20,{"execution":37,"design":38,"idea":41,"docs":43},{"positive":33,"critical":33},{"positive":39,"critical":40},2,1,{"positive":40,"critical":42},3,{"positive":40,"critical":40},[42,33,33,42,42,33,40,33,33,33,42,42,42,33,34,33,33,33,33,34,34,33,33,33,33,42,40,33,40,42,42,42,40,33,42,33,40,33,33,33],null,{"problem":47,"audience":58,"pricing":45,"motivation":64,"time_to_build":45,"stack":73,"openness":78,"stage":79,"team_size":80},{"value":48,"source":49,"evidence":50},"Reimplementing fundamental data structures in C without heavy dependencies","maker",[51,54],{"id":52,"by":11,"text":53},"21915512","That's correct, it does mostly what you tell it to and stays out of the way. If you want error checking beyond the test suite you have to do it yourself. The issues people have…",{"id":55,"by":56,"text":57},"21915443","arcticbull","The spirit of chainsaws with no hand guards haha. But actually, to me that means a thin, light API with a couple of functions and some macros. Does what it needs to do, no more.…",{"value":59,"source":60,"evidence":61},"C programmers who want thin, controllable data structures","inferred",[62,63],{"id":52,"by":11,"text":53},{"id":55,"by":56,"text":57},{"value":65,"source":49,"evidence":66},"Maker's preferred way of implementing data structures, based on experience",[67,70],{"id":68,"by":11,"text":69},"21930974","That would depend on which libraries we are discussing, I don't know them all. This is simply how I would do it based on my experience.",{"id":71,"by":11,"text":72},"21916984","The descriptions of the containers contain more of the kind of information you're looking for, it's a bit much to expect the caption to explain it all. It's as real world as it…",[74],{"value":75,"source":49,"evidence":76},"C",[77],{"id":52,"by":11,"text":53},"open_source","unknown","solo",{"praise":82,"objections":94,"requests":124,"questions":135,"alternatives":155},[83],{"value":84,"source":85,"evidence":86},"Intrusive container design and container_of usage explained well","commenter",[87,91],{"id":88,"by":89,"text":90},"21915650","DSMan195276","These structures are intended to be used like the Linux Kernel's data structures, via `container_of` (Though in the library the macro is called `c7_baseof`. But it does the exact…",{"id":92,"by":89,"text":93},"21915918","Using `container_of` lets you avoid having to use void pointers. And the macros like foreach are surprisingly readable once you give them a shot, and they're simple enough they…",[95,106,114],{"value":96,"source":85,"evidence":97},"Lacks documentation and code comments",[98,102],{"id":99,"by":100,"text":101},"21915841","slabity","\"in the spirit of C\" is pretty ambiguous. What does this do better or differently from other libraries? There's no working examples shown. There's a \"real-world examples\" link,…",{"id":103,"by":104,"text":105},"21915563","thestoicattack","I can't figure out how the linked list is used. Where is the per-element data? I thought there would be a usage example in the tests, but there wasn't.",{"value":107,"source":85,"evidence":108},"Unclear advantage over existing libraries",[109,113],{"id":110,"by":111,"text":112},"21915730","jlarocco","So what's the advantage of this over existing libraries?",{"id":99,"by":100,"text":101},{"value":115,"source":85,"evidence":116},"Red-black tree lacks delete implementation",[117,121],{"id":118,"by":119,"text":120},"21915831","haberman","I didn't realize you could implement a red-black tree with this little code. The code shown here seems to indicate that insert has at least four cases, and delete has six:…",{"id":122,"by":11,"text":123},"21916923","You'll find delete on top of the todo list, it's more complex but not horribly so. I skimmed the link, but from what I can see there are no issues there that outweigh the…",[125,130],{"value":126,"source":85,"evidence":127},"Add documentation and usage examples",[128,129],{"id":99,"by":100,"text":101},{"id":103,"by":104,"text":105},{"value":131,"source":85,"evidence":132},"Implement delete for the red-black tree",[133,134],{"id":118,"by":119,"text":120},{"id":122,"by":11,"text":123},[136,144],{"value":137,"source":85,"evidence":138},"What does 'in the spirit of C' mean here",[139,143],{"id":140,"by":141,"text":142},"21915424","Twirrim","\"In the spirit of C\". What exactly is meant by that?",{"id":99,"by":100,"text":101},{"value":145,"source":85,"evidence":146},"How does it differ from BSD queue macros",[147,151],{"id":148,"by":149,"text":150},"21915872","tptacek","I've only glanced at these; can someone more familiar explain how these are different from the BSD \"queue\" macros (and their offspring, like the tree headers)?",{"id":152,"by":153,"text":154},"21917759","95014_refugee","So, like http:\u002F\u002Ftroydhanson.github.io\u002Futhash\u002F but without the documentation? (NetBSD has had an all-macro red\u002Fblack tree implementation forever, plus the ancient and…",[156,163,167,171,178,182,186],{"value":157,"source":85,"evidence":158},"jemalloc rb tree",[159],{"id":160,"by":161,"text":162},"21915625","liuliu","Anyone who does too much C would know that manually implementing associative array (dictionary) is not fun. I started to use two implementations for my work, both worked pretty…",{"value":164,"source":85,"evidence":165},"khash",[166],{"id":160,"by":161,"text":162},{"value":168,"source":85,"evidence":169},"uthash",[170],{"id":152,"by":153,"text":154},{"value":172,"source":85,"evidence":173},"Apple CoreFoundation",[174],{"id":175,"by":176,"text":177},"21915951","rwbt","If I were starting a new project in C, I would definitely rely on a solid foundation library like APR[0] or CoreFoundation[1] without reimplementing a bunch of fundamental data…",{"value":179,"source":85,"evidence":180},"APR",[181],{"id":175,"by":176,"text":177},{"value":183,"source":85,"evidence":184},"Glib",[185],{"id":175,"by":176,"text":177},{"value":187,"source":85,"evidence":188},"BSD queue.h",[189],{"id":152,"by":153,"text":154},{"comments":191,"answered":192,"key":193},16,6,[194,195,198],{"id":122,"text":123},{"id":196,"text":197},"21915838","I prefer ordered sets with value semantics (which allows using as maps without overhead) to hash tables since I find the performance easier to reason about and often want…",{"id":199,"text":200},"21930834","Yeah, that's usually where I draw the line, embedding data in pointers :) Bitfields and packed structs is another angle that I usually don't bother with. Too many details to keep…",{"commenters":202,"max_depth":192,"maker_replies":191,"first_comment_mins":203,"lifespan_hours":204},27,46,52,[206,208,212,214,216,218,221,222,224,227,231,234,237,239,241,242,244,246,248,251,254,256,258,260,263,267,271,274,276,278,281,284,287,289,290,293,295,296,299,301,302,303,305,306,309,312,316,319,322,326,328],[118,33,42,207,119,33],"project\u002Fneutral\u002Fexecution",[209,33,33,210,211,33],"21916792","commenter\u002Fneutral\u002Fnone","hairtuq",[122,33,33,213,11,40],"maker\u002Fneutral\u002Fexecution",[160,40,42,215,161,33],"project\u002Fneutral\u002Fnone",[196,40,33,217,11,40],"maker\u002Fpositive\u002Fdesign",[219,40,42,220,161,33],"21917550","project\u002Fneutral\u002Fdesign",[199,40,33,210,11,40],[175,39,40,223,176,33],"project\u002Fcritical\u002Fidea",[225,39,33,210,226,33],"21915998","big_chungus",[228,39,33,229,230,33],"21916123","other\u002Fneutral\u002Fnone","codetrotter",[232,39,33,229,233,33],"21916597","comex",[235,39,33,229,236,33],"21917315","saagarjha",[238,39,33,229,11,40],"21930846",[103,42,42,240,104,33],"project\u002Fneutral\u002Fdocs",[88,42,42,220,89,33],[243,42,42,220,104,33],"21915726",[245,42,33,217,11,40],"21915848",[92,42,34,247,89,33],"project\u002Fpositive\u002Fdesign",[249,42,34,247,250,33],"21916197","rafa1981",[252,42,33,210,253,33],"21916622","jcheng",[255,42,33,210,89,33],"21916686",[257,42,33,210,250,33],"21917460",[259,42,33,217,11,40],"21930906",[261,42,33,229,262,33],"21916094","PCChris23",[264,42,34,265,266,33],"21916117","project\u002Fpositive\u002Fidea","bertr4nd",[268,42,34,269,270,33],"21918187","maker\u002Fpositive\u002Fdocs","kats",[272,42,33,229,273,33],"21919778","juped",[275,42,33,229,89,33],"21923258",[277,42,33,229,273,33],"21927654",[279,42,33,280,11,40],"21930879","maker\u002Fneutral\u002Fdesign",[282,42,33,283,11,40],"21915777","maker\u002Fneutral\u002Fdocs",[285,31,42,220,286,33],"21918012","sersnth",[288,31,33,280,11,40],"21930962",[152,34,40,223,153,33],[291,34,33,292,11,40],"21930985","maker\u002Fneutral\u002Fidea",[99,192,40,294,100,33],"project\u002Fcritical\u002Fdocs",[71,192,33,283,11,40],[148,297,42,298,149,33],7,"project\u002Fneutral\u002Fidea",[140,300,42,298,141,33],8,[55,300,42,220,56,33],[52,300,33,280,11,40],[110,304,40,223,111,33],9,[68,304,33,292,11,40],[307,308,42,220,273,33],"21919783",10,[310,308,33,311,11,40],"21931013","maker\u002Fneutral\u002Fnone",[313,32,40,314,315,33],"21917923","project\u002Fcritical\u002Fdesign","mastrsushi",[317,32,33,210,318,33],"21918020","colonwqbang",[320,32,33,321,11,40],"21918919","commenter\u002Fneutral\u002Fdesign",[323,324,33,229,325,33],"21917814",12,"totalperspectiv",[327,324,33,229,318,33],"21917918",[329,324,33,311,11,40],"21931021",[],[332,337,342,347,351,355],{"id":333,"name":334,"points":335,"category":336},"21923940","isocity",593,"games",{"id":338,"name":339,"points":340,"category":341},"21921165","One Page Calendar 2020",517,"productivity",{"id":343,"name":344,"points":345,"category":346},"21887848","Eschersket.ch",386,"creative",{"id":348,"name":349,"points":350,"category":336},"21927076","car",308,{"id":352,"name":353,"points":354,"category":346},"21891053","CoreUI Icons",238,{"id":356,"name":357,"points":358,"category":359},"21921293","Bash-My-AWS",155,"dev_tools",false,"v2",{"id":363,"name":5,"line":6,"ai":360,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":364,"top":18,"kw":365,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":366,"url":9,"mix":367,"praise":84,"objection":96,"sub":21},21915048,-0.17,[24,25,26,27],"3003301000333050000550000310133310301000",[31,32,33,34],1794036584571]