IRC Logs for #circuits Tuesday, 2014-10-07

*** ninkotech__ has quit IRC00:03
prologicpdurbin: pretty libevent doesn’t have functinality like that02:39
prologicit’s basically a library for async I/O that’s cross platform afaik02:39
prologicat least last time I looked02:39
prologicI would like to see someone write a circuits poller that wraps around libevent though02:40
prologicoptionally of course - as one of the things we’ve maintained for over 10 years is “no external dependenices” and “pure python” framework02:40
*** Romster has quit IRC10:54
*** Romster has joined #circuits11:08
*** Romster has quit IRC11:21
*** Romster has joined #circuits11:32
*** koobs has quit IRC13:38
robert_prologic: EVFILT_VNODE13:45
*** koobs has joined #circuits13:51
*** Osso has quit IRC15:14
*** Osso has joined #circuits15:16
robert_sup Yama17:24
robert_prologic: hmmm, is there a way I can figure out what channel a component used to raise an event with, wihout going to too much trouble? or do I need to send self or the channel name along with the event?19:35
prologicrobert_, e.channels19:54
robert_so the parameter passed is the event itself?19:55
robert_AttributeError("'str' object has no attribute 'channels'",)20:26
robert_how do I get e.channels when I'm in the code handling the event?21:08
robert_You know, it'd be cool if you assigned 'e' to a local when you're dispatching an event.21:09
robert_or something.21:23
robert_I mean I can see where that could be a problem, tohugh.21:23
prologice.channels where e is an Event instnace21:29
prologicdef foo(self, event, *args, **kwargs):21:29
prologicprint event.channels21:29
prologicrobert_: You know, it'd be cool if you assigned 'e' to a local when you're dispatching an event. <— no :)21:29
prologicbit of an awful hack :)21:30
prologicthat’s basically injecting side effects into an event handler21:30
prologicyuck :)21:30
robert_indeed. :p21:30
prologicit’s bad enough that normal imperitave programming has side effects ;)21:30
robert_and you'd only want that if it were well-defined and of a very limited scope. :p21:30
robert_because you're basically saying, "You can't use this variable name here without squashing something." :p21:31
prologicthe approach above is better21:32
prologicand has been in circuits since forever21:32
prologicit’s part of the @handler decorator21:32
prologicif your first argument after self is called “event"21:32
prologicthat argument will get the event parameter21:33
robert_oh, nice.21:33
prologicdef foo(self, *args, **kwargs):21:33
prologicdef foo(self, event, *args, **kwargs):21:33
prologicand yes it must be “event” exactly21:33
robert_aha. :p21:34
robert_argspecs ftw, huh?21:34
prologicintrospection in python is quite pwoerful and expressive21:34
robert_so, @handler(event, "MyAltEventName") ?21:35
prologicwhat? no21:35
prologicas per above21:35
prologicit’s part of the way you define the evnethandler’s method21:35
prologicand no we don’t support event aliasing as such21:36
prologicbut you can do things like21:36
robert_then my event handler name must match. :p21:36
prologic@handler(“foo”, “bar”, “baz”)21:36
prologicdef _on_foo_or_bar_or_baz(...):21:36
robert_oh, nice.21:36
prologicthis should be in the docs21:36
prologicplease write up an issue if it’s not21:36
prologicbetter yet, write up an issue21:36
prologicand send us a pull request21:36
prologicplease :)21:37
robert_Oh, I see. :p21:39
robert_and yes, it is much better. :p21:41
robert_actually, what'd be neat for a Circuits 4.0 would be something like the following21:42
robert_@handler( [ "channels", "args", "kwargs", "uid", "stopped" ], "event_trigger", ...)21:45
robert_that lets you pick and choose what you want to receive21:45
prologicthat’s not very clear to me21:47
prologicalso that would break a LOT of things21:47
prologicglad you said 4.0 though :)21:47
robert_yeah. :p21:47
robert_it would either be "event" or a tuple of event fields you wanted to know about.21:48
robert_a list or a tuple; whichever you think would be work. :p21:49
prologicso essentially typed events?21:52
prologicI have produced 7k loc in the time I’ve been at this company for a new major feature for their trading platform22:17
c45ysounds terrible22:18
prologicand according to everything I know about industry standards and metrics that’s ~200 days worth of man effort I’ve put in in such a short time22:18
c45ywrite more in perl, you could make that 2k22:18
prologicbased on 5loc/hr @ 7hrs/day22:18
prologicI think I was making a point of:22:18
prologicI’m working too hard :(22:18
prologicwould youa gree? :)22:18
c45yi dunno, i tend to burst program too22:18
prologicI seem to be writing/modifying at least 200-300 loc per day22:18
c45yi'll get a lot of code out the door in a short period, then spend a month thinking about everything22:19
prologicyeah I have days like that too22:19
prologicbut on average I’m spitting our 1k loc/week or so22:19
prologicI’m careful like that too22:19
prologicforethought and careful attention to design22:19
prologicquality over quanity, etc :)22:19
prologic$ hg diff -r global:ewarrants --stat | tail -n 122:20
prologic 45 files changed, 5905 insertions(+), 1183 deletions(-)22:20
c45yi normally pump out a lot of crappy code that works, then spend time going over it22:20
prologicthis does kind of show how bad the code/architecture is though22:20
prologicsince I’ve touched nearly 1/3 of the codebase22:20
c45yyou predator22:20
prologic$ countloc -r -s -t -v -I '*/node_modules/*' -I '*/test/*' .*\.js$ | tail -n 622:22
prologicFiles:    18622:22
prologicTotal:    3172822:22
prologicMin:      022:22
prologicMean:     17022:22
prologicMax;      173122:22
prologicStd Dev.: 19522:22
prologicI wasn’t wrong too22:22
prologicor at least not far off22:22
prologicI’ve touched 1/4 to 1/3 of the codebase for this new feature22:22
prologictalk about poor maintainability22:22
c45yon a scale of yes to nope, should i check out node seriously22:22
c45ythe async stuff is pretty attractive22:23
prologicthe stdev for thie codebase is insane too22:23
prologicgod damn JS22:23
prologicI’m not even sure it’s JS’s fault :)22:23
prologicyoung, immature, too many edg cases22:23
prologicweak typing22:23
prologicabsolutely NO22:23
prologicyou’re far better off with Python seriously22:23
c45yhaha noted22:23
prologicbiased view - yes22:23
prologicbut also strongly objective22:23
c45ybut GIL is pretty annoying22:24
prologicweak typing will just BITE you in teh ASS22:24
prologicNodeJS is just like PHP really22:24
c45yi guess mutliprocessing makes it a bit nicer22:24
prologicwell JS in general22:24
prologicit’s awful if you care about quality22:24
prologicgood for DOM manipuation22:24
prologicbut not for server-side22:24
prologicGIL is not nearly as annoying as you think22:24
c45ypeople say the same about perl. however i've seen perl that has been working and maintained longer than i've been out of high school22:24
prologicif you’re worried22:24
prologicuse PyPy22:24
prologicit’s at a point (has been for a year or two) wher eyou can use it in prodyuction seriously22:25
c45yi do need to check out pypy22:25
prologicor Python 322:25
prologicPython 3 iis the defacto standard now anyway22:25
prologicyou probaably should be using it22:25
c45yi would, if i wasn't writing for servers still running 2.6 / 2.722:25
robert_prologic: typed events? I'm just interested in poking through certain information; I don't care about the rest of it. :p22:26
*** Workster has joined #circuits22:35
*** edk has quit IRC22:41
prologicc45y: 2.6/2.7 is perfectly fine22:42
prologicc45y: but try to get pypy on them22:42
prologicwhich is 2.7 compatible22:42
prologicyou’ll get way better performance if you care about that22:42
prologicpypy is seriously good shit :)22:43
prologicrobert_: you know about event classes right?22:43
prologicclass foo(Event):22:43
prologic   “””foo Event”””22:43
prologicyou can customize this as much as you want22:43
prologicas long as you call the super constructor of course22:43
*** edk has joined #circuits22:44
prologic^^^ this is why I don’t recommend NodeJS22:45
prologicor even Ruby for that matter22:45
prologicpoor semantics and weak typing22:45
pdurbinit does what I mean! ;)22:45
robert_I'm moving out of Ruby for a reason. :p22:45
robert_that, and its lack of decorators. :p22:46
pdurbinwait, ruby doesn't have something? that's unpossible22:46
prologicin my many years I’ve leanred two important thing22:47
prologictyping is important22:47
prologicand semantics is important22:47
c45yprologic: my chances of updating our server fleet is minimal, as you probably know lol22:49
prologic*nods* fair enough22:49
prologicthan stick with Python honestly22:49
prologicdon’t worry about the GIL22:49
prologicit won’t annoy you that much if you design your code appropriately22:49
c45yi don't for the most part22:49
prologicin short: don’t do cpu bound work in your main thread22:49
prologicplain and simple22:49
prologiceven if you think some funtion isn’t cpu bound22:49
c45yyea i know :)22:49
prologicit might very well be22:49
pdurbinI heard Dropbox moved from Python to Go for some stuff because of the GIL.22:50
robert_I love Python because of decorators. Such a useful feature.22:50
prologicand don’t do cpu bound work in threads either22:50
c45yi mostly do a main thread that handles socket accepts, and passes them all off to threads22:50
prologicthe only thing you should do in threads if at all are I/O operations22:50
prologicpure I/O that is22:50
prologicsome I/O operations are in fact cpu bound22:50
prologicas me and several colleagues found out :)22:50
robert_lmao, I read "I love python" as, "I love dropbox" because I wasn't paying at tention to whose message I was reading. :p22:50
c45ystorage admin, i know :)22:50
prologicin fact avoid threads altogehter :)22:50
c45ythreads are better than processes for sending data between them22:50
prologicc45y: heh22:51
prologicyou really ought to be using circuits :)22:51
prologicnot threaded I/O :)22:51
c45yi should22:51
prologicyes you really should :)22:51
c45yi dunno, still feels odd to me22:51
prologicthat’s just because event-driven programming is hard22:51
prologicbut far easier than threads and locks :)22:51
prologicihmo :)22:51
c45yin some ways22:52
c45yi also lose that control to some extent22:52
prologicnot really22:53
pdurbinprologic: any opinion on ?22:53
prologiclooks intresting22:54
prologicreactive programming is certainly becoming more and more popular22:54
prologicswap reaction for “asynchornous” or “event-driven"22:54
prologicall pretty much the same thing22:54
prologiccircuits needs Obversable properaties/attribtues ;)22:55
prologici.e: data binding (two-way)22:55
prologicsomething I’ve wanted for a while but haven’t had the time to write22:55
prologicnor really the necessity22:55
prologicbut it would make some patterns a lot more cleaner and concise22:55
pdurbinlast week I went to this fantastic talk: Reactive Streams with Rx [CON5749]
prologicahh yeah I’ll have a look when I get home :)22:57
prologicinitially I was confuse dby reactive programming and the descriptions jer described22:57
prologicbut I believe it’s basically the whole notation of reacting to events and changes22:58
prologicand developing your apps in a “flow of events” as such22:58
prologicso not that different to what I’ve already been doing really22:58
prologicI guess it’s also becoming popular in the web dev community with things like AngularJS too22:59
prologici.e: two-way binding22:59
pdurbinhas a lot to do with Observable23:00
prologicbut more importantly observable properaties and data23:03
prologicthat react to chagnes and recompute their values23:04
robert_prologic: can I catch derived events with the parent event?23:45
robert_er, handle23:46
pdurbinprologic: I mean, you react to what you've subscribed to. You process the unit of work.23:50

Generated by 2.11.0 by Marius Gedminas - find it at!