IRC Logs for #io Saturday, 2013-11-09

*** fredreichbier has joined #io00:35
*** mkroehnert has joined #io00:40
prologicumm00:44
prologichttps://bitbucket.org/prologic/mio-lang/src/ab862e90141b8da9d5f8664d558a07418dac310c/mio/lib/builtins.mio?at=default#cl-12000:45
*** chadkouse has joined #io00:46
*** chadkouse has quit IRC01:18
*** fredreichbier has quit IRC01:26
*** Nisstyre-laptop has joined #io01:35
*** gatesphere has quit IRC02:26
*** hashmal has quit IRC02:54
*** nisstyre has joined #io04:23
*** gatesphere has joined #io05:35
*** Raimondi has joined #io06:18
*** nisstyre has quit IRC06:21
*** Raimondii has joined #io06:25
*** Raimondi has quit IRC06:27
*** gatesphere has quit IRC06:37
*** Raimondi has joined #io08:02
*** Raimondii has quit IRC08:04
*** hashmal has joined #io09:28
*** fredreichbier has joined #io11:27
*** espiral has joined #io12:26
prologicjer, any ideas how you'd go about implementing yield / generators with convinuations as your basic construct?12:44
*** OpenSpace has quit IRC13:20
*** fredreichbier_ has joined #io15:06
*** fredreichbier has quit IRC15:10
*** gatesphere has joined #io15:18
*** fredreichbier_ has quit IRC15:21
*** fredreichbier has joined #io17:36
*** nisstyre has joined #io17:50
jerprologic, yup, very simply ==17:50
jerWrite a fifo, enqueue your continuations onto it17:51
jerpop off continuations when yielding17:51
jeryou could yield with priority, and use a priority queue to give yourself a little less naive scheduling possibilities17:52
jerprologic, that was always my favourite way to simulate coroutines in functional languages that supported continuations =]17:53
jergenerators are basically weak coroutines.17:54
*** fredreichbier has quit IRC18:56
*** Raimondi has quit IRC21:05
prologicjer, and this schedular, is this an interepeter-level object or user-level object?21:16
jerprologic, on the interpreter-level21:49
jerit can't reasonably live at the object level without some global scheduler managing it all21:49
jeryou'll have contention21:49
jeryou could fudge object-level with a better global scheduler, assigning higher priorities to these continuations in the queue21:50
prologicic21:55
prologicso would you create this schedular on demand as coroutines are created using yield and continuation?21:55
prologicor just have a single global schedular that lets you put continatuions in the queue and run them21:56
jerwell, the way i'd structure it is probably like io's21:57
jerbut for that i wouldn't need continuations21:57
jerjust coroutines21:57
jerbut yeah i'd have a single global scheduler21:58
jerper thread21:58
jeri'd store it in thread local storage in fact21:58
prologicand by per thread21:59
prologicyou mean os-level thread right?21:59
prologicbecause with Python being my host langauge21:59
prologicthis is impossible because of the GIL :)21:59
prologicI can fake it with multiprocessing and a fake shared memory that in fact using a synchornized Queue over a Pipe22:00
prologic:(22:00
jeryeah i mean os-level threads22:01
jerthings that can use multiple cpus22:02
prologicalso I did something I don't normally do and hate other developers doing :)22:02
prologicover 500+ changes last night restructing a lot of internals22:02
prologicgah :)22:02
prologicbut on the plus die I can now write:22:02
prologichttp://codepad.org/4SjdwrJ722:02
jerneat22:02
prologicI would like the ability to also write it as a highe rorder message22:04
prologicbut I think that would mean my reduce function checking if f is a block or a message22:04
prologicactually I'm not even sure how I'd seamlessly support both :)22:05
jeryeah i can write that in io as: 1 to(10) asList reduce(*)22:05
jeragain the "asList" is only needed because i didn't implement reduce on Range22:05
prologicalso re os-level threads, is it strictly necessary to have shared memory between the soo-level threads? what exactly is Io's multi-state vm mean?22:06
jerio intends for a vm "state" to live in one thread22:06
prologicyeah remember I'm opting more for functional style rather than OO style22:06
jercommunication between threads can occur via a variety of mechanisms, but in general there's only one exposed in the language -- networking22:07
jerprologic, then HOM shouldn't really be a goal22:07
prologichmm22:07
prologicI just don't like objecs liettered with all kinds of methods22:08
prologicthat don't seem to make sense for such an object to make22:08
prologicexcept that it obviously allows for HOM to work quite nicely22:08
jeri don't like objects littered with methods either22:09
jermost of my objects are lean22:09
prologicyeah that's what I'm trying to do as well22:09
prologicadopting Python's duck typing where I can22:09
prologicand traits everywhere22:09
prologicwith lots of functional-style functions22:10
jerideally steve would have agreed that my standard library was a lot nicer than the io stdlib at the time22:10
prologicbut I'm not sure where HOM fit anymore22:10
jerand we'd have worked to implement it, to hell with backwards compatibility22:10
jermy stdlib was full of objects that were lean, rich collections22:10
prologicbackwards compat is for sissys :)22:10
prologicre what you said about Io's vm states and comms22:11
prologicif that's so that they commnication over some kind of socket anyway (the threads)22:11
prologicthen I _could_ utilize Python's mp22:11
prologicideally what I wanted to do though is use shared memory as boxes to store messages being sent to another thread22:12
prologican inbox/outbox22:12
prologicbut that's not possible with Python afaik22:12
prologicnot without faking it22:12
jerif you're thinking about going this route, you can build an actor language instead22:13
jerinstead of having objects as exposing state22:14
jerlike io does22:14
prologichttps://pypi.python.org/pypi/posix_ipc/0.9.622:14
prologichmmm22:14
prologicmaybe I"m wrong about that22:14
jerkeep objects modelled as isolated units of computation22:14
prologichmm22:15
prologicnot entirely sure I really like the Actor model fr concurrency22:15
prologicI find the model unintuiative22:15
jerwell it was just a comparison22:15
prologic*nods*22:15
jeractors are quite a lot like objects22:15
jerbut more functional22:15
prologicbut I do like message passing22:15
jerthat's all actors are -- a function (object/whatever) which has a mailbox it listens for changes to, this mailbox has a unique id, and a queue.22:16
jermessages come in on the queue dleivered to that id22:16
jerthe "id's" can just be names22:16
jerthey don't have to be numbers22:16
jerand those names can be scoped. there's really no limit on it except that they be unique22:17
prologicyes22:18
prologicthe only thing I don't like about them22:18
prologicis the other parts :)22:18
prologicthe actor rules22:18
prologicbut perhaps one could adopt this part of the model22:18
prologicin conjunction with normal Io objects22:18
jerthe actor model has only really 3 rules22:19
jeryou just have to be able to create an undetermined (but finite) amount of them (same with objects), you need to be able to send an arbitrary number of messages to them (same with objects), the only part that deviates is actually in terms of flexibility22:21
jerthough it is a side effect22:21
jerthe ability to say "on the next message, use this behaviour instead"22:21
prologichmm22:22
prologicperhaps I'll look into it some more22:22
jerthe actor model doesn't mandate synchronous or asynchronous processing of messages, it doesn't mandate single dispatch or multiple dispatch22:22
jerit's very loose actually =]22:22
prologicin terms of schedularing the actors however22:22
prologicI'm guessing you'd just use os-evel threads22:22
jerthe "mailbox" concept isn't even really needed if you aren't going to go entirely async22:23
prologicand run all actors concurrenctly?22:23
jernot necessarily22:23
jerthis is where a compiler helps22:23
jerthe compiler can determine the dependency graph22:23
jerand build that out into the resulting intermediate code that it generates22:23
jerto let the runtime know22:23
jerthe runtime would then schedule the objects according to how the compiler asks it to22:23
prologichmmm22:24
jerobviously if C depends on the result of A, but B doesn't, then A and B can run at the same time, but C has to wait22:24
prologicahh yeap22:24
prologicI guess what actors would give me is implicit paralellism22:24
prologicwhich is something I woudln't mind toying with22:24
jeryou can get that with a purely functional language too22:25
prologicthat's true22:25
prologicalthough mio is not strictly pure functional22:25
jerright22:25
prologicalthough there are side-effect free blocks22:25
prologicwhich are essentially pure22:25
jerit has assignment and can print things, at the very least22:25
jer=D22:25
prologicyes22:25
prologicboth of which are methods22:25
prologic:)22:25
prologicnot blocks22:26
jerdoesn't matter, they both side effect internal state22:26
prologictrue :)22:26
prologicbut I guess blocks in mio could be parallized easily22:26
jernot necessarily22:26
jerthey have to interact with non-pure code22:27
prologichmm22:27
prologicyes22:27
prologicin which case you couldn't22:27
prologicactor model for the wicked :)22:27
jeryeah at least you have free rein within the context of each actor to schedule work be done however you want22:44
jersince they cannot effect external state22:44
prologicthey cannot effect external state22:49
prologicbecause we abstract that in the form of mesages22:49
prologicright?22:49
*** Raimondi has joined #io23:01
jerprologic, right23:57

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