IRC Logs for #circuits Thursday, 2013-04-18

*** ronny has joined #circuits05:14
*** Osso has joined #circuits08:08
*** Ossoleil has joined #circuits16:04
*** Osso has quit IRC16:06
*** ronny has quit IRC18:26
*** ronny has joined #circuits18:48
*** ronny has quit IRC18:48
*** ronny has joined #circuits18:48
*** ronny has quit IRC19:26
*** ronny has joined #circuits19:36
spaceoneLOL20:40
spaceoneronny: https://github.com/benoitc/http-parser/blob/master/http_parser/pyparser.py#L32620:40
spaceonethe same behavior in http-parser20:41
ronnyspaceone, seems like you didnt read the c parser ^^20:42
spaceonei adapted the behavior for me which caused me to have more complexity in the code, but no http lib is actually doing the way you tld me20:42
spaceoneronny: i read the apache and lighttpd (1 and 2) http parser20:43
spaceonebut http-parser is not funny to read, it is too weird20:43
ronnyspaceone, that might be because it spells out the whole statemachine20:44
spaceoneronny: i don't see the advantage of doing this in python... the code of http_paerser.py is also buggy.. e.g. it assumes if the method starts with 'C' it is 'CONNECT' and it does not parse it any further...#20:53
ronnysemi-afk atm20:55
ronnyre21:09
ronnyspaceone, i see21:09
spaceoneronny: i am depressed21:12
spaceoneeveryone is doing it wrong21:12
ronnyspaceone, hmm, well, it will work well in the real world tho, since people dont invent new verbs usually21:13
ronnybut i suppose it should be fixed21:13
spaceoneronny: i am at least leaving the possibility21:14
spaceonei am faster to write an own full HTTP/1.1 compliant parser than finding all bugs in every project and make bug reports21:15
spaceonefaster in*21:15
ronnyi see21:16
ronnywell, then give it a good api :)21:16
spaceoneronny: i will21:18
spaceoneronny: i also decided to support Web Server Gay Standard21:18
ronnywut?21:19
spaceoneGateway*21:19
spaceoneInterface*21:19
spaceone=WSGI21:19
spaceonebut i will also define a new standard HTTPSI21:20
spaceoneinterface to HTTP with the verbs defined in RFC 2616, leaving out the useless Gateway thing21:20
ronnyspaceone, please dont yet :)21:33
spaceoneronny: :D21:34
ronnyspaceone, as a random new guy you will set that thing up for fail21:35
spaceonei am not random21:36
spaceonei am a new guy yes21:36
spaceonebut not random21:36
ronnyspaceone, till you got a name, you are "random"21:36
ronnything is, wsgi is already there and works well enough21:37
spaceonebut bad designed21:37
ronnywhich means its the worst possible enemy for setting up something good21:37
spaceonethats why i am supporting it also21:37
ronnyon our worlds better technologies dont automatically win21:37
spaceoneof course not21:38
ronnydo you at least understand the design rationale behind wsgi?21:38
spaceonewe are getting more and more worse21:38
spaceoneronny: i think so21:38
ronnythen please explain :)21:38
spaceonewsgi wants to make a intuitive interface which can easy be implemented by a wide range of servers so that no one needs to define it's own21:40
spaceoneyou can do nearly everything which is possible with HTTP21:41
spaceone(except trailing headers)21:41
spaceonei need to train my explainations21:44
spaceonewhat are you expect to hear?21:44
spaceoneing*21:44
ronnyspaceone, you missed the main point on what its used for and why its so horrible :)21:45
spaceoneok, wait:21:46
spaceonewhat it is used for:21:46
spaceonedispatching HTTP request in a specified format to applications21:46
ronnyyou are leaving out the whole aspect of middleware21:47
spaceoneabstraction and .en-de austauschbarkeit21:48
ronnyalso do you know why wsgi is so horrible?21:49
spaceonethe abstraction is a format which doesn't match the HTTP elements ( a useless layer if you want to implement real HTTP); gatewaying makes it slower; the whole wsgi thing is functional, not object orientated21:52
spaceoneit is also most often used with one entrypoint (uri), but that is implementation detail21:53
spaceonebut it is hard to implement it in another way21:53
spaceones//in the way http is meant be used/21:54
ronnywhat is the way http was meant to be used?21:54
ronnybut that already works fine with wsgi21:57
spaceoneno21:57
spaceoneit just works21:57
spaceonebut not fine21:57
ronnypeople do it21:58
ronnyand they even give it nice apis on top21:58
ronnyso its fine21:58
spaceoneshow me one21:58
ronnywerkzeug, webob21:58
spaceonewhich fits all this using WSGI21:58
ronnywsgi pretty much maps to a large enough subset of http21:59
spaceonewithout using the objects, without using the verbs defined in RFC 261622:00
ronny"objects"?22:01
ronnyalso note that wsgi can use any verb you want22:01
spaceone'can' but does not22:01
spaceonewsgi is:22:01
spaceoneheaders = dict()/list(); def start_request(environ, headers); start_response(status, headers);22:03
ronnyspaceone, the verb interpretation is pretty much completely left to the application22:04
ronnywich is exactly where it belongs22:04
spaceonea interface should look like this:22:05
spaceoneaHR0cDovL3d3dy5zcGFjZWZyYW1ld29yay5vcmcvX2ltYWdlcy91bWxfaHR0cC5wbmc=22:05
ronny??22:06
spaceoneand this:22:06
spaceoneaHR0cDovL3d3dy5zcGFjZWZyYW1ld29yay5vcmcvX2ltYWdlcy9ncmFwaHZpei03M2NmY2U0YThhZjY2NDE5ZWU2ZmE3ODAzNWNmMzM2MzQ0OGM5NjE2LnBuZw==22:06
spaceoneronny: base6422:06
ronnyis that base64 encoded22:06
ronnyand why?!22:06
spaceonethis channel is logged22:06
spaceonei don't want to expose my domain22:06
spaceonethe images are not the latest22:07
ronnyspaceone, lets get one thing straight, playing architecture astronaut wont get you in touch with people that are on the ground22:07
ronnyand that diagram doesnt even take the needs of most web apps into account22:09
spaceonebecause apps are not designed fortunatly (de-en vorteilhaft)22:10
ronnyyou are mounted at some script location and dispatch to internal views, yours makes that actually hard22:10
spaceoneonly for the server implementation22:10
ronnythats what apps on the server will need22:11
spaceonebut my goal is not to call some scripts but to create resources22:11
ronnyso you push responsibility for dispatch to the server?22:11
spaceonenot directly to the server22:12
spaceoneit can be some middleware22:12
spaceonei'll write a small simple pseudocode example22:12
spaceoneusing this interface22:13
spaceonehttp://cxg.de/_29f84f.htm22:17
ronnyspaceone, are you sure you want to give something like that as example?22:17
spaceonewhy not? it is that simple22:18
ronnyspaceone, well im thinking i hope hes trolling, cause if hes serious thats a serious issue22:20
spaceonewhy? what is wrong about keeping things simple22:20
ronnyif you keep them so simple that they say nothing, they are worthless22:21
spaceonefor dispatching a http request to a resource you need the path and the method22:21
ronnyleaving out all context results in practically nothing22:21
spaceoneimplementing this is not easy when everything is wrapped into wsgi22:21
ronnyit is22:22
spaceonewe don't need to be more abstract than http is22:22
spaceoneand wsgi is a python standard22:23
spaceoneso using python means use the python builtin features22:24
spaceoneyou can define your own __getitem__ for the path and method thing22:24
spaceoneokay, it would be easy to implement in wsgi, but wsgi plays a role/layer which is not needed22:25
ronnywell, your ling is a layer that is much more complex and involves way more types, classes and datastructures22:26
spaceonewhat a standard needs is: a form of a request, a form of a response, and something where the response can be started22:26
spaceoneof course it is, but it is simpler for to use for applications which are bigger than 3 resources22:27
spaceoneit would be nice if python provides: from rfc2616 import Request, Response; from rfc3986 import URI22:29
ronnyhmm, i dont want to deal with this anymore, the result wont be satisfying22:31
spaceonefine, then go to bed22:31
spaceonebut wsgi only exists because of cgi22:33
spaceoneif you want to write an wsgi application you have to implement all these things on your own22:33
spaceoneand yes, i am aware that my visions are far away from an standard format, it is more an own way of implementing it.. it is also more complicated than wsgi, but it matches HTTP more22:37
ronnyspaceone, anyone sane will not use wsgi directly unless its for middleware or server interaction22:37
spaceone'sane' ?22:37
ronnyhow many people do you see implementing python wesgi apps in plain wsgi22:38
ronnyand how many people do you see using higher level tools22:38
ronnythey use django, pyramid, flask, werkzeug, webob or whatever22:39
spaceonewhich all have a complicated way of routing22:39
spaceone(i dunno pyramid and webob)22:40
ronnydefine complicated22:40
ronnywhat do you consider a simple way of routing22:40
spaceonethe code i showed you22:40
ronnyare you absolutely sure that you mean that?22:41
spaceone@route(uri('http', 'example.com'22:41
spaceone, re.compile('^/foo/.../bar/...'))22:42
spaceoneclass Foo(Ressource): pass22:42
spaceoneno need of XML files to make a mapping22:42
ronnycongratulations, yours is worse than all others22:43
ronnythere is a reason why all frameworks only route on path_info22:44
spaceonethis would be no problem22:45
ronnyhow?22:45
spaceoneyou can of course leave out domain things22:45
spaceonein my imagination you are able to create resources, which can be mapped when the application starts22:46
spaceoneressources are not bind to a uri, the uri only gives resources names22:46
ronnyhmm, anyway bedtime - i need to drive to a flathunt tommorow22:47
spaceonegood luck finding a apartment22:48
spaceonean*22:48
*** ronny has quit IRC22:51
prologichmm23:33
prologicthis discussion depresses me23:33
prologic1) You cannot develop a _better_ API than what already exists without over complicating it.23:33
prologic2) WSGI/FastCGI/uWSGI are perfectly good Server integration technologies and protocols for web applications.23:33
prologic3) Stop harping on about OOP - It's pointless23:34
prologicOOP is a waste of time and badly overused and abused quite often23:34
prologicIn all this spaceone23:34
prologicI still _cannot_ see what you're trying to achieve23:34
prologicAll I can see if someone attempting to reinvent wheels23:35
prologicand redesign apis23:35
prologicAs I've tried so very hard before23:42
prologicYou really need to spend time and effort building a ResourceDispatcher for circuits.web23:43
prologicwhich _will_ solve 90% of your use-cases/issues23:43
prologicAnyway I give up23:43
prologicI feel like I"m wasting my breath/hands23:44
prologicIf you wish to continue to keep reinventing wheels23:44
prologicand rewriting new code that's the same as what others have written before23:44
prologicand if you keep saying things like "everyone is wrong"23:44
prologic"this code is bullshit"23:44
prologicI can't help you :/23:44
prologicThe "real" world is quite a lot different from the theoretical23:44
prologicand often quite a distance apart from standard specifications of protocols, langauges, interfaces, etc23:45

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!