[{"data":1,"prerenderedAt":403},["ShallowReactive",2],{"project-2810373":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":43,"post_text":45,"what":46,"said":74,"maker_in_thread":213,"shape":222,"grid":225,"attempts":368,"same_week":369,"maker_shows":31,"maker_hidden":396,"reader_version":397,"card":398},"2810373","Pump","A dead simple Pythonic abstraction of HTTP.","title","Show HN: Pump, a dead simple Pythonic abstraction of HTTP.","http:\u002F\u002Fadeel.github.com\u002Fpump\u002F","adeel.github.com","pyninja",1311731834,2011,118,61,84,1097,8,"notable","languages","web framework library","library",[24,25,26,27],"wsgi","python web framework","http abstraction","middleware","roasted",-0.56,{"positive":31,"neutral":32,"mixed":31,"critical":33},1,9,21,32,{"idea":36,"design":38,"performance":41},{"positive":31,"critical":37},14,{"positive":39,"critical":40},0,3,{"positive":39,"critical":42},2,[31,39,39,40,31,31,31,31,40,31,39,39,31,31,31,40,31,31,31,39,40,40,44,31,40,39,31,31,39,39,39,39,40,40,39,39,31,40,31,31],5,null,{"problem":47,"audience":54,"pricing":45,"motivation":59,"time_to_build":45,"stack":66,"openness":73,"stage":73,"team_size":73},{"value":48,"source":49,"evidence":50},"WSGI's API is unpythonic and lacks standard middleware, so frameworks reinvent the same functionality","maker",[51],{"id":52,"by":11,"text":53},"2810430","Building web apps! Basically, it's meant to be a replacement for WSGI. In my view, the problems with WSGI are that it has an unpythonic API (see: start_response and environ), and…",{"value":55,"source":56,"evidence":57},"Python web developers building frameworks and apps","inferred",[58],{"id":52,"by":11,"text":53},{"value":60,"source":49,"evidence":61},"Wrote it for use at their new startup Beagle, and to improve on WSGI",[62,65],{"id":63,"by":11,"text":64},"2810699","I'd like to do that, but I'm afraid of how much time and effort it would take. I really just wrote Pump\u002FPicasso to use at our new startup, Beagle (http:\u002F\u002Fbeagleapp.com). I was…",{"id":52,"by":11,"text":53},[67],{"value":68,"source":49,"evidence":69},"Python",[70],{"id":71,"by":11,"text":72},"2810473","``` # Pump def app(request): return { \"status\": 200, \"headers\": {\"content_type\": \"text\u002Fplain\"}, \"body\": \"Hello World\"} ```","unknown",{"praise":75,"objections":91,"requests":137,"questions":164,"alternatives":182},[76,84],{"value":77,"source":78,"evidence":79},"Simplicity of the Rack-style API","commenter",[80],{"id":81,"by":82,"text":83},"2810526","collint","The Rack style API is nice for the simplicity. I \u003C3 it. The Rack style api is NOT a great representation of the HTTP protocol. Specifically anything with a streaming or chunked…",{"value":85,"source":78,"evidence":86},"Rack-style ecosystem interoperability idea is appealing",[87],{"id":88,"by":89,"text":90},"2810424","teej","I believe the intent is to be Rack[1] for Python. The beauty of Rack is that I can build a new web framework, web server, or web app plugin and have it \"just work\" with the rest…",[92,105,114,122,133],{"value":93,"source":78,"evidence":94},"Duplicates Werkzeug and WebOb, which already solve this",[95,99,102],{"id":96,"by":97,"text":98},"2810560","justin_vanw","\"What WSGI should have been.\" Well, not at all. Pump is what werkzeug, webob, and other more friendly wrappers on WSGI already are. Basically pointless duplication of work,…",{"id":100,"by":97,"text":101},"2810629","Werkzeug and WebOb already do what you are trying to do, and they do it in a completely fantastic way. I'm not saying that to discourage you from learning and contributing, but…",{"id":103,"by":97,"text":104},"2810695","What middleware do you think are missing? In general, stuffing application logic into middleware leads to problems, so I don't think your premise is sound.…",{"value":106,"source":78,"evidence":107},"Reinvents WSGI without understanding HTTP needs like streaming and chunked responses",[108,109,113],{"id":96,"by":97,"text":98},{"id":110,"by":111,"text":112},"2810543","saurik","I don't see any way to use Pump to stream data in (a very long POST) or stream data out (a very long body). While it is certainly \"dead simple\", claiming that it is \"what WSGI…",{"id":81,"by":82,"text":83},{"value":115,"source":78,"evidence":116},"Dict-based responses prevent streaming and lazy loading",[117,121],{"id":118,"by":119,"text":120},"2811990","nikcub","by passing dicts you are removing what makes WSGI work so well: lazy loading, chunked responses, middleware (encoding, caching etc.) by decorating, iterators\u002Fgenerators etc. your…",{"id":110,"by":111,"text":112},{"value":123,"source":78,"evidence":124},"Wrong priorities for a startup to build its own framework",[125,129],{"id":126,"by":127,"text":128},"2811058","mkramlich","I'd advise you to spend more of your time on building what's the core of your new business, because there are tons of higher priority things you'll have to accomplish. Web…",{"id":130,"by":131,"text":132},"2811430","jessedhillon","At the risk of sounding harsh: it's an incredible failure of time and project management for you to have written your own Python web framework as part of launching a startup.",{"value":134,"source":78,"evidence":135},"Abstraction hides HTTP details and restricts usable subset",[136],{"id":103,"by":97,"text":104},[138,146,150,157],{"value":139,"source":78,"evidence":140},"Support streaming request and response bodies",[141,142],{"id":110,"by":111,"text":112},{"id":143,"by":144,"text":145},"2810651","sigil","As a special case, how about allowing the response body to be an iterable, and writing whatever blocks of data it produces back to the client? You should also allow multiple…",{"value":147,"source":78,"evidence":148},"Allow iterable response bodies and multiple headers with the same name",[149],{"id":143,"by":144,"text":145},{"value":151,"source":78,"evidence":152},"Distinguish script name from path info",[153],{"id":154,"by":155,"text":156},"2810544","LeafStorm","One issue that I have with it is that there is no distinction between script name and path info. Obviously, you don't have to call them that, but not having a distinction between…",{"value":158,"source":78,"evidence":159},"Plan for websocket support",[160],{"id":161,"by":162,"text":163},"2810441","radarsat1","Looks useful, though I think any modern abstraction like this should come with at least the scaffolding for future support of websockets. (They are a bit in flux right now, but…",[165,176],{"value":166,"source":78,"evidence":167},"What is the purpose and what use cases does Pump serve?",[168,172],{"id":169,"by":170,"text":171},"2810399","pbreit","This seems interesting but I'm not sure why. What are some use cases?",{"id":173,"by":174,"text":175},"2810467","irahul","I don't get the purpose. WSGI was meant to low level to cover the common minimum. If you want request, response semantics, use a higher level library - I use werkzeug which wraps…",{"value":177,"source":78,"evidence":178},"Why is start_response considered unpythonic?",[179],{"id":180,"by":174,"text":181},"2810488","> In my view, the problems with WSGI are that it has an unpythonic API (see: start_response and environ), Why do you find `start_response` unpythonic?",[183,191,196,200,206],{"value":184,"source":78,"evidence":185},"Werkzeug",[186,190],{"id":187,"by":188,"text":189},"2810533","clarkevans","It seems like the author here is comparing Pump to WSGI -- perhaps a better comparison is to Ian Bicking's WebOb (http:\u002F\u002Fwebob.org) or Armin Ronacher's Werkzeug…",{"id":100,"by":97,"text":101},{"value":192,"source":78,"evidence":193},"WebOb",[194,195],{"id":187,"by":188,"text":189},{"id":143,"by":144,"text":145},{"value":197,"source":78,"evidence":198},"Rack",[199],{"id":88,"by":89,"text":90},{"value":201,"source":49,"evidence":202},"Ring (Clojure)",[203],{"id":204,"by":11,"text":205},"2810600","Thanks for the feedback. I'm not willing to accept that WSGI couldn't be this simple. Pump's specification is modeled on Ring for Clojure (https:\u002F\u002Fgithub.com\u002Fmmcgrana\u002Fring), and…",{"value":207,"source":78,"evidence":208},"Brubeck",[209],{"id":210,"by":211,"text":212},"2810408","benatkin","Here's another NoWSGI HTTP server library (Brubeck): http:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=2770866",{"comments":214,"answered":215,"key":216},10,7,[217,218,221],{"id":204,"text":205},{"id":219,"text":220},"2810653","Werkzeug and WebOb are not what I'm trying to do. I'm reposting a reply I made earlier to irahul: Pump aims to replace WSGI entirely. That is, I believe it does a better job of…",{"id":63,"text":64},{"commenters":34,"max_depth":18,"maker_replies":214,"first_comment_mins":223,"lifespan_hours":224},12,38,[226,228,230,232,233,236,237,239,241,244,245,248,251,253,256,259,262,266,268,271,272,275,277,281,283,286,288,292,293,294,297,298,301,302,304,306,307,310,312,314,316,318,321,324,326,329,332,334,336,339,340,341,343,345,347,349,353,356,358,360,364],[96,39,31,227,97,39],"project\u002Fcritical\u002Fidea",[204,39,39,229,11,31],"maker\u002Fneutral\u002Fidea",[100,39,39,231,97,39],"commenter\u002Fcritical\u002Fidea",[219,39,39,229,11,31],[234,39,40,235,188,39],"2810667","maker\u002Fneutral\u002Fnone",[63,39,39,235,11,31],[126,39,31,238,127,39],"maker\u002Fcritical\u002Fidea",[130,39,31,240,131,39],"maker\u002Fcritical\u002Fnone",[242,39,31,240,243,39],"2811493","bruceboughton",[103,39,31,238,97,39],[246,39,39,247,127,39],"2811053","other\u002Fneutral\u002Fnone",[249,39,31,227,250,39],"2811160","Confusion",[143,39,40,252,144,39],"project\u002Fmixed\u002Fidea",[254,39,39,255,97,39],"2810698","commenter\u002Fcritical\u002Fnone",[257,39,31,227,258,39],"2812707","masklinn",[260,39,39,261,144,39],"2813782","commenter\u002Fneutral\u002Fidea",[263,39,39,264,265,39],"2814420","commenter\u002Fneutral\u002Fnone","sergeys",[267,39,39,264,265,39],"2814391",[269,39,31,227,270,39],"2811007","voidfiles",[81,31,31,227,82,39],[273,42,31,227,274,39],"2810528","jrockway",[276,42,31,227,174,39],"2810542",[278,42,40,279,280,39],"2810567","project\u002Fneutral\u002Fnone","dschobel",[187,40,40,282,188,39],"project\u002Fneutral\u002Fidea",[154,284,31,285,155,39],4,"project\u002Fcritical\u002Fdesign",[110,44,31,287,111,39],"project\u002Fcritical\u002Fperformance",[289,290,39,291,127,39],"2811050",6,"other\u002Fcritical\u002Fnone",[118,215,31,287,119,39],[210,18,39,247,211,39],[295,18,39,296,11,31],"2810435","maker\u002Fpositive\u002Fnone",[161,32,40,282,162,39],[299,32,39,247,300,39],"2811065","MostAwesomeDude",[169,214,40,282,170,39],[88,214,44,303,89,39],"project\u002Fpositive\u002Fidea",[305,214,39,235,11,31],"2810444",[173,214,31,227,174,39],[308,214,39,247,309,39],"2810486","BarkMore",[311,214,40,279,174,39],"2810461",[71,214,39,313,11,31],"maker\u002Fneutral\u002Fdesign",[315,214,31,227,174,39],"2810500",[317,214,39,229,11,31],"2810561",[319,214,31,227,320,39],"2812134","moreyes",[322,214,39,247,323,39],"2810503","bobbyi",[325,214,39,247,174,39],"2810515",[327,214,39,247,328,39],"2810559","ianb",[330,214,39,247,331,39],"2810750","carlhu",[333,214,39,247,174,39],"2812199",[335,214,39,247,328,39],"2817531",[337,214,40,279,338,39],"2810517","hetman",[52,214,39,229,11,31],[180,214,40,235,174,39],[342,214,39,285,11,31],"2810513",[344,214,39,247,174,39],"2810535",[346,214,39,247,11,31],"2810589",[348,214,39,247,188,39],"2810617",[350,351,31,285,352,39],"2811354",11,"est",[354,351,40,355,155,39],"2812066","project\u002Fneutral\u002Fdesign",[357,351,31,285,352,39],"2816246",[359,223,31,227,320,39],"2812068",[361,362,31,227,363,39],"2810477",13,"teyc",[365,37,39,366,367,39],"2812945","other\u002Fneutral\u002Fidea","dlamotte",[],[370,375,380,385,389,392],{"id":371,"name":372,"points":373,"category":374},"2810324","Kondoot",97,"consumer_social",{"id":376,"name":377,"points":378,"category":379},"2799523","ClearTax",75,"web_saas",{"id":381,"name":382,"points":383,"category":384},"2797432","FutureMessage.me",66,"productivity",{"id":386,"name":387,"points":388,"category":374},"2800684","Recently Read",26,{"id":390,"name":391,"points":37,"category":374},"2794180","Weekend Project",{"id":393,"name":394,"points":362,"category":395},"2798994","Megacomet","infrastructure",false,"v2",{"id":399,"name":5,"line":6,"ai":396,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":400,"maker":11,"domain":10,"tier":19,"attempts":39,"strip":401,"url":9,"mix":402,"praise":77,"objection":93,"sub":21},2810373,[24,25,26,27],"1003111131001113111033513011000033001311",[31,32,31,33],1793990874030]