*** ronny has joined #circuits | 05:14 | |
*** Osso has joined #circuits | 08:08 | |
*** Ossoleil has joined #circuits | 16:04 | |
*** Osso has quit IRC | 16:06 | |
*** ronny has quit IRC | 18:26 | |
*** ronny has joined #circuits | 18:48 | |
*** ronny has quit IRC | 18:48 | |
*** ronny has joined #circuits | 18:48 | |
*** ronny has quit IRC | 19:26 | |
*** ronny has joined #circuits | 19:36 | |
spaceone | LOL | 20:40 |
---|---|---|
spaceone | ronny: https://github.com/benoitc/http-parser/blob/master/http_parser/pyparser.py#L326 | 20:40 |
spaceone | the same behavior in http-parser | 20:41 |
ronny | spaceone, seems like you didnt read the c parser ^^ | 20:42 |
spaceone | i 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 me | 20:42 |
spaceone | ronny: i read the apache and lighttpd (1 and 2) http parser | 20:43 |
spaceone | but http-parser is not funny to read, it is too weird | 20:43 |
ronny | spaceone, that might be because it spells out the whole statemachine | 20:44 |
spaceone | ronny: 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 |
ronny | semi-afk atm | 20:55 |
ronny | re | 21:09 |
ronny | spaceone, i see | 21:09 |
spaceone | ronny: i am depressed | 21:12 |
spaceone | everyone is doing it wrong | 21:12 |
ronny | spaceone, hmm, well, it will work well in the real world tho, since people dont invent new verbs usually | 21:13 |
ronny | but i suppose it should be fixed | 21:13 |
spaceone | ronny: i am at least leaving the possibility | 21:14 |
spaceone | i am faster to write an own full HTTP/1.1 compliant parser than finding all bugs in every project and make bug reports | 21:15 |
spaceone | faster in* | 21:15 |
ronny | i see | 21:16 |
ronny | well, then give it a good api :) | 21:16 |
spaceone | ronny: i will | 21:18 |
spaceone | ronny: i also decided to support Web Server Gay Standard | 21:18 |
ronny | wut? | 21:19 |
spaceone | Gateway* | 21:19 |
spaceone | Interface* | 21:19 |
spaceone | =WSGI | 21:19 |
spaceone | but i will also define a new standard HTTPSI | 21:20 |
spaceone | interface to HTTP with the verbs defined in RFC 2616, leaving out the useless Gateway thing | 21:20 |
ronny | spaceone, please dont yet :) | 21:33 |
spaceone | ronny: :D | 21:34 |
ronny | spaceone, as a random new guy you will set that thing up for fail | 21:35 |
spaceone | i am not random | 21:36 |
spaceone | i am a new guy yes | 21:36 |
spaceone | but not random | 21:36 |
ronny | spaceone, till you got a name, you are "random" | 21:36 |
ronny | thing is, wsgi is already there and works well enough | 21:37 |
spaceone | but bad designed | 21:37 |
ronny | which means its the worst possible enemy for setting up something good | 21:37 |
spaceone | thats why i am supporting it also | 21:37 |
ronny | on our worlds better technologies dont automatically win | 21:37 |
spaceone | of course not | 21:38 |
ronny | do you at least understand the design rationale behind wsgi? | 21:38 |
spaceone | we are getting more and more worse | 21:38 |
spaceone | ronny: i think so | 21:38 |
ronny | then please explain :) | 21:38 |
spaceone | wsgi 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 own | 21:40 |
spaceone | you can do nearly everything which is possible with HTTP | 21:41 |
spaceone | (except trailing headers) | 21:41 |
spaceone | i need to train my explainations | 21:44 |
spaceone | what are you expect to hear? | 21:44 |
spaceone | ing* | 21:44 |
ronny | spaceone, you missed the main point on what its used for and why its so horrible :) | 21:45 |
spaceone | ok, wait: | 21:46 |
spaceone | what it is used for: | 21:46 |
spaceone | dispatching HTTP request in a specified format to applications | 21:46 |
ronny | you are leaving out the whole aspect of middleware | 21:47 |
spaceone | abstraction and .en-de austauschbarkeit | 21:48 |
ronny | also do you know why wsgi is so horrible? | 21:49 |
spaceone | the 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 orientated | 21:52 |
spaceone | it is also most often used with one entrypoint (uri), but that is implementation detail | 21:53 |
spaceone | but it is hard to implement it in another way | 21:53 |
spaceone | s//in the way http is meant be used/ | 21:54 |
ronny | what is the way http was meant to be used? | 21:54 |
ronny | but that already works fine with wsgi | 21:57 |
spaceone | no | 21:57 |
spaceone | it just works | 21:57 |
spaceone | but not fine | 21:57 |
ronny | people do it | 21:58 |
ronny | and they even give it nice apis on top | 21:58 |
ronny | so its fine | 21:58 |
spaceone | show me one | 21:58 |
ronny | werkzeug, webob | 21:58 |
spaceone | which fits all this using WSGI | 21:58 |
ronny | wsgi pretty much maps to a large enough subset of http | 21:59 |
spaceone | without using the objects, without using the verbs defined in RFC 2616 | 22:00 |
ronny | "objects"? | 22:01 |
ronny | also note that wsgi can use any verb you want | 22:01 |
spaceone | 'can' but does not | 22:01 |
spaceone | wsgi is: | 22:01 |
spaceone | headers = dict()/list(); def start_request(environ, headers); start_response(status, headers); | 22:03 |
ronny | spaceone, the verb interpretation is pretty much completely left to the application | 22:04 |
ronny | wich is exactly where it belongs | 22:04 |
spaceone | a interface should look like this: | 22:05 |
spaceone | aHR0cDovL3d3dy5zcGFjZWZyYW1ld29yay5vcmcvX2ltYWdlcy91bWxfaHR0cC5wbmc= | 22:05 |
ronny | ?? | 22:06 |
spaceone | and this: | 22:06 |
spaceone | aHR0cDovL3d3dy5zcGFjZWZyYW1ld29yay5vcmcvX2ltYWdlcy9ncmFwaHZpei03M2NmY2U0YThhZjY2NDE5ZWU2ZmE3ODAzNWNmMzM2MzQ0OGM5NjE2LnBuZw== | 22:06 |
spaceone | ronny: base64 | 22:06 |
ronny | is that base64 encoded | 22:06 |
ronny | and why?! | 22:06 |
spaceone | this channel is logged | 22:06 |
spaceone | i don't want to expose my domain | 22:06 |
spaceone | the images are not the latest | 22:07 |
ronny | spaceone, lets get one thing straight, playing architecture astronaut wont get you in touch with people that are on the ground | 22:07 |
ronny | and that diagram doesnt even take the needs of most web apps into account | 22:09 |
spaceone | because apps are not designed fortunatly (de-en vorteilhaft) | 22:10 |
ronny | you are mounted at some script location and dispatch to internal views, yours makes that actually hard | 22:10 |
spaceone | only for the server implementation | 22:10 |
ronny | thats what apps on the server will need | 22:11 |
spaceone | but my goal is not to call some scripts but to create resources | 22:11 |
ronny | so you push responsibility for dispatch to the server? | 22:11 |
spaceone | not directly to the server | 22:12 |
spaceone | it can be some middleware | 22:12 |
spaceone | i'll write a small simple pseudocode example | 22:12 |
spaceone | using this interface | 22:13 |
spaceone | http://cxg.de/_29f84f.htm | 22:17 |
ronny | spaceone, are you sure you want to give something like that as example? | 22:17 |
spaceone | why not? it is that simple | 22:18 |
ronny | spaceone, well im thinking i hope hes trolling, cause if hes serious thats a serious issue | 22:20 |
spaceone | why? what is wrong about keeping things simple | 22:20 |
ronny | if you keep them so simple that they say nothing, they are worthless | 22:21 |
spaceone | for dispatching a http request to a resource you need the path and the method | 22:21 |
ronny | leaving out all context results in practically nothing | 22:21 |
spaceone | implementing this is not easy when everything is wrapped into wsgi | 22:21 |
ronny | it is | 22:22 |
spaceone | we don't need to be more abstract than http is | 22:22 |
spaceone | and wsgi is a python standard | 22:23 |
spaceone | so using python means use the python builtin features | 22:24 |
spaceone | you can define your own __getitem__ for the path and method thing | 22:24 |
spaceone | okay, it would be easy to implement in wsgi, but wsgi plays a role/layer which is not needed | 22:25 |
ronny | well, your ling is a layer that is much more complex and involves way more types, classes and datastructures | 22:26 |
spaceone | what a standard needs is: a form of a request, a form of a response, and something where the response can be started | 22:26 |
spaceone | of course it is, but it is simpler for to use for applications which are bigger than 3 resources | 22:27 |
spaceone | it would be nice if python provides: from rfc2616 import Request, Response; from rfc3986 import URI | 22:29 |
ronny | hmm, i dont want to deal with this anymore, the result wont be satisfying | 22:31 |
spaceone | fine, then go to bed | 22:31 |
spaceone | but wsgi only exists because of cgi | 22:33 |
spaceone | if you want to write an wsgi application you have to implement all these things on your own | 22:33 |
spaceone | and 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 more | 22:37 |
ronny | spaceone, anyone sane will not use wsgi directly unless its for middleware or server interaction | 22:37 |
spaceone | 'sane' ? | 22:37 |
ronny | how many people do you see implementing python wesgi apps in plain wsgi | 22:38 |
ronny | and how many people do you see using higher level tools | 22:38 |
ronny | they use django, pyramid, flask, werkzeug, webob or whatever | 22:39 |
spaceone | which all have a complicated way of routing | 22:39 |
spaceone | (i dunno pyramid and webob) | 22:40 |
ronny | define complicated | 22:40 |
ronny | what do you consider a simple way of routing | 22:40 |
spaceone | the code i showed you | 22:40 |
ronny | are you absolutely sure that you mean that? | 22:41 |
spaceone | @route(uri('http', 'example.com' | 22:41 |
spaceone | , re.compile('^/foo/.../bar/...')) | 22:42 |
spaceone | class Foo(Ressource): pass | 22:42 |
spaceone | no need of XML files to make a mapping | 22:42 |
ronny | congratulations, yours is worse than all others | 22:43 |
ronny | there is a reason why all frameworks only route on path_info | 22:44 |
spaceone | this would be no problem | 22:45 |
ronny | how? | 22:45 |
spaceone | you can of course leave out domain things | 22:45 |
spaceone | in my imagination you are able to create resources, which can be mapped when the application starts | 22:46 |
spaceone | ressources are not bind to a uri, the uri only gives resources names | 22:46 |
ronny | hmm, anyway bedtime - i need to drive to a flathunt tommorow | 22:47 |
spaceone | good luck finding a apartment | 22:48 |
spaceone | an* | 22:48 |
*** ronny has quit IRC | 22:51 | |
prologic | hmm | 23:33 |
prologic | this discussion depresses me | 23:33 |
prologic | 1) You cannot develop a _better_ API than what already exists without over complicating it. | 23:33 |
prologic | 2) WSGI/FastCGI/uWSGI are perfectly good Server integration technologies and protocols for web applications. | 23:33 |
prologic | 3) Stop harping on about OOP - It's pointless | 23:34 |
prologic | OOP is a waste of time and badly overused and abused quite often | 23:34 |
prologic | In all this spaceone | 23:34 |
prologic | I still _cannot_ see what you're trying to achieve | 23:34 |
prologic | All I can see if someone attempting to reinvent wheels | 23:35 |
prologic | and redesign apis | 23:35 |
prologic | As I've tried so very hard before | 23:42 |
prologic | You really need to spend time and effort building a ResourceDispatcher for circuits.web | 23:43 |
prologic | which _will_ solve 90% of your use-cases/issues | 23:43 |
prologic | Anyway I give up | 23:43 |
prologic | I feel like I"m wasting my breath/hands | 23:44 |
prologic | If you wish to continue to keep reinventing wheels | 23:44 |
prologic | and rewriting new code that's the same as what others have written before | 23:44 |
prologic | and if you keep saying things like "everyone is wrong" | 23:44 |
prologic | "this code is bullshit" | 23:44 |
prologic | I can't help you :/ | 23:44 |
prologic | The "real" world is quite a lot different from the theoretical | 23:44 |
prologic | and often quite a distance apart from standard specifications of protocols, langauges, interfaces, etc | 23:45 |
Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!