[{"data":1,"prerenderedAt":216},["ShallowReactive",2],{"project-10378770":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":34,"aspects":35,"strip":41,"post_text":43,"what":44,"said":59,"maker_in_thread":131,"shape":138,"grid":143,"attempts":179,"same_week":180,"maker_shows":140,"maker_hidden":208,"reader_version":209,"card":210},"10378770","LJSON","JSON extended with pure functions","title","Show HN: LJSON: JSON extended with pure functions","https:\u002F\u002Fgithub.com\u002FMaiaVictor\u002FLJSON","github.com","LightMachine",1444716314,2015,39,17,731,2565,29,"shown","languages","serialization format","library",[24,25,26,27],"json","lambda calculus","serialization","pure functions","roasted",-0.145,{"positive":31,"neutral":32,"mixed":32,"critical":33},3,1,6,11,{"idea":36,"execution":38,"design":40},{"positive":31,"critical":37},2,{"positive":39,"critical":37},0,{"positive":39,"critical":37},[31,39,32,39,32,39,32,32,39,39,42,32,42,32,39,42,31],5,null,{"problem":43,"audience":43,"pricing":43,"motivation":43,"time_to_build":43,"stack":45,"openness":58,"stage":58,"team_size":58},[46],{"value":47,"source":48,"evidence":49},"JavaScript","commenter",[50,54],{"id":51,"by":52,"text":53},"10379055","lambdapie","Fun project. From examining the source code, they are using the technique that can be considered a kind of higher order abstract syntax (HOAS). In particular, LJSON can be fooled…",{"id":55,"by":56,"text":57},"10379935","IgorPartola","This would be interesting, except JavaScript is a terrible language for this. At the minimum I think you'd want all the arguments and return values to be strictly typed.…","unknown",{"praise":60,"objections":76,"requests":102,"questions":116,"alternatives":130},[61],{"value":62,"source":48,"evidence":63},"Interesting idea and implementation",[64,68,72],{"id":65,"by":66,"text":67},"10379381","archgrove","I think it's a lovely idea, with an interesting implementation. Obligatory HN style comment: It might be wise to strengthen the description from \"pure\" functions to \"pure and…",{"id":69,"by":70,"text":71},"10379807","statictype","Neat concept. It reminds me of how JSON started - as just a string representation of a javascript object and parsing JSON was as simple as evaling it. Once it picked up steam, it…",{"id":73,"by":74,"text":75},"10379410","TazeTSchnitzel","This is something I'd wanted to do, and I'm glad someone else had the same idea. Lots of exciting possibilities. Something important that needs doing is strictly defining the…",[77,84,91,95],{"value":78,"source":79,"evidence":80},"Does not guarantee termination; non-terminating functions can be encoded","maker",[81],{"id":82,"by":11,"text":83},"10380233","There is no protection against non-termination. For example, an user could give you this function: ``` f = (function (x){ return x(x); }) ``` Now, if you call…",{"value":85,"source":48,"evidence":86},"Exotic terms and native JS constructs can fool the stringifier",[87,88],{"id":51,"by":52,"text":53},{"id":89,"by":52,"text":90},"10380726","Actually there are other problems that are caused by the fact that you're not really doing HOAS, but something even more difficult, namely trying to infer the function by passing…",{"value":92,"source":48,"evidence":93},"JavaScript is a poor base language; strict typing needed",[94],{"id":55,"by":56,"text":57},{"value":96,"source":48,"evidence":97},"Too restrictive to be useful beyond trivial examples",[98],{"id":99,"by":100,"text":101},"10379066","vortico","Without being able to call pure functions within pure functions, what use is this beyond the trivial simple examples? Couldn't it be possible to pass a \"this\" argument as the…",[103,107,112],{"value":104,"source":48,"evidence":105},"Strictly define the JavaScript subset used",[106],{"id":73,"by":74,"text":75},{"value":108,"source":48,"evidence":109},"Add type hints or a type system",[110,111],{"id":55,"by":56,"text":57},{"id":82,"by":11,"text":83},{"value":113,"source":48,"evidence":114},"Strengthen description to pure and terminating",[115],{"id":65,"by":66,"text":67},[117,123],{"value":118,"source":79,"evidence":119},"Better way to mark end of call list than null",[120],{"id":121,"by":11,"text":122},"10380244","Very good catch. Any suggestion how I could improve the usage of null for determining the end of a call list?",{"value":124,"source":48,"evidence":125},"What stops client code from using globals",[126],{"id":127,"by":128,"text":129},"10379222","d0m","I definitely see some uses to it as a way to pass client code to the server safely. What would stop the client from using global variable though?",[],{"comments":33,"answered":37,"key":132},[133,134,135],{"id":82,"text":83},{"id":121,"text":122},{"id":136,"text":137},"10381193","Ah, fair enough. The user should avoid using native JS constructs on the code to be stringified, though - it is an interesting\u002Fuseful side effect of the method that you are able…",{"commenters":139,"max_depth":140,"maker_replies":33,"first_comment_mins":141,"lifespan_hours":142},10,4,103,12,[144,146,148,149,151,152,153,155,158,161,164,165,166,167,170,173,175],[65,39,31,145,66,39],"project\u002Fmixed\u002Fidea",[82,39,39,147,11,32],"project\u002Fcritical\u002Fexecution",[51,32,32,147,52,39],[121,32,39,150,11,32],"maker\u002Fneutral\u002Fexecution",[89,32,32,147,52,39],[136,32,39,150,11,32],[99,37,32,154,100,39],"project\u002Fcritical\u002Fidea",[156,37,32,157,74,39],"10379432","project\u002Fcritical\u002Fdesign",[159,37,39,160,11,32],"10380265","project\u002Fpositive\u002Fidea",[162,37,39,163,11,32],"10381706","maker\u002Fneutral\u002Fdocs",[69,31,42,160,70,39],[55,140,32,157,56,39],[73,42,42,160,74,39],[168,33,32,154,169,39],"10379867","SFjulie1",[171,33,39,172,11,32],"10382350","commenter\u002Fneutral\u002Fnone",[127,174,42,160,128,39],7,[176,174,31,177,178,39],"10379703","project\u002Fneutral\u002Fdesign","ch",[],[181,186,190,194,199,203],{"id":182,"name":183,"points":184,"category":185},"10376468","Exposé",548,"dev_tools",{"id":187,"name":188,"points":189,"category":185},"10355030","Instant Music Downloader",321,{"id":191,"name":192,"points":193,"category":185},"10375154","ureq",146,{"id":195,"name":196,"points":197,"category":198},"10353285","Wriber",128,"productivity",{"id":200,"name":201,"points":202,"category":20},"10384653","Rune.js",92,{"id":204,"name":205,"points":206,"category":207},"10378023","Lexika",85,"ai",false,"v2",{"id":211,"name":5,"line":6,"ai":208,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":212,"top":18,"kw":213,"maker":11,"domain":10,"tier":19,"attempts":39,"strip":214,"url":9,"mix":215,"praise":62,"objection":78,"sub":21},10378770,-0.14,[24,25,26,27],"30101011005151053",[31,32,32,33],1793990931903]