[{"data":1,"prerenderedAt":315},["ShallowReactive",2],{"project-1959896":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":42,"post_text":44,"what":45,"said":69,"maker_in_thread":163,"shape":174,"grid":177,"attempts":277,"same_week":278,"maker_shows":43,"maker_hidden":307,"reader_version":308,"card":309},"1959896","Trellis","New Lisp data structure","title","Show HN: New Lisp data structure","https:\u002F\u002Fgithub.com\u002Fdaniel-cussen\u002FTrellis","github.com","daniel-cussen",1291241434,2010,62,45,29,370,8,"notable","languages","lisp data structure","library",[24,25,26,27,28],"lisp","data structure","cons cells","random access list","functional programming","curious",-0.172,{"positive":32,"neutral":33,"mixed":32,"critical":34},0,16,6,22,{"performance":37,"execution":39,"idea":40},{"positive":32,"critical":38},2,{"positive":32,"critical":32},{"positive":32,"critical":41},3,[43,32,32,32,41,32,41,43,32,41,32,43,43,41,32,41,43,32,32,32,32,32,32,32,32,43,41,32,41,32,41,41,41,32,41,32,41,41,32,41],1,null,{"problem":46,"audience":44,"pricing":44,"motivation":53,"time_to_build":44,"stack":59,"openness":67,"stage":68,"team_size":67},{"value":47,"source":48,"evidence":49},"Offers list-like sequences with logarithmic lookup instead of linear time.","maker",[50],{"id":51,"by":11,"text":52},"1960060","Also, I'd like to talk about what it does for those that don't feel like reading the GitHub. It's almost exactly like linked lists, except for two things: one, it is less…",{"value":54,"source":48,"evidence":55},"Maker found the structure exciting and wanted to share it.",[56],{"id":57,"by":11,"text":58},"1960270","Update: I feel I'm not nailing the questions about why this is better than other data types or why this is not identical to other data types. But I found this:…",[60],{"value":61,"source":62,"evidence":63},"Common Lisp","inferred",[64],{"id":65,"by":11,"text":66},"1960504","> That's just broken, and will lead to horrible bugs. You mean you think people will use this? Thanks :) Here's how I was thinking of fixing it: (setf nol 'nol) ; make nol…","unknown","prototype",{"praise":70,"objections":79,"requests":119,"questions":128,"alternatives":143},[71],{"value":72,"source":73,"evidence":74},"Interesting idea and clever structure.","commenter",[75],{"id":76,"by":77,"text":78},"1960218","pjscott","Finger trees are even more impressive than this (very clever) data structure. A sequence based on finger trees supports: * O(lg n) lookup, split, concatenate, random…",[80,91,106,113],{"value":81,"source":73,"evidence":82},"Cons and car\u002Fcdr are O(log n) rather than O(1), so it is not a general list replacement.",[83,87],{"id":84,"by":85,"text":86},"1960280","rntz","The two most common operations on lists in typical functional programs are consing and deconsing, which are O(1). The most analogous operations on trellises are appending and…",{"id":88,"by":89,"text":90},"1960442","jbapple","> How do these differ and what advantage do they offer over Chris Okasaki's Random Access Lists? These are inferior, as Okasaki's structure offers O(1) worst-case cons, even when…",{"value":92,"source":73,"evidence":93},"Existing structures like Okasaki's random access lists and finger trees do the same job better.",[94,98,102],{"id":95,"by":96,"text":97},"1960261","somnium","How do these differ and what advantage do they offer over Chris Okasaki's Random Access Lists? http:\u002F\u002Fwww.eecs.usma.edu\u002Fwebs\u002Fpeople\u002Fokasaki\u002Ffpca95.ps Scheme SRFI with…",{"id":99,"by":100,"text":101},"1960427","jules","This \"list of trees of increasing size\" data structure is not new. You can find plenty of these structures in Okasaki's Purely Functional Data Structures (look in the chapter…",{"id":103,"by":104,"text":105},"1960145","gwern","I've never been very good at data structures, but the increasing size of trees makes it sound like finger trees: http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFinger_tree",{"value":107,"source":73,"evidence":108},"Storing NIL at the end of a trellis is broken.",[109,110],{"id":84,"by":85,"text":86},{"id":111,"by":100,"text":112},"1960447","That's just broken, and will lead to horrible bugs. There is a reason why normal Lisp lists end with NIL instead of storing the last element in the last cdr.",{"value":114,"source":73,"evidence":115},"Claims about the structure's advantages were not well supported.",[116],{"id":117,"by":89,"text":118},"1961110","> I get the feeling these can do things Random Access Lists can't It seems like you came to this topic without knowing a lot about purely functional data structures already. It's…",[120],{"value":121,"source":73,"evidence":122},"Explain how it differs from existing random access list and VList designs.",[123,124],{"id":95,"by":96,"text":97},{"id":125,"by":126,"text":127},"1960057","j_baker","Why would one want to use this over the VList? It provides O(1) access on average and O(log n) access in the worst case. Plus, it also does O(log n) length finding.…",[129,136],{"value":130,"source":73,"evidence":131},"How does it compare to balanced binary trees with subtree sizes?",[132],{"id":133,"by":134,"text":135},"1960196","jemfinch","How are these better than balanced binary trees that keep subtree size in the node?",{"value":137,"source":73,"evidence":138},"Could it be used in Clojure, and how does it compare to vectors?",[139],{"id":140,"by":141,"text":142},"1960100","nickik","Very intressting. Could the be used in clojure (I mean do the provid the same imutabillity concells do) What are the benefits of these over clojure vectors?",[144,148,152,156],{"value":145,"source":73,"evidence":146},"Okasaki's random access lists",[147],{"id":95,"by":96,"text":97},{"value":149,"source":73,"evidence":150},"Finger trees",[151],{"id":103,"by":104,"text":105},{"value":153,"source":73,"evidence":154},"VLists",[155],{"id":125,"by":126,"text":127},{"value":157,"source":73,"evidence":158},"Clojure finger-tree library",[159],{"id":160,"by":161,"text":162},"1960542","tensor","As I understand it, the finger trees library for clojure would give you more flexibility and better performance. https:\u002F\u002Fgithub.com\u002Fclojure\u002Fdata.finger-tree",{"comments":164,"answered":165,"key":166},15,9,[167,170,171],{"id":168,"text":169},"1960304","About the bug, I talk about this at the end of trellis2.lisp. I didn't want to weird people out by adding a second sentinel to the list. I realize these aren't the best at any…",{"id":65,"text":66},{"id":172,"text":173},"1960822","I get the feeling these can do things Random Access Lists can't (I haven't experimented yet, but I think trellises can support both data and code).",{"commenters":175,"max_depth":18,"maker_replies":164,"first_comment_mins":165,"lifespan_hours":176},19,40,[178,180,182,184,185,188,192,194,195,198,200,203,206,208,210,211,213,214,217,219,221,223,226,229,231,233,236,239,240,242,245,247,249,251,253,255,257,258,260,263,265,268,271,273,276],[84,32,43,179,85,32],"project\u002Fcritical\u002Fperformance",[168,32,32,181,11,43],"maker\u002Fneutral\u002Fexecution",[111,32,32,183,100,32],"commenter\u002Fcritical\u002Fexecution",[65,32,32,181,11,43],[186,32,41,181,187,32],"1960583","alec",[189,32,32,190,191,32],"1961314","commenter\u002Fneutral\u002Fnone","Shamiq",[95,43,41,193,96,32],"project\u002Fneutral\u002Fidea",[88,43,43,179,89,32],[196,43,41,197,89,32],"1960520","project\u002Fneutral\u002Fperformance",[172,43,32,199,11,43],"project\u002Fpositive\u002Fidea",[201,43,41,202,96,32],"1960901","maker\u002Fneutral\u002Fidea",[204,43,32,205,11,43],"1965891","maker\u002Fneutral\u002Fnone",[117,43,43,207,89,32],"maker\u002Fcritical\u002Fnone",[99,38,43,209,100,32],"project\u002Fcritical\u002Fidea",[103,41,41,193,104,32],[212,41,32,202,11,43],"1960163",[76,41,41,193,77,32],[57,215,32,216,11,43],4,"maker\u002Fpositive\u002Fidea",[218,215,43,209,89,32],"1960431",[220,215,32,190,11,43],"1960566",[222,215,32,190,89,32],"1960701",[224,215,32,190,225,32],"1961635","varjag",[227,215,32,190,228,32],"1961791","aperiodic",[230,215,32,190,225,32],"1962080",[232,215,32,190,89,32],"1962452",[234,215,32,235,228,32],"1963074","other\u002Fneutral\u002Fnone",[237,238,32,199,11,43],"1959937",5,[51,238,32,193,11,43],[241,238,43,209,89,32],"1960485",[243,34,41,197,244,32],"1960118","aidenn0",[246,34,32,197,11,43],"1960148",[133,248,41,193,134,32],7,[250,248,32,199,11,43],"1960206",[252,248,41,193,134,32],"1960465",[254,248,32,193,11,43],"1960768",[256,248,41,197,89,32],"1960495",[125,18,41,193,126,32],[259,18,32,199,11,43],"1960089",[261,18,41,197,262,32],"1960167","munificent",[264,18,32,197,11,43],"1960173",[266,165,41,193,267,32],"1960912","puredanger",[140,269,41,270,141,32],10,"project\u002Fneutral\u002Fnone",[272,269,32,270,11,43],"1960168",[274,269,41,270,275,32],"1961500","cgrand-net",[160,269,41,270,161,32],[],[279,284,289,294,299,304],{"id":280,"name":281,"points":282,"category":283},"1958728","Gamification.org",76,"learning_science",{"id":285,"name":286,"points":287,"category":288},"1949063","rpgp.org",42,"data",{"id":290,"name":291,"points":292,"category":293},"1953682","Cyberspace",41,"consumer_social",{"id":295,"name":296,"points":297,"category":298},"1940129","Switch",38,"dev_tools",{"id":300,"name":301,"points":302,"category":303},"1951196","Syncpad",34,"creative",{"id":305,"name":306,"points":16,"category":20},"1947725","iOS Fonts",false,"v2",{"id":310,"name":5,"line":6,"ai":307,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":311,"top":18,"kw":312,"maker":11,"domain":10,"tier":19,"attempts":32,"strip":313,"url":9,"mix":314,"praise":72,"objection":81,"sub":21},1959896,-0.17,[24,25,26,27,28],"1000303103011303100000000130303330303303",[32,33,32,34],1793990868877]