IRC Logs for #io Wednesday, 2013-12-04

*** gatesphere has joined #io00:12
*** hashmal has quit IRC00:40
*** mkroehnert has quit IRC01:10
prologicjer, I have an important question to ask of you :)02:23
prologicI think this is right up your ally02:23
prologicAn Object's hash02:23
prologicshould be computed based on it's value and slots right?02:24
jerprologic, so you remember the link i gave you earlier?02:41
jerthat's an object's "hash"02:41
jeri call it a shape02:41
jerand it was meant to be more than that, but as an implementation of a hash, it works pretty well02:41
jerit's more expensive than simply doing what io does, and taking its hash as the pointer to the spot in memory where the object resides02:42
prologicI'll have a look in a sec02:53
prologicfor the moment I've basically done this:02:53
prologicagain just abusing Python's own hashing of primitive object types02:54
prologicwhich I'm sort of hoping RPython has implementations for02:54
prologicotherwise I'll be writing my own hashing function :)02:54
zephyrtroniumhow exactly do lookups work with forwarding in io?02:57
jerzephyrtronium, when a message is received by an object, that message name is looked up on that object, and if it's not found, we iterate, depth first, over our "protos" list. looking up in he first object in that list, then if it's not found there, in its first parent, etc., until we traverse all of the objects in the protos list and all of the parents (we break cycles by storing a "have looked up already" bit on objects)02:59
zephyrtroniumthen if it isn't found, we do the same thing for the message "forward" and call it?03:00
jerif it's not found, we look for a forward, and if it's there, and a method, then we call it03:00
jerthat is your hook into breaking the default lookup behaviour of searching protos03:01
zephyrtroniummakes sense03:01
zephyrtroniumthank you03:01
jerworks just like ruby's method_missing, objective-c's forwardInvocation: and countless other similar implementations in countless other languages03:07
zephyrtroniumworks nothing like anything in asm, c, java, or go, and only vaguely like __getattr__ in python, so it is new to me :D03:09
jerwell, asm, c and go don't have anything like it =]03:17
*** nisstyre has joined #io03:23
prologicactually it works nothing like Python's _getattr__04:35
prologicthere is no equivilent in Python04:36
prologicyou'd have to code one up yourself04:36
prologicand explicitly use it everywhere in your code :)04:36
prologicprobably a new metaclass would do the trick :)04:36
prologicjer, if I understand things correctly04:36
zephyrtroniumone couldn't just use tricksy magic in __getattr__ itself to pull it off?04:36
prologicI plan to get rid of "forward" in mio04:36
prologicand basically just expose the entire lookup mechanism to user space in mio04:37
prologicand probably re-implement single inheritence in the std. lib04:37
prologicsound about right? :)04:37
prologiczephyrtronium, no really04:37
prologicI mean yes and no :)04:37
prologicyou'd still want to use a metaclass04:37
prologicand then use that metaclass on all your classes04:37
zephyrtroniumi wouldn't want to do it at all04:38
prologicbasically changing the behavior of __getattr__ on all your classes04:38
prologicbut for just a once off04:38
prologicsure abuse __getattr__04:38
prologicproblem is it's quite trickty to do too :)04:38
prologicnot as straight forward as an Io-style lang I think :)04:38
prologicanyway jer I just brought back deletion of traits04:39
prologicI decided in the end to change the way I implement it internally04:40
prologicI keep two hash maps04:40
prologicone for traits trait -> resolution04:40
prologicand one for behaviors name -> block04:40
prologicso it's all quite fast really04:40
prologicO(1) lookup for any trait behavior04:41
prologicand the same performance for deletion04:41
*** gatesphere has quit IRC04:42
jerprologic, that's exactly what i was going to do with acute05:05
jerleave out vertical composition (inheritance), build in horizontal composition (traits), and call forward if no slot was found, so i could allow users to implement vertical inheritance if they wanted05:06
prologicI'm going to do the same thing05:09
prologicI'll I'll call my lookup mechanisms05:09
jerthe downside to that is, you have to copy certain base behaviour (clone) into objects05:09
prologic__getattr__, __setattr__, __hasattr__05:09
jeri.e., auto-conformance of a BaseTrait05:09
jeror you require the user conform, if they want to override forward05:09
jer*OR* you make the object conform if they override forward automatically05:10
jerthe problem with the latter option is, conflict resolution05:10
prologicyeah I do see what you mean05:11
prologicbut I guess this could be solved by a BaseObject05:11
prologicthat the user cannot touch05:11
prologicbut they get Object in user space05:11
prologicI might be playing with all this next05:11
prologicmaking lookups more flexible05:11
prologicand re-implementing single inheritence in the std. lib05:11
*** inarru_ has joined #io05:21
*** zehl has joined #io05:22
*** asie has joined #io05:22
*** cathan has joined #io05:23
*** asie has quit IRC05:49
*** mhi^ has joined #io08:07
*** pinupgeek has joined #io08:43
*** mi6x3m has joined #io08:56
*** hashmal has joined #io08:57
*** Raimondii has joined #io09:03
*** TheMonkey has joined #io09:03
*** prologic_ has joined #io09:06
*** nisstyre has quit IRC09:07
*** jer_ has joined #io09:07
*** nisstyre has joined #io09:08
*** Thor^^ has joined #io09:08
*** nisstyre has quit IRC09:10
*** nisstyre has joined #io09:10
*** ElMonkey has quit IRC09:12
*** Raimondi has quit IRC09:12
*** pchalupa has joined #io09:31
prologicinteresting article09:40
prologicthis is precisely what I also want to do with mio09:40
prologicand one of my other long-term gaosl09:40
prologicinteropt with other langauges09:40
prologicat least Python at this stage and C09:40
mi6x3mprologic: in mio, how do you treat () in the beginning of a message09:40
mi6x3mprologic: > () a09:44
mi6x3m() at the start of a message09:45
mi6x3mio allows that but requires the () to be non empty09:45
prologicsyntactically this is allowed by the grammar of both Io and mio09:48
prologicin mio this would raise an error09:48
prologicunless a were defined in the context09:48
prologicas () is defined as a method (in std. lib builtins)09:48
prologicand essentially means09:49
prologicand in fact thank you for bringing this up too09:51
prologicyet another edge case I've just fixed :)09:51
prologicbut an edge case with the evalArg method09:51
prologicand on that note09:52
prologic0.1.6 is out :)09:52
mi6x3mprologic: so how do you solve it now?09:53
prologicIt was already supported by the grammer09:58
prologicand now I just fixed the evalArg that () gets translted to09:59
prologicwhat do you mean by how I've solved it?09:59
prologicDid you want to see the parser code?09:59
mi6x3mokay so () is a message EVERYWHERE10:05
prologicit's just a regular message10:05
prologicit just so happens it gets translated to evalArg10:05
prologic$ grin "set\(\"\(\\)" mio/lib10:06
prologic  248 : set("()", Object get("evalArg"))10:06
prologicthe only reason it translates to Object evalArg10:07
prologicwhich is implemented in Python10:07
prologicwas because a few times I tried to re-implement it in mio itself I ran into rpoblems10:07
prologicI should try to re-implement this again in mio in terms of Message10:07
prologichere's the parser if you're interested10:08
prologicin mio itself10:11
prologicwith 320+ unit tests it's easy to determine if changing anything breaks or affects anything else int he lang :)10:12
prologicwoot woot :)10:14
prologicthe further along mio's development I go10:15
prologicthe more I find I can implement in mio itself10:15
prologicand the less reliance on Python10:15
prologicI remembered why I couldn't implement () in mio10:33
prologicchicken/egg problem10:33
prologiccan't implement () if you have no way to properly do expression grouping and have no method for () in the first place10:33
prologicjer might have other ideas on this :)10:33
*** mhi^ has quit IRC10:42
*** mi6x3m has quit IRC11:07
*** mi6x3m has joined #io11:07
*** fredreichbier has joined #io12:39
*** pchalupa has quit IRC12:55
*** mi6x3m has quit IRC13:23
*** pchalupa has joined #io13:40
*** fredreichbier has quit IRC14:59
*** mi6x3m has joined #io15:03
*** nisstyre has quit IRC15:13
*** asie has joined #io15:27
*** mi6x3m has quit IRC15:39
*** mi6x3m has joined #io16:49
*** asie has quit IRC17:18
*** mi6x3m has quit IRC17:20
*** pchalupa has quit IRC17:23
*** mhi^ has joined #io17:35
*** mi6x3m has joined #io18:20
*** asie has joined #io19:24
*** asie has quit IRC19:39
*** asie has joined #io19:57
*** mi6x3m has quit IRC20:40
*** mhi^ has quit IRC21:04
*** hashmal has quit IRC21:13
*** mi6x3m has joined #io21:23
*** mhi^ has joined #io21:36
*** asie has quit IRC21:39
*** mi6x3m has quit IRC21:59
*** io-github has joined #io22:43
io-github01[13io01] 15stevedekorte tagged 062013.12.04 at 14f62cceb: 02
*** mkroehnert has joined #io22:52
*** mkroehnert has quit IRC23:02
jerprologic, in terms of implementing ""() in pure code it's trivial23:28
jersetSlot("", method(call evalArgAt(0)))23:28
jerprologic, i.e.,23:29
jerIo> setSlot("", method(call evalArgAt(0)))23:29
jer==> method( call evalArgAt(0)23:29
jerIo> (1 + 2 * 5)23:29
jer==> 1123:29
jerand if i redefine it to print out "i have no name" and then eval the arg, you can clearly see my version is being called:23:30
jerIo> (1 + 2 * 5)23:30
jeri have no name23:30
jer==> 1123:30
prologicand call evalArgAt(0) is a Message method?23:31
prologicevaluating a message argument?23:31
*** nisstyre has joined #io23:35
*** gatesphere1 has joined #io23:43

Generated by 2.11.0 by Marius Gedminas - find it at!