IRC Logs for #circuits Saturday, 2013-10-26

prologicheh00:48
prologicpdurbin, I think it's time to adapt mio-lang and rewrite it in RPython00:48
pdurbinprologic: another besides mio?!?00:50
prologicno mio is the one :)00:54
prologicI also registered mio-lang.org00:54
prologicand mio-lang.com00:54
prologicrediercts to the bitbucket repo for now00:54
prologicI've done some profiling on mio so far00:54
prologicand it's about 2000x slower than it's host langauge (Python)00:55
prologicso I think that's motivation enough to rewrite it in RPython00:55
prologicand get it translated to C00:55
prologicbut I think before I seriously do that00:55
prologicI need to get better exception handling in00:55
prologicand improve some of the calling semantics as well a bit00:55
prologichttp://mio-lang.readthedocs.org/en/latest/todo.html00:57
prologicwhat do you think of the immediate todo list there?00:57
pdurbinseems fine, I guess00:59
pdurbinprologic: is whitespace significant in mio?00:59
pdurbinwait, mio is based on Mio?01:01
prologicas in from the book02:10
prologichow to create your own freak'n asesome programmming langauge?02:10
prologicyes :)02:10
prologicbut nothing like it now02:10
prologicI initially ported his coder from Ruby to Python02:10
prologicand now it's well02:10
prologica lot further along than the book's version02:11
prologicand a lot more feature complete02:11
prologicbbl02:11
prologicback05:25
pdurbinprologic: so Mio was written by Marc-Andre Cournoye and mio was written by you?10:12
*** koobs has quit IRC10:55
*** koobs has joined #circuits11:15
*** koobs has quit IRC11:15
*** koobs has joined #circuits11:15
An_Ony_MooseI do not like channels.12:25
prologicpdurbin, yes12:30
prologicI took/borrowed the same name12:30
prologicI hope he doesn't mind :)12:30
prologiche knows about it at least as I've emailed him in the past12:30
prologicboth thanking him for his book12:30
prologicand informing him I've ported his initial code to Python12:31
prologicthen later on informed him it's now surpassed what his book's version was capale of :012:32
prologicAn_Ony_Moose, sorry?12:32
prologicwhat do you mean?12:32
An_Ony_Mooseprologic: They're confusing. I'd prefer some sort of channel class, where a Component (or its class) can define which ones it will "listen" on through a "channels" class/instance member12:41
An_Ony_Moose(member/attribute... is attribute more correct than member in python?)12:41
An_Ony_MooseEspecially when it comes to inheritance.12:43
An_Ony_MooseI want to have a Drawable class that will listen on one of several draw channels, and have subclasses of said Drawable class that can listen on other channels as well.12:45
An_Ony_MooseOr maybe specify the channels per handler...12:46
An_Ony_MooseI'ma fork circuits-dev and see if I can find my way around the source enough to implement this :)12:51
An_Ony_Mooseuh-oh, it's mercurial... I'll see if I can find a hg tutorial for git users :D12:51
prologicyou can specify channels per handler13:00
prologic@handler("foo", channel="blah")13:00
An_Ony_Mooseoh, you can? Great, that makes my life a lot easier :D13:00
prologicas always13:01
prologichappy to try and improve things13:01
prologicas long as existing tests don't break :)13:01
prologictoo badly :)13:01
An_Ony_MooseI can't even run the tests :P13:02
An_Ony_Moosehttps://gist.github.com/Anonymooseable/babf3edc4f41fc07be8913:03
An_Ony_Moose(or I'm just doing it wrong)13:03
An_Ony_MooseAlso, tests appear to be failing for python 3 at the moment..13:05
An_Ony_MooseShould I get the latest version anyway, or somehow try to get the latest version of circuits-dev which passed?13:08
An_Ony_Moose(or stick with normal circuits?)13:08
prologicahh13:12
prologicthanks13:12
prologicI'll fix that13:12
prologicwe usually run it like this:13:12
prologicpy.test tests13:12
ircnotifier__b7cd3822085e by prologic: Fixed running test suite from python setup.py test13:14
An_Ony_Mooseah right :)13:15
prologicfyi13:16
prologicwe also mirror the repos on github13:16
prologicif you really want13:16
prologicbut this is experimental at beast13:16
prologicwe've not had any contributors use them13:16
prologicor merge anything in from them yet13:16
An_Ony_MooseGood to know, thanks13:21
An_Ony_MooseI haven't really understood how call() works...14:57
An_Ony_MooseAnd the whole yielding busines...14:58
An_Ony_MooseAnd the whole yielding busines...15:04
An_Ony_Mooseoops15:04
prologicit uses python generators underneaht15:08
prologicto make the call() look syncrhonous15:08
prologicso you can write code like this:15:09
prologic@handler("foo")15:09
prologicdef _on_foo(self):15:09
prologic   x = yield self.call("bar")15:09
prologic   print x15:09
An_Ony_Moosehttps://github.com/Anonymooseable/Pirates/blob/circuits/draw.py#L31 am I doing something wrong here? It doesn't seem to register the handler.15:23
An_Ony_Moosehttps://github.com/Anonymooseable/Pirates/blob/circuits/draw.py#L31 am I doing something wrong here? It doesn't seem to register the handler.15:29
An_Ony_Mooseargh15:29
An_Ony_Moosewrong shell... again!15:29
An_Ony_Moosethe problem seems to be that after yielding, execution never returns to the function.15:37
prologicBaseComponent won't automatically create handlers for you16:16
prologicif you want to use BaseComponent16:16
prologicyou _must_ use @handler16:16
prologicon your methods16:16
prologicand if you're going to create dyamic handlers16:18
prologicyou need to call16:18
prologicself.addHandler(...)16:18
An_Ony_Mooseprologic: aaaah so I need to use addHandler instead of calling the decorator within __init__16:18
An_Ony_Mooseprologic: can I still add a channel= argument?16:21
An_Ony_MooseI can't seem to find any documentation on addHandler. Source browsing time!16:22
An_Ony_Mooseoh I need to make it a class?16:24
An_Ony_Mooseer, not really16:24
An_Ony_Moosebut give it attributes16:24
An_Ony_Mooseso...16:26
An_Ony_Moose_on_draw.channel = self.real_draw_channel16:26
An_Ony_Moose_on_draw.names = ["draw"]16:27
An_Ony_Mooseself.addHandler(_on_draw)16:27
An_Ony_Moose?16:27
An_Ony_MooseYEEEES IT WOOOOOOOORKS to a point16:32
An_Ony_Moosewell now I have a race condition16:36
An_Ony_Mooseso stuff draws... IF things happen in the right order.16:37
An_Ony_MooseNow I need to go from using fire() to using call()... But yielding to self.call() never seems to return...16:37
*** Guest966 has joined #circuits19:34
An_Ony_Mooseyou could just replace screen with rectangles (which you create using rectangles = pygame.Surface((dimensions), pygame.SRCALPHA, 32) ) and then blit rectangles to the screen19:58
An_Ony_Mooseoops19:58
An_Ony_Mooseblarg, constantly in the wrong shell19:58
prologicyou still need to use @handler21:25
prologicas well as addHandler21:25
prologic@handler decorates the function with the name and channel21:25
prologicand other configuration paramters for the hadnler21:25
prologicso21:26
prologicself.addHandler(handler("foo", channel="bar")(_on_bar))21:26
prologicself.call should work fine21:27
prologicnot sure why you're having issues21:27
prologicand you _could_ order your events with fire too21:27
prologiccall/wait are just synchronous convenience21:27
An_Ony_Mooseuuuh21:39
An_Ony_MooseI dunno21:39
An_Ony_Moosehttps://github.com/Anonymooseable/Pirates/tree/circuits + http://soundray.org/linus/call.patch21:42
An_Ony_Moose(in case you care to try)21:42
An_Ony_MooseOr are the events guaranteed to be handled in the order I want them to?21:43
prologicevents run in the order you fire them23:24
prologicyes23:24
*** ninkotech has quit IRC23:26

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