IRC Logs for #io Tuesday, 2013-11-12

prologicjer:  I began trying to compile mio with rpython last night -- I have a build task in the project that lets me do this easily now... bad news is that the interpreter is not RPython ready (yet) and does not compile. in fact it doesn't even get past the runtime initiilaization before blowing up :)00:29
*** hashmal has quit IRC00:51
jerneat01:23
jerheh01:23
prologicwell I'll get there eventually01:26
prologicI'm going to make mio 0.1.0 the version that I successfully compile using RPython and end up with hopefully a very fast efficient interpreter01:27
jercool01:29
jerbest of luck01:29
prologicheh01:53
prologic:)01:53
prologicwe'll see how it goes01:53
*** mkroehnert has quit IRC02:10
*** gatesphere has quit IRC03:18
*** ssfinney has quit IRC03:28
*** nisstyre has joined #io03:53
*** nisstyre has quit IRC04:12
*** nisstyre has joined #io04:27
prologicjer:  btw re actors ... not sure how I'd go about designing and implementing this (yet). my current thoughts are to enqueue messages passed to an object in an internal queue on all objects and then write a scheduler that concurrently processes all message queues of all objects. This would be my first shot at it. What do you think?04:38
*** nisstyre has quit IRC04:49
*** pchalupa has joined #io08:07
*** espiral has quit IRC09:06
*** espiral has joined #io09:08
*** espiral has quit IRC09:18
*** espiral has joined #io09:18
*** espiral has quit IRC09:24
*** espiral has joined #io09:25
*** espiral has quit IRC09:29
*** espiral has joined #io09:30
*** hashmal has joined #io09:55
*** quag_ has quit IRC10:18
*** quag_ has joined #io10:32
*** quag_ has quit IRC10:42
*** robonerd has joined #io11:07
*** gatesphere has joined #io11:13
*** hashmal has quit IRC11:14
*** gatesphere has quit IRC11:35
jergood simple first shot11:46
robonerdjer, hey what's happening?11:46
*** quag_ has joined #io11:48
jerrobonerd, it's 5:49am, not a hell of a lot11:49
robonerdjer, you are my john mcaffy11:50
jerwhy's that?11:50
robonerdi'll bet you're on a laptop with wireless internet riding through the jungle in an open top jeep at 67 mph as banditos are chasing you11:50
jeryou think i hide in the belizian jungle using a lot of bath salts?11:50
robonerdducking fire11:51
jerah11:51
robonerdtransporting large boxes of cash11:51
jeronly half of that is true11:51
jer=D11:51
robonerd:>11:51
jeri'm on a laptop with wireless internet, sitting down in my house next to the jungle11:51
jerwell next to a forest, not quite the jungle11:51
robonerddo you happen to know if the basic io distribution comes with language support for basic network functions?11:51
robonerddo you still feel safe in costa rica?11:52
jersee: http://jer.srcd.mp/5cIE+11:52
jeri'm in a gated community inside a gated community (no joke) yes i feel safe =]11:53
jerrobonerd, comes with support yes, depends on libevent though and comes as an addon11:53
robonerdwhat is meant by it coming as an addon?11:55
robonerdjer, gated communities can also turn into prisons11:56
robonerdheaven forbid11:56
prologicjer, thanks :) seems my understand is sound-ish :)11:56
robonerdthe key is the sentiment of the mass. how is that atm?11:56
jerrobonerd, it means it's not part of the vm proper, it gets compiled separately and dynamically loaded as needed11:57
jerthink of it like a dynamic library11:57
prologicalso I was watching a lot of pypy/rpython videos today and thought "are coroutines the basic building blocks or continations?" -- they kept talking about how you can implement everything on top of coroutines11:57
jerprologic, everything except continuations11:57
jerwell i should say11:58
jeryou can implement delimited continuations with coroutines, that's how we implement exceptions in io11:58
jerbut full continuations, you can't11:58
robonerdjer, ok i understand, thanks. happen to know why the networking module was based on libevent and not libuv?11:58
jerrobonerd, how old is libuv?11:58
prologicI always though continuations were the basic building blocks11:58
prologicand that you could build coroutines on top of those11:58
jerprologic, they are11:58
robonerdjer, no clue. couple years?11:58
prologicright11:58
prologicthen they're wrong :)11:58
robonerdjer, why can't you implement continuation on top of coroutine?11:59
jerrobonerd, io's had networking support for 10 years; that's probably why =]11:59
prologicthe most basic control structure is a coninatuion11:59
prologicnot a coroutine :)11:59
robonerdahh11:59
robonerdhow has libevent worked?11:59
robonerdhow was it to dev with if anyone knows?11:59
jerrobonerd, reasonably well11:59
robonerdprologic how do you define continuation?12:00
robonerdjer ok thanks, good to know12:00
prologica continuation (in my mind) is simply a reference to a stack frame somewhere12:00
prologicthat you can resume and go back to12:00
prologiclike a goto12:00
prologicafaik that's it12:01
prologicget save point, store it12:01
prologiccall it12:01
jerit's like a goto on steroids =]12:01
prologicexactly12:01
prologicwhich is why it's the building block12:01
prologiccoroutines are implemented on top of continuations12:01
prologicor rather they should be12:01
jerthey usually are12:01
prologicindeed12:01
robonerdjer, ok what's your definition of continuation?12:01
prologicgreenlet in python I guess is a form of that12:01
jerour fallback implementation for various platforms uses setjmp/longjmp to implement coroutines12:01
prologicwhere it messes with the C stack to try to mimic continuations in Python where it had none12:02
jerrobonerd, i see continuations as an abstraction of control flow12:02
prologicindeed I've discovered they really are12:03
robonerdhaha jer, i can always count on you to put a smile on my face. please, go on12:03
prologicI've implemented while, foreac, loop12:03
prologicall using continuations12:03
prologicnext up coroutines12:03
robonerdfor example, in what way is control flow abstracted?12:03
jerrobonerd, a continuation is merely a data structure that represents the current control state of the program12:03
prologichttps://bitbucket.org/prologic/mio-lang/src/tip/mio/lib/builtins.mio#cl-19412:04
robonerdor at least, a sub set of the currentl control state of the program. that is, the sub set which is relevant to that block of code12:04
robonerdcorrect?12:04
prologicas good as any an example of the abstraction at work12:04
jerprologic, well, a loop is pretty easy to do with continuations; c = capture; if(condition) { do stuff; callcc(c) }12:04
robonerdi mean, continuations have some kind of scope i presume12:04
jerrobonerd, they, like closures, capture the scope in which they were created. 12:05
robonerdok, as expected. is a continuation like a block?12:07
robonerdbeautiful view by the way, love it12:08
prologicin my impl. it's very similar to a block12:08
prologicin that it's callable12:08
prologicand preserve scope and context12:08
prologicunlike a block however it doesn't have locals12:09
jerright12:09
jera continuations state is read-only to it12:09
prologicit's just an object reference to a point in the program state12:09
prologicwhich wehn called, continues at that point12:09
prologicindeed12:09
jeryup12:09
prologicit cannot be changed12:09
prologicexcept to destroy it12:09
prologicand create another continuation12:09
prologicwow after 18months I kinda feel like I know a thing or two12:10
prologicsort of :) haha12:10
robonerdwait, a continuation can't write to its own local state?12:10
jerto put it in simpler terms, imagine that a computer's program counter wasn't just an incrementing number but also an incrementing clock. a continuation captures the point of the program counter and the time at which it was captured, and at some point in the future, goes "back in time" 12:10
jerrobonerd, a continuation is a data structure12:10
jerno12:10
robonerdi didn't follow the metaphor12:11
prologica continuation only has no user visible state or methods12:11
jerrobonerd, no worries12:11
prologicjust an internal state and it's callable12:11
jerright12:11
robonerdprologic like a function?12:11
prologicit's very much a represenation of the "interpreter state" at a parciaulr point in time12:11
prologicwell a block/method/function has user visible attributes and is callable12:11
jerrobonerd, a function represents a series of behaviours that produce a result12:11
prologicso not really like a function :)12:12
robonerdis it a way to snapshot some context and state, and operate on that state in a non destructive way12:12
jera continuation represents a point in the program's life at some time in the past12:12
prologicblocks/methods in mio (my toy lang) has body, args, kwargs all user visible attributes of the Block object12:12
jerwhen invoked, a continuation acts like a time machine, goes back to that state as it existed at the time it was captured12:12
prologicit's very very much like a goto12:12
prologicbut it remembers state12:13
jeryup12:13
robonerdjer, hmm ok, so does this allow something like, in my program i can call some function which takes current control scope, snapshots it, and stores it away for resuming later?12:13
prologictwo things are captured in an Io-like lang12:13
prologicthe pointer to the current message12:13
jerrobonerd, that's exactly a continuation12:13
prologicright after the continuation12:13
prologicand the context (i.e: the state)12:13
prologichttps://bitbucket.org/prologic/mio-lang/src/f1e844f2b8ede17d66c371c87777010040f8e96b/mio/core/continuation.py?at=default12:14
robonerdand the snapshot is of local scope vars12:14
prologichere's my impl.12:14
robonerdand values12:14
jerrobonerd, it copies the stack frame to the heap giving it unlimited extent12:14
jerstores a reference to that copy12:14
robonerdstack frame? i'm vague on that one12:14
prologicwell12:15
prologicstack frame / context12:15
jerwhen you cal la function, a stack frame is setup -- some memory is allocated on a fast access path12:15
prologicI think stack frames in mio are just that - context12:15
jerprologic, they're normal objects in io, i'm trying to be simple here though12:15
prologic*nods* :)12:15
jerrobonerd, think of it as a contiguous buffer of memory where you can store things12:15
jerquickly12:15
robonerdso a stack frame is implemented as an object in io?12:15
jerand that space will be automatically freed when the function exits12:15
robonerdahh12:16
jeryes12:16
robonerdso like some kind of working space12:16
jerio contexts though live in the regular heap and are managed by the garbage collector12:16
prologicand afaik are user accessible right?12:16
prologici.e: they're normal user objects12:16
jeryes12:16
jerthey are12:16
prologicand typically start off being the Root/Loobby12:16
jerif you get a ref to one, you can change its internal state12:17
prologicas the first context of everything12:17
jeractually no12:17
jerObject came first, then Lobby, but after Lobby was created, Object set its parent to Lobby, and Lobby set its parent to Object12:17
jerchicken-egg problem in languages12:17
prologicoh yes of course12:17
prologicyeap12:17
prologicslightly different thing in my mind12:17
prologicbut I guess it's also context :)12:17
prologicI do the same thing anyway identically12:18
prologicyou kinda have to :)12:18
prologicchicken/egg problem12:18
jerit's a technical term =]12:18
jerhttp://c2.com/cgi/wiki?ChickenAndEggProblem12:18
prologichttps://bitbucket.org/prologic/mio-lang/src/f1e844f2b8ede17d66c371c87777010040f8e96b/mio/state.py?at=default#cl-6912:19
prologicmy chicken/egg bootstrap function :)12:19
jerroot == Lobby?12:20
prologicin mio - yes12:20
jerah12:20
prologicwanted to be a bit different :)12:20
prologicand Root is less typing than Lobby :)12:20
prologicI thought Io has Lobby, JavaScript has window12:21
robonerdjer, so what did you end up doing?12:21
prologicI've seen some other Smalltalk-like langs that use some other name12:21
robonerdwhat is actually root w/e in io?12:21
prologicLobby in Io12:21
jerrobonerd, what do you mean what did i end up doing?12:21
prologicIo is Steve's creation :)12:21
robonerdwell in io, what is the root obj class ?12:21
prologicjer's just a mighty big expert on it :)12:21
robonerdi know12:21
robonerdsorry12:21
robonerdone million apologies12:22
prologicclone the git repo and see for yourself :)12:22
prologicI occasionally read through it's source12:22
jerrobonerd, Object12:22
robonerdah12:22
robonerdso what is Lobby then?12:22
robonerdthe root continuation?12:22
jerObject's parent12:22
robonerdwtf12:22
jerno it's a regular object too12:22
jerLobby's parent is Object12:23
robonerdso lobby is the root?12:23
jernope12:23
robonerdwow12:23
robonerdso you guys have circular refs12:23
robonerdhow does that work out?12:23
prologicyeap12:23
prologicalthough in mio my Object's parent is nobody/nothing12:23
prologicI didn't complete the circular ref the other way around12:24
prologicRoot's parens is however Object12:24
prologicparent*12:24
prologicand Root["Root"] is Root12:24
jerthe problem with a circular inheritance tree is you have to break lookup somewhere12:24
jerso the iovm keeps a ref to one bit in its internal bitfield to denote that it's done lookup12:24
jeri hate this, but it's happens12:24
jeri hate it because with lookup, objects get modified12:24
jerwhich involves not only a load from memory, but a store back to memory12:25
jerat least twice for every object looked up12:25
prologicI think I avoid all that mess by having a fairly linear chain and I don't implement MI12:25
jerif i were rewriting io today, i wouldn't implement inheritance12:25
prologichmm go on :)12:26
robonerdjer, yes, it's so hard to get right12:26
prologicmio has single inheritence and traits12:26
jerrobonerd, it's not really12:26
robonerdprologic my lang too12:26
prologicbut what would you do without any inheritence?12:26
jerprologic, i am not a fan of vertical composition that's done explicitly12:26
prologicahh12:26
prologicyes neitehr am i12:26
jeri'm a fan of providing a hook into lookup, so you can simulate vertical composition if you need to, and language-level support of horizontal composition12:26
prologicI prefer horizontail compisiotn as well12:26
prologicand really loving it12:26
prologichmm i see12:27
jeri'd also give you a way to compose functions; effectively allowing objects as merely modules12:27
prologicthat could be somehting I might be very interseted in changing in mio12:27
prologicwe talked about this I believe12:27
prologicwith my wanting to implement data descriptors12:27
prologicand exposing interpreter lookup mechanims to the user12:27
prologicand creating a meta object12:27
jerfor instance, i'd like to be able to write: Number abs compose(Number inc) call(-2) and get back 112:27
jerwhat it does is it feeds -2 into Number inc which +1's, giving you -1, then calls abs on -1 giving you 112:28
jerpipelines are extremely useful12:28
prologicisn't this just a functional freature?12:29
prologicbinding and composing functions of functions?12:29
prologiccurrying if I'm not mistaken?12:29
jerprologic, you're not mistaken12:29
prologicawesome12:29
jerio would be a hell of a lot different if i were implementing it today12:29
jer=]12:29
prologicI think I can already do this to some extent12:29
prologicbut I stlll want to mess around with binding a bit more12:29
prologicright now I can't do:12:29
prologicf = Number abs12:30
prologic-1 f()12:30
jerat its core would be something more closely resembling the lambda calculus, objects would be implemented using functions; horizontal composition would just be function composition, and functions can of course hold functions12:30
jerwell, -1 f() gives you a parsing problem that's not easy to resolve anyway12:30
prologicit sure does simplify things a lot12:31
prologicif everything is just a function12:31
prologicbut at some point you do have to do I/O12:31
prologicand effect external state :)12:31
jerright i know12:31
jeri'm not saying i'd make io pure12:31
robonerdjer, do you like the idea of sub functions, or functions within some object which are private and don't litter into the object's namespace12:32
robonerdprivate to the containing function, that is12:32
jeri'm a huge fan of limiting scope at the points where it doesn't need to be accessed past12:32
robonerdie: this function doesn't need to share this code externally, but it does want to contain it into a sub function so perhaps it can call it multiple times and not directly within a loop or some other obvious alternative?12:33
robonerdjer so an implied yes?12:33
jeran explicit yes12:33
prologicjer, that was a bad example above12:34
prologichttp://codepad.org/oNmfBgA112:34
prologicthis is what I can't do right now12:34
prologicwhich I want to play with and try to fix12:34
prologiclimiting scope can be achieved with closures though12:35
prologicso it's not necessarily something that needs to be part of the core vm12:35
robonerdok12:35
robonerdjer, so then i imagine the sub function's name would be entered into the function's local namespace, yes?12:35
jerprologic, ah12:35
prologicsee what i mean by a binding problem12:35
prologiceverything is bound to the receiver12:35
prologicwhich in most cases is fine12:35
jerrobonerd, not necessarily... if a closure is tail recursive, then it can reuse the same stack frame; but if it's not, no it has its own, captures a ref to the closing scope12:36
jerprologic, yup12:36
prologicso I think what I want to do there is bind blocks/methods to their creation context initially12:36
robonerdjer, if you like to constrain things to where they will be called and not beyond, why would the name of a function's sub function exist anywhere within the object?12:36
prologicand allow their binding to be changed12:37
robonerdit imo should be a direct property of the function12:37
jerprologic, you want io-style blocks then? =]12:37
prologicbut this presents a different problem12:37
jerc.f. Block setScope12:37
prologicI believe it makes blocks a moot construct12:37
jerrobonerd, conceptually it is.12:37
prologicjer, well I've got Io-style blocks12:37
jerrobonerd, closures can be seen as a type of object12:37
prologicand I can already change a blocks' scope12:37
jerprologic, no i was referring to the Block type... the one that supplies behaviour to methods and blocks12:38
prologicyeah that's what I was referring to as well12:39
jerah ok12:39
prologicmaybe I'm missing something vital int he way I manage scope12:39
prologic:)12:39
prologicanyway I'll play with it some more and see hwo it pans out12:40
prologicI'm off to bed :)12:40
jerprologic, later12:40
robonerdjer, when a continuation/block captures the values of local state, doees it do it at time of capture, or are the locals in the namespace then-references to now-values?12:45
robonerdi wonder if now-values are what's called 'futures' i've heard of12:45
jerrobonerd, when it's created12:46
jerotherwise it'd be of no use12:46
robonerdnot necessarily no use12:46
robonerdprogramming for the future, bro12:46
robonerdget with the present!12:46
*** hashmal has joined #io12:47
*** pchalupa has quit IRC16:21
*** ElMonkey has joined #io18:45
*** fredreichbier has joined #io19:12
*** nisstyre has joined #io21:24
*** mkroehnert has joined #io22:20
*** nisstyre has quit IRC22:27
*** nisstyre has joined #io22:40
*** gatesphere has joined #io22:56
*** fredreichbier has quit IRC23:03

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