[{"data":1,"prerenderedAt":310},["ShallowReactive",2],{"project-21559167":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":69,"maker_in_thread":161,"shape":169,"grid":174,"attempts":272,"same_week":273,"maker_shows":208,"maker_hidden":303,"reader_version":304,"card":305},"21559167","Serialize++","Tiny Data Serialization Library for C++","title","Show HN: Serialize++ – Tiny Data Serialization Library for C++","https:\u002F\u002Fgithub.com\u002Fapankrat\u002Fcpp-serializer","github.com","apankrat",1574014958,2019,37,44,917,2195,42,"shown","languages","serialization library","library",[24,25,26,27],"c++ serialization","binary serialization","ipc","struct serialization","roasted",-0.28,{"positive":31,"neutral":32,"mixed":33,"critical":34},1,5,0,7,13,{"idea":37,"design":38,"docs":40,"performance":41,"execution":42},{"positive":33,"critical":33},{"positive":31,"critical":39},2,{"positive":33,"critical":33},{"positive":33,"critical":33},{"positive":33,"critical":43},4,[45,33,45,33,33,31,33,31,33,45,33,45,33,33,33,32,45,33,33,33,33,33,33,33,33,31,33,33,33,33,31,33,33,33,31,31,33,33,33,31],3,null,{"problem":48,"audience":46,"pricing":46,"motivation":55,"time_to_build":46,"stack":62,"openness":68,"stage":68,"team_size":68},{"value":49,"source":50,"evidence":51},"Packing structs and containers to and from binary blobs with minimal effort","maker",[52],{"id":53,"by":11,"text":54},"21559256","Under 500 lines, this probably barely qualifies as a library, but it still allows packing structs and containers to\u002Ffrom binary blobs with as little effort as possible. It has…",{"value":56,"source":50,"evidence":57},"Originally written for an IPC protocol between cooperating processes; used internally for several projects.",[58,59],{"id":53,"by":11,"text":54},{"id":60,"by":11,"text":61},"21560030","I take it's this one - https:\u002F\u002Fgithub.com\u002FniXman\u002Fyas ? I haven't seen it before, but there are bound to be similar solutions to the same problem. The library I posted is used…",[63],{"value":64,"source":65,"evidence":66},"C++","inferred",[67],{"id":53,"by":11,"text":54},"unknown",{"praise":70,"objections":79,"requests":116,"questions":125,"alternatives":137},[71],{"value":72,"source":73,"evidence":74},"Looks nice to use, at least for the happy path","commenter",[75],{"id":76,"by":77,"text":78},"21560419","hoistbypetard","Looks nice to use, at least for the happy path. I'd also say it looks a lot like the non-intrusive pattern for the boost serialization library. That's my default tool for this…",[80,95,106],{"value":81,"source":73,"evidence":82},"Names with double underscores and global namespace pollution make it unsafe to integrate",[83,87,91],{"id":84,"by":85,"text":86},"21559758","cygaril","Being only five hundred lines doesn't disqualify it from being a library. But being impossible to safely integrate into other projects because of illegal names and polluting the…",{"id":88,"by":89,"text":90},"21559398","zabzonk","Note that names containing double underscores are reserved in C++ for the C++ implementation, which your library is not part of. Using such names can lead to all sorts of…",{"id":92,"by":93,"text":94},"21559914","unlinked_dll","Some quick and dirty things to make this useful, put it all in one header and wrap your code in a namespace. No really viable as a dependency otherwise.",{"value":96,"source":73,"evidence":97},"No endianness handling; not portable across byte orders",[98,102],{"id":99,"by":100,"text":101},"21559455","pubby","Does it handle endianness?",{"id":103,"by":104,"text":105},"21559565","chrisseaton","> The code stems for the same-machine IPC library. No point in doing any byte order normalization. Some processors can run one process in one byte order, and another process in…",{"value":107,"source":73,"evidence":108},"No version skew handling between differing struct versions",[109,113],{"id":110,"by":111,"text":112},"21560263","kjgkjhfkjf","Does this work if the two communicating processes use different versions of the struct?",{"id":114,"by":111,"text":115},"21560384","It'd be useful if you mentioned this in your caveats list, since version skew is a common gotcha that some serialization technologies (e.g. protobuf) are designed explicitly to…",[117,121],{"value":118,"source":73,"evidence":119},"Document caveats such as schema version mismatch",[120],{"id":114,"by":111,"text":115},{"value":122,"source":73,"evidence":123},"Put everything in one header and wrap in a namespace",[124],{"id":92,"by":93,"text":94},[126,133],{"value":127,"source":73,"evidence":128},"What problem does it solve that other serialization libraries don't?",[129],{"id":130,"by":131,"text":132},"21559922","hellofunk","I’m curious what problem this is trying to solve that hasn’t been already solved in many other ways. There are so many serialization libraries for C++. The API for this isn’t too…",{"value":134,"source":73,"evidence":135},"Does it work across different struct versions?",[136],{"id":110,"by":111,"text":112},[138,145,149,153],{"value":139,"source":73,"evidence":140},"cereal",[141],{"id":142,"by":143,"text":144},"21559292","Jyaif","You can add https:\u002F\u002Fgithub.com\u002FUSCiLab\u002Fcereal to your footnotes as it works in a similar way: you list the fields of your structure in a serialize function.",{"value":146,"source":73,"evidence":147},"YAS",[148],{"id":130,"by":131,"text":132},{"value":150,"source":73,"evidence":151},"Boost serialization",[152],{"id":76,"by":77,"text":78},{"value":154,"source":73,"evidence":155},"Protocol Buffers",[156,160],{"id":157,"by":158,"text":159},"21560507","jokoon","I want to store data as binary, and generally I would just lay everything in arrays, write the vector size as an int, the type id (arbitrary value) as a char, write data, done. I…",{"id":114,"by":111,"text":115},{"comments":162,"answered":45,"key":163},16,[164,165,168],{"id":60,"text":61},{"id":166,"text":167},"21559343","Done.",{"id":53,"text":54},{"commenters":170,"max_depth":171,"maker_replies":162,"first_comment_mins":172,"lifespan_hours":173},21,8,15,31,[175,177,179,181,183,185,187,188,190,192,195,196,198,200,202,205,207,210,212,214,215,217,219,221,223,225,228,232,234,236,238,240,242,244,247,250,253,256,258,260,262,264,266,269],[130,33,45,176,131,33],"project\u002Fneutral\u002Fidea",[60,33,33,178,11,31],"maker\u002Fneutral\u002Fidea",[142,31,45,180,143,33],"project\u002Fneutral\u002Fnone",[166,31,33,182,11,31],"maker\u002Fneutral\u002Fdocs",[157,39,33,184,158,33],"commenter\u002Fneutral\u002Fnone",[92,45,31,186,93,33],"project\u002Fcritical\u002Fdesign",[53,43,33,180,11,31],[84,43,31,189,85,33],"project\u002Fcritical\u002Fnone",[191,43,33,184,11,31],"21559848",[193,43,33,184,194,33],"21561257","rowanG077",[110,32,45,180,111,33],[197,32,33,180,11,31],"21560352",[114,32,45,199,111,33],"project\u002Fneutral\u002Fdocs",[201,32,33,182,11,31],"21560439",[203,32,33,184,204,33],"21560569","quietbritishjim",[206,32,33,184,11,31],"21562705",[76,208,32,209,77,33],6,"project\u002Fpositive\u002Fdesign",[99,34,45,211,100,33],"project\u002Fneutral\u002Fperformance",[213,34,33,211,11,31],"21559504",[103,34,33,184,104,33],[216,34,33,184,11,31],"21559639",[218,34,33,184,104,33],"21559652",[220,34,33,184,11,31],"21559713",[222,34,33,184,104,33],"21560220",[224,34,33,184,11,31],"21560407",[226,34,33,184,227,33],"21560548","tlb",[229,34,33,230,231,33],"21559659","other\u002Fneutral\u002Fnone","brandmeyer",[88,171,31,233,89,33],"project\u002Fcritical\u002Fexecution",[235,171,33,184,11,31],"21559416",[237,171,33,184,89,33],"21559540",[239,171,33,184,11,31],"21559587",[241,171,33,184,89,33],"21559622",[243,171,33,184,11,31],"21559799",[245,171,31,233,246,33],"21559880","jfk13",[248,171,33,184,249,33],"21560099","gpderetta",[251,171,33,184,252,33],"21559628","saagarjha",[254,171,33,184,255,33],"21561270","Bjartr",[257,171,31,186,231,33],"21559638",[259,171,31,233,249,33],"21560135",[261,171,33,184,11,31],"21560305",[263,171,33,230,249,33],"21561090",[265,171,33,230,11,31],"21562644",[267,171,33,230,268,33],"21569874","ryandrake",[270,171,31,233,271,33],"21560803","mike_hock",[],[274,279,284,289,294,299],{"id":275,"name":276,"points":277,"category":278},"21559139","Chatwoot",417,"web_saas",{"id":280,"name":281,"points":282,"category":283},"21561613","BrowserGap",253,"security_privacy",{"id":285,"name":286,"points":287,"category":288},"21587935","EasyDB",158,"data",{"id":290,"name":291,"points":292,"category":293},"21558343","2019",144,"ai",{"id":295,"name":296,"points":297,"category":298},"21545291","Scholarref tools",127,"productivity",{"id":300,"name":301,"points":302,"category":20},"21547369","Faster UTF-8 validator",122,false,"v2",{"id":306,"name":5,"line":6,"ai":303,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":307,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":308,"url":9,"mix":309,"praise":72,"objection":81,"sub":21},21559167,[24,25,26,27],"3030010103030005300000000100001000110001",[31,32,33,34],1793990998236]