IRC Logs for #io Sunday, 2013-12-01

*** irclogger has joined #io04:10
prologicjer, no they preserve the state04:10
prologicabsolutely they do :)04:10
robonerdjsph what's new?04:13
jsphjust started looking at Io a few days ago04:14
jsphi'm a junior at a university and thought it might be time to give something other than C++ or Obj-C a try04:14
prologicPython FTW :)04:16
robonerdjsph what do you want to do with ti?04:19
jsphI'm not really sure yet, I just wanted to find a more simple general purpose language. I've also been looking at ruby and python.04:21
jsphThe question came to me other day when i wanted to write a program to generate a truth table from a boolean expression and realized string parsing was not so easy for me with C++ :P04:22
prologicI would go with Python if I were you04:23
prologicmy 2c04:23
jsphlooks like a reasonable choice as the documentation and community seems to be easily accessible 04:25 pypi.python.org04:32
prologicare the two things you should get familiar with04:33
prologicas well as virtualenv (and/or virtualenvwrapper) and pip04:33
prologicthese will become your friends for life :)04:33
jsphthanks for the info 04:35
jsphprologic: what are your thoughts on Io? 04:41
prologicI like Io - or languages like it04:42
prologicbut I haven't found Io itself to be terribly useful in my own work as such04:42
prologicno fault of Io as a language itself really04:42
prologicas such I'm actuallying designing a new language based on Io with influence from Python, Lisp, Haskell and Io/Smalltalk (ofc)04:43
jsphinteresting, so far i really enjoy Io's syntax 04:44
jsphonly issue i feel i might run into is that it is really weird to search04:44
jsphon google etc04:44
jsphdocumentation seems sparse 04:45
jsphbut yeah, mostly i'm just exploring different languages at the moment04:45
prologicI think you like the aspects of Io I like too04:46
prologicnamely message passing semantics04:46
prologicand ast as a data structure04:46
prologicit makes for a very pwoerful expressive language04:46
jsphi'm stepping out, it was nice talking to you prologic.04:49
jerio and haskell are polar opposites of one another =]05:03
prologicI mean for the functional aspects :)05:17
prologicI have a problem with triats I haven't figured out a way of solving yet05:17
prologicI have things like TCloneable, TComparable, TIterable, etc05:17
prologicbut I have no way to determine of x uses one of these behaviors05:18
prologicas there are no references to TCloneable, TComparable, etc that you can compare against05:18
prologicunless you re-imported them05:18
jeri tackled this problem by calculating shapes05:25
prologichmm ok05:26
jerso basically a shape is a representation of the slots an object responds to05:26
prologicand what does "identitying an object's shape look like"?05:26
jerand any subset thereof, can be measured05:26
jerand intersected with another05:26
jerwhile it's not 100% accurate, it's often "good enough"05:26
prologicand how do you test an obejct's shape against something?05:27
prologicsay you wanted to determine if your object is iterable?05:27
jerset intersection05:27
jeryour shape doesn't have to be anyhting more than a set of slot names05:27
jerjust has to be some opaque type you can use to compare05:27
prologicyeah I know05:27
prologicbut what does it look like :)05:27
prologicx hasShape("foo") ?05:27
prologicit's not that I can't compare types05:28
prologicI just have no references to them05:28
prologicthey're sort of lost a bit05:28
jerwell more like: x uses(OtherTrait)05:29
prologiclike so05:29
prologicoh well I have that too :005:29
prologicbut that doesn't tell me what shape or type some object has05:29
prologicI do have05:29
prologicx hastrait(...)05:29
jeruses would generate the shape of x (a set of its slots) as would it of OtherTrait; and it can perform a set intersection05:29
prologicbut I still have lost references to the original traits though05:30
prologichrmm indeed05:30
jerhow can you lose trait information?05:30
prologicmy problem is what to compare it with05:30
prologicno no05:30
prologicsee the paste above05:30
prologicxs is a list05:30
prologicwhoose prototype List05:30
prologicactually uses traits TIterable and TComparble05:30
prologicbut there's almost no way to determine if xs is Iterable at all05:31
jerwell that is indeed a problem, since you have differential inheritance05:31
prologicas I have no idea what Iterable is05:31
prologicunless I re-import that object05:31
jerwell there is, but it's not pretty05:31
jerit's O(n) in time complexity05:31
prologichence inlies my problem :)05:31
prologicoh I'm pretty sure I can make it O(1)05:31
jeryou have to iterate your parent and check too05:31
prologicbut I still have the problem of not knowing what TIterbale is05:31
prologicmainly because I don't store it anywehre05:32
prologicin globals05:32
prologicor the lobby05:32
prologicso it's inaccessible05:32
jerwhy would you have to know that though? The user supplies that05:32
prologicI was thinking of giving traits a name05:32
prologicthat can be compared against easily05:32
prologicor a shape (like you say)05:32
jerthe problem with a shape is it's a time varying variable05:32
prologicxs usesTrait("iterable")05:33
prologicwould be quite easiy05:33
prologicthink about Python for example05:33
prologicyou can do things like05:33
jeri still don't understand the problem though05:33
prologicif isisntance(xs, list):05:33
jeryou don't need to know TIteratable05:33
prologicbut you know what "list" is05:33
jerthe *USER* supplies that info05:33
jeryou're asking it if it's got the shape of an iteratable05:34
prologicso xs hasShape(...)05:34
prologicwhere ... is what exactly?05:34
jerthe user will determine that05:34
jerxs hasShape(TIteratable)05:34
prologicso the user would have to do:05:34
jeryou do expose these in the language, right?05:35
prologicfrom bootstrap.iterable import TIterable05:35
prologic(xs hasShape(TTerable)) ifTrue(...)05:35
jerthe extra grouping shouldn't be needed05:35
jer(if it is, your parser is broken)05:35
prologicno it isn't required :)05:35
jerbut if that's the way you bring it in, then yeah05:35
prologicthat's essentially the problem I have with this05:35
prologicI don't want to have to bring in core traits that the langauge provides05:36
prologicI realyl should store them somewhere05:36
prologicin Lobby Traits05:36
prologic(Root Traits) for me05:36
jerso do that05:36
prologicor something05:36
jerlook at Io's "Core" object05:36
prologicis that sane enough? :)05:36
prologicI could easily store them in Core too05:36
jerspecifically, Protos Core05:36
prologicI do for many builtin core protos05:36
jeryou could just do Traits Core05:37
prologicbut not for any traits defined in the mio std lib05:37
jerTraits Network05:37
jerTraits ...05:37
prologicI think this would work well05:37
prologicthen at least you'd have a known set of trait protos05:37
prologicthat you can lookup and reference05:37
prologicany user-defined I don't care about - up to the user05:37
prologicI was just going to abuse the is method05:38
prologicso it'd be something like05:38
prologicxs is(TIterable)05:38
jerbut you could pack them neatly in their own namespace05:38
prologicwould work not do an identity check in that case05:38
prologicbut for xs is(TIterable) to work nicely05:38
prologicI'd have to make traits a special object05:38
prologicI think05:38
jerdoesn't have to be05:39
jerbut traits probably should be a special kind of object anyway05:39
prologicthat is if I want to abuse the identity method "is"05:39
prologicthat's what I'm thinking05:39
prologicI'd really like traits to be special05:39
prologicwith no way of storing state05:39
prologicor rather05:39
prologicimmutable state05:39
jeryou were right the first time05:40
jertraits should not introduce state05:40
prologicI have on my todo list trait validation too05:40
prologicwhich I haven't done yet05:40
jeri mean, the methods they define can have their own state, but traits themselves must not have state05:40
prologicI was just thinking of attributes though05:40
prologictraits can have them05:40
jerthat is a "must not" in terms of the definition of a trait05:40
prologicbut you should never be able to store state05:40
prologicthey essentially get mixed into the object using the trait05:40
jerwhat's an attribute then?05:40
prologiclike any other attribute (method)05:40
prologica slot05:40
prologicno different to any other object05:41
prologicmethod, number, string, blah05:41
jera slot holds state05:41
prologicI horizontally mix any traits into the object05:41
jera trait is trivially, a set of methods05:41
prologicby copying05:41
prologicI've read in some papers somewhere that traits can also define attributes05:41
prologici.e: non-methods05:41
prologicbut they don't have to be state05:41
prologice.g: default values for things05:42
prologicor starting points05:42
jeractually they can't05:42
jermixins can05:42
jerbut mixins aren't traits05:42
jertraits have two properties a mixin doesn't05:43
jer1) No state allowed05:43
jer2) Conflict resolution must be explicit05:43
prologicfor example:
prologicdo you really consider "name" in the example above as state?05:43
prologicsince it can never change anyway05:44
prologicexcept by the object the trait uses05:44
jerto be, that would be a compiler error on line 1205:44
prologicthe original slot/object is essentially immutable05:44
jersince TGreetable has slots which are not holding behaviour05:44
prologicthat example is a little wrong anyway since the TGreetable name attirbute conflicts with World's name atribute05:45
prologicand should really raise an error05:45
jerit doesn't at the time of using it though05:45
jerit'd be wrong if the order of those ops was reversed05:45
prologicno that is true05:46
prologicyou're quite right05:46
prologicanyway, is this bad?05:46
prologicis it really state?05:46
prologicor essentially the same as any other behavior05:46
jerin io it's a little fuzzy, because we model behaviour as state05:46
jeri.e., functions/methods are objects (just data)05:46
prologicwhich is sort of why I don't have a problem with this05:47
prologicname and hello are essentilly the same05:47
jerin an io like language, trait support to me would require the presence of two things on all contained objects in the trait:05:47
prologicjust slots/attrs05:47
jer1) activatable bit set05:47
jer2) activate method defined05:47
jerif those two aren't present, it's considered state, and not behaviour, thus not permitted05:47
prologicessentially disallowing "name"05:47
jeron line 4, yeah05:47
jeri'd generate a compiler error on line 12, and link it to 405:48
prologicwell I can easily change this05:48
prologicI'm not 100% happy with my traits impll yet05:48
prologicI would too05:48
prologicraise TypeError("traits cannot contain state")05:48
prologicI'll add this to my todo list05:48
prologicas well as making traits a special kind of object05:49
prologicand adding them to Root Traits05:49
prologicso at least traits defined by the langauge's core and standard library are accessible and easily comparable/testable05:49
prologicI'd then have two kinds of types in mio05:49
prologiccore types Number, Object, String, etc -- anything defined in the host language (Python)05:50
prologicand testable/comparable traits05:50
prologicwhich I'll abuse the is() method for05:50
prologicxs is(TIterable)05:50
prologicfor example05:50
prologicbtw Does Io have keyword arguments?05:55
prologicI don't think it does?05:55
prologicand afaik it doesn't have argument packing/unpacking either right?05:56
prologica, b = 1, 205:56
prologicxs = [1, 2, 3]05:56
prologicwhere foo := method(a, b, c, a + b + c)05:57
jerit has none of that05:57
jerimplementing keyword arguments isn't exactly complicated05:57
prologicI've implemented such things05:57
prologicbut the code really sucks ass05:57
prologicand my kwargs support isn't 100% working properly05:58
prologicand I haven't got packing/unpacking to work yet05:58
prologicno, it's not that hard05:58
prologicthe way I've done it so far05:58
prologicis to abuse the language itself05:58
jerthat's the easiest way =]05:58
prologicI check for set("x", 1) in the message arguments05:58
prologicwhere set in mio is like setSlot in Io05:58
prologicit works05:58
prologicbut there are a few edge cases05:59
prologicI implemented Tuple core object type05:59
prologicfor easier packing/unpacking05:59
prologicbut I think I ran into issues05:59
prologicwhere the parser didn't really support:05:59
prologica, b = 1, 205:59
prologicI think it violates the grammar a bit05:59
jerit actually violates it quite a lot05:59
prologicmio> a, b = 1, 206:00
prologic  AttributeError: Object has no attribute 'a'06:00
prologic  ---------------06:00
prologic  a06:00
prologicI know!06:00
prologicso not sure how to sanely support it yet06:00
jeryou won't06:00
prologicit may be one of those things that never gets done06:00
jeryou could do it if you wrapped things in a method call06:00
prologicI tried to modify the parser to support it06:00
prologicbut it blows up06:00
jervars(a, b) = list(1, 2)06:00
prologicyou can't write a parser for it06:00
prologicwell I can't :)06:01
prologicahh yes06:01
jervars would set a to the list at(0) value06:01
prologicthat actually makes a lot of sense06:01
jerin the context of its sender06:01
prologicand could be done in the lang itself too06:01
prologicof course!06:01
prologicI actually like this :006:01
jerbut i actually think that'd be special syntax06:01
prologicit's rather explicit too06:01
prologiclook it's one of those things really06:02
prologicthat I don't really use all that often06:02
prologicit's sort of convenient more than anything06:02
prologicx, y = 1, 206:02
prologicx = 106:02
prologicy = 206:02
prologiclezy programmers :)06:02
prologicI think it's more important to have argument and keyword argument packing/unpacking for methods/blocks06:02
jeri dunno, i got to graphing my use of assignment as a per line metric06:02
prologicfoo(*args), foo(**kwargs)06:02
jerand in the last 5 years (i didn't go back further than that), there's a clear trend downwards on my use of assignment06:03
jeracross the board, not just objc or c06:03
prologicsame here06:03
prologicif you don't need to assign to some reference06:03
prologicyou don't need to06:03
prologicwhy write 6 lines of code with a for loop, variables, etc06:03
prologicwhen you can just write map(foo, xs)06:04
jeralso find myself writing out monadic expressions more and more06:04
jeri think i've turned into a functional programmer =p06:04
prologicyou should see my project at work06:04
prologicand test instance at
prologicall the backend python code is very functional :)06:04
prologicespecially the data generation side06:04
jerit's already after midnight here, i should get going06:06
jertomorrow's gonna suck06:06
jermy birthday =/06:07
jeranyway, later06:07
prologichappy birthday :)06:07
prologicand g'night :)06:07
*** jsph has joined #io06:15
*** dvorak42 has joined #io06:20
dvorak42Is there a known problem with the original level05 challenge? 06:21
*** pchalupa_ has joined #io06:25
*** jsph has quit IRC07:41
*** asie has joined #io08:06
*** pinupgeek has joined #io09:01
*** hashmal has joined #io09:14
prologicwhat's level05?09:22
*** asie has quit IRC09:49
*** asie has joined #io10:01
*** mi6x3m|2 has joined #io10:05
*** mkroehnert has joined #io10:20
*** asie has quit IRC11:04
*** mi6x3m|2 has quit IRC12:07
*** mi6x3m|2 has joined #io12:23
*** asie has joined #io12:45
*** mi6x3m|2 has quit IRC12:50
*** pinupgeek has quit IRC12:51
*** pinupgeek has joined #io13:06
*** gatesphere has joined #io13:48
*** gatesphere has quit IRC14:04
jerprologic, there's a hacking contest called io too, there are many levels. so level01 will start with you finding a file on the system for instance, level02, to write some code to trivially exploit something, and it gets progressively harder from there15:10
jerat least, if it's the same one i'm thinking about; i played about 10 years ago15:10
*** pinupgeek has quit IRC15:18
*** asie has quit IRC15:31
*** asie has joined #io16:50
*** mkroehnert has quit IRC17:00
*** pinupgeek has joined #io17:10
*** asie has quit IRC17:11
*** gatesphere has joined #io17:55
*** mi6x3m|2 has joined #io18:49
*** mi6x3m|2 has quit IRC19:37
*** mi6x3m|2 has joined #io19:41
*** mi6x3m|2 has quit IRC20:23
*** nisstyre has joined #io21:06
*** mi6x3m|2 has joined #io21:23
*** mi6x3m|2 has quit IRC21:59
prologicsounds interesting but boring at the same time :)22:07
prologicI enjoy Project Euler problems these days22:08
prologichavent' done any in a while though :)22:09
prologicon Level 1 29/448 problems solved22:09
*** mhi^ has joined #io22:09
prologicjer, my generators/yield sucks :)22:19
prologicdoesn't work for object methods22:19
prologiconly blocks :/22:19
prologicgotta rebuild delimited continuations22:19
prologicand write lots of test cases to cover all edge cases :)22:19
*** mkroehnert has joined #io22:34
*** hashmal has quit IRC23:16
*** jsph has joined #io23:18
*** jsph has quit IRC23:41
*** mhi^ has quit IRC23:54

Generated by 2.11.0 by Marius Gedminas - find it at!