[{"data":1,"prerenderedAt":302},["ShallowReactive",2],{"project-8239113":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":36,"aspects":37,"strip":43,"post_text":45,"what":46,"said":76,"maker_in_thread":172,"shape":178,"grid":182,"attempts":266,"same_week":267,"maker_shows":32,"maker_hidden":295,"reader_version":296,"card":297},"8239113","luajit-libuv","LuaJIT FFI binding to libuv with coroutines","title","Show HN: LuaJIT FFI binding to libuv with coroutines","https:\u002F\u002Fgithub.com\u002Fpguillory\u002Fluajit-libuv","github.com","pguillory",1409253002,2014,101,35,270,2272,12,"notable","languages","lua library bindings","library",[24,25,26,27,28],"luajit","libuv","coroutines","lua","event loop","curious",-0.09,{"positive":32,"neutral":33,"mixed":34,"critical":35},1,10,0,3,14,{"idea":38,"performance":39,"docs":40,"execution":41},{"positive":32,"critical":34},{"positive":34,"critical":34},{"positive":34,"critical":32},{"positive":34,"critical":42},2,[34,34,34,35,34,34,34,34,35,35,34,35,35,34,35,34,34,44,34,34,34,32,35,35,34,34,34,32,35,34,34,32,35,34,34],5,null,{"problem":47,"audience":45,"pricing":45,"motivation":45,"time_to_build":45,"stack":57,"openness":73,"stage":74,"team_size":75},{"value":48,"source":49,"evidence":50},"Writing async Lua code with libuv without callbacks","maker",[51,54],{"id":52,"by":11,"text":53},"8239856","In addition to what benjaminva said, luv uses callbacks (like Node.js), whereas this uses coroutines. So for example with luv you might do something like: ```…",{"id":55,"by":11,"text":56},"8245479","Thanks, I've added it to the list. In luajit-libuv, when Lua code makes an async request to libuv, it passes async.resume as the callback. Then it calls async.yield(), which…",[58,62,65],{"value":59,"source":49,"evidence":60},"LuaJIT",[61],{"id":55,"by":11,"text":56},{"value":25,"source":49,"evidence":63},[64],{"id":55,"by":11,"text":56},{"value":66,"source":67,"evidence":68},"C","inferred",[69],{"id":70,"by":71,"text":72},"8241586","justincormack","It is written for Linux, changing the Makefile is not going to change this.","open_source","prototype","unknown",{"praise":77,"objections":87,"requests":112,"questions":124,"alternatives":139},[78],{"value":79,"source":80,"evidence":81},"Coroutine-based design is elegant and simpler than callbacks","commenter",[82,83],{"id":52,"by":11,"text":53},{"id":84,"by":85,"text":86},"8241658","fit2rule","I've been a serious Lua coder for 4 years now, and I have to say that I agree with you about the diaspora factor - Lua users aren't loud, they just get on with using this…",[88,99,105],{"value":89,"source":80,"evidence":90},"Only builds on Linux and OS X; Windows port unclear",[91,95,96],{"id":92,"by":93,"text":94},"8241002","hoelle","I work on a C\u002FC++\u002FLua server stack, so this is right up my alley. But as a MSVC native I'd have to spend hours trying to decipher your Makefile to port it to Windows before I…",{"id":70,"by":71,"text":72},{"id":97,"by":11,"text":98},"8245550","I've only tried building it on OS X and Linux so far. As far as I know, basically everything but the build process is compatible with Windows. I'll look into it when I get a…",{"value":100,"source":49,"evidence":101},"Performance not yet competitive with nginx\u002FOpenResty",[102],{"id":103,"by":11,"text":104},"8245496","This would get toasted by Nginx right now. I'm on step 2 of \"make it work, make it right, make it fast.\" There's a lot of low hanging fruit, like string concatenation, small…",{"value":106,"source":80,"evidence":107},"Lacks SSL\u002FHTTPS support",[108],{"id":109,"by":110,"text":111},"8241321","davidhollander","I've implemented pure LuaJIT servers (without libuv) which compare favorably to nginx in terms of latency and performance. But you should consider whether or not you will need…",[113,120],{"value":114,"source":80,"evidence":115},"Show synchronous syntax promised in docs",[116],{"id":117,"by":118,"text":119},"8242724","alco","Where is the promised \"synchronous syntax\"? The first example show an ordinary async call with a callback.",{"value":121,"source":80,"evidence":122},"Windows support",[123],{"id":92,"by":93,"text":94},[125,132],{"value":126,"source":80,"evidence":127},"How does it compare to luv's ray branch and its scheduler",[128],{"id":129,"by":130,"text":131},"8240149","kodablah","In your \"See Also\", you missed my favorite UV+Lua combination: https:\u002F\u002Fgithub.com\u002Frichardhundt\u002Fluv\u002Ftree\u002Fray (note the branch). It too uses the Lua coroutines but has a…",{"value":133,"source":80,"evidence":134},"How does it perform against OpenResty",[135],{"id":136,"by":137,"text":138},"8240761","kator","I've used openresty compiled with LuaJIT (nginx+LuaJIT) for some low latency high scale services in the past. I wonder would this make it so I could ditch nginx and go pure…",[140,147,151,158,165],{"value":141,"source":80,"evidence":142},"luv (luvit)",[143],{"id":144,"by":145,"text":146},"8239587","curun1r","How is this different from https:\u002F\u002Fgithub.com\u002Fluvit\u002Fluv (part of http:\u002F\u002Fluvit.io\u002F)?",{"value":148,"source":80,"evidence":149},"OpenResty",[150],{"id":136,"by":137,"text":138},{"value":152,"source":80,"evidence":153},"shine",[154],{"id":155,"by":156,"text":157},"8240760","justinmk","Thanks for pointing that out. I was going to ask why it appears to have stalled a year ago, but I guess the author got distracted by something shiny:…",{"value":159,"source":80,"evidence":160},"turbolua",[161],{"id":162,"by":163,"text":164},"8242337","pygy_","There's http:\u002F\u002Fturbolua.org\u002F that's inspired by Tornado.",{"value":166,"source":80,"evidence":167},"luaffi",[168],{"id":169,"by":170,"text":171},"8240259","plorkyeran","It's built on the LuaJIT FFI, which regular Lua doesn't have. There's an implementation of the LuaJIT FFI's API for regular Lua (https:\u002F\u002Fgithub.com\u002Fjmckaskill\u002Fluaffi), but the…",{"comments":173,"answered":35,"key":174},4,[175,176,177],{"id":55,"text":56},{"id":52,"text":53},{"id":103,"text":104},{"commenters":179,"max_depth":173,"maker_replies":173,"first_comment_mins":180,"lifespan_hours":181},26,80,32,[183,187,191,194,196,197,200,202,203,204,207,208,210,211,214,217,218,219,223,226,227,230,233,237,238,240,244,247,250,254,256,258,259,262,264],[184,34,34,185,186,34],"8239528","other\u002Fneutral\u002Fnone","tiffanyh",[188,34,34,189,190,34],"8241345","commenter\u002Fneutral\u002Fnone","vbit",[192,34,34,189,193,34],"8242246","lukego",[129,32,35,195,130,34],"project\u002Fneutral\u002Fidea",[155,32,34,185,156,34],[198,32,34,185,199,34],"8240847","srean",[201,32,34,189,156,34],"8240912",[55,32,34,195,11,32],[144,42,35,195,145,34],[205,42,35,195,206,34],"8239653","benjaminva",[52,42,34,195,11,32],[136,35,35,209,137,34],"project\u002Fneutral\u002Fperformance",[109,35,35,209,110,34],[212,35,34,185,213,34],"8242386","luastoned",[215,35,35,195,216,34],"8241336","shuzchen",[162,35,34,185,163,34],[103,35,34,209,11,32],[220,173,44,221,222,34],"8241593","project\u002Fpositive\u002Fidea","otikik",[224,44,34,185,225,34],"8240447","scythe",[84,44,34,185,85,34],[228,44,34,185,229,34],"8242419","mhd",[117,231,32,232,118,34],6,"project\u002Fcritical\u002Fdocs",[234,235,35,195,236,34],"8240033",7,"theseoafs",[169,235,35,209,170,34],[239,235,34,185,85,34],"8241715",[241,242,34,185,243,34],"8239781",8,"aikah",[245,242,34,185,246,34],"8240169","ludamad",[92,248,32,249,93,34],9,"project\u002Fcritical\u002Fexecution",[251,248,35,252,253,34],"8241256","maker\u002Fneutral\u002Fnone","seabrookmx",[255,248,34,185,85,34],"8241676",[257,248,34,185,93,34],"8244320",[70,248,32,249,71,34],[260,248,35,261,93,34],"8244370","project\u002Fneutral\u002Fexecution",[97,248,34,263,11,32],"maker\u002Fneutral\u002Fexecution",[265,248,34,185,85,34],"8241696",[],[268,273,277,282,286,290],{"id":269,"name":270,"points":271,"category":272},"8246218","tmux-resurrect",241,"dev_tools",{"id":274,"name":275,"points":276,"category":20},"8244815","Chan",150,{"id":278,"name":279,"points":280,"category":281},"8258132","RandomStartup.org",119,"web_saas",{"id":283,"name":284,"points":285,"category":272},"8237111","Impulse",93,{"id":287,"name":288,"points":289,"category":272},"8241978","Howm",71,{"id":291,"name":292,"points":293,"category":294},"8237176","SuperTrip",69,"games",false,"v2",{"id":298,"name":5,"line":6,"ai":295,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":30,"top":18,"kw":299,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":300,"url":9,"mix":301,"praise":79,"objection":89,"sub":21},8239113,[24,25,26,27,28],"00030000330330300500013300013001300",[32,33,34,35],1793990911315]