Ran into dmhouse on #haskell today. One bit of conversation led into another, and before I knew it I was rewriting the entirety of the basic concepts (now called Variables and functions) chapter. I hope it doesn't suck too badly, but I guess I'm not too worried, since the community can always come in and clean up after me later. Also completed the Write Yourself a Scheme in 48 Hours import. It was easy, thanks to the Perl module HTML::WikiConverter.
Hobby-hacking Eric
2006-07-09
2006-07-07
ssh issue hacking
Revisited one of old demons last nights : poor sleeping habits. Up to end of June, I had managed to make a completely artificial transformation of myself into a morning person, sort of as a neccessity in becoming more effective at work. But last night, I started hacking on SSH issues and ended up doing what the French call a white night... pulling an all-nighter, that is. You know how it goes. You start working on one issue, and actually that itself doesn't take that much time (in this case, a fix for CM-related stuff), but then in the process of testing your stuff you notice other problems (like, me trying to run test this on Putty with my Mac) and so you start hacking on that, and your stupid tenacity makes it so that you don't give up until the very end. Of course, by the end of the night, I was being really really slow, even watching the Corporation on the my computer while waiting for darcs to recompile for the umpthinged time (which of course slowed down the compilation and also made the viewing very choppy and unpleasant).
In my more disciplined days, I would have been smart enough to have told myself that anything I can do at night, I could also do after waking up, and much more efficiently at that (you know, without the fatigue-induced stupidity). Instead of staying up to do darcs hacking, going to bed at 09:00 and then going to work at 15:00, I could have just gone to bed, gotten up early, done my darcs hacking, and still gone to work late, only probably not nearly as late as before. Silly me. I will get back in gear. This was the thing I was afraid of. You take one little holiday and all your (completely artificial) sleep schedule goes all out of whack. Need to get my discipline back and remember that until the end of next year, everything I do needs to be secondary to the thesis.
Anyway, hope my sleep-derived patches actually work as expected, and aren't chuck full of stupidity. Learned a bit about Unix in the process, like what /dev/tty does.
In my more disciplined days, I would have been smart enough to have told myself that anything I can do at night, I could also do after waking up, and much more efficiently at that (you know, without the fatigue-induced stupidity). Instead of staying up to do darcs hacking, going to bed at 09:00 and then going to work at 15:00, I could have just gone to bed, gotten up early, done my darcs hacking, and still gone to work late, only probably not nearly as late as before. Silly me. I will get back in gear. This was the thing I was afraid of. You take one little holiday and all your (completely artificial) sleep schedule goes all out of whack. Need to get my discipline back and remember that until the end of next year, everything I do needs to be secondary to the thesis.
Anyway, hope my sleep-derived patches actually work as expected, and aren't chuck full of stupidity. Learned a bit about Unix in the process, like what /dev/tty does.
Revisited one of old demons last nights : poor sleeping habits. Up to end of June, I had managed to make a completely artificial transformation of myself into a morning person, sort of as a neccessity in becoming more effective at work. But last night, I started hacking on SSH issues and ended up doing what the French call a white night... pulling an all-nighter, that is. You know how it goes. You start working on one issue, and actually that itself doesn't take that much time (in this case, a fix for CM-related stuff), but then in the process of testing your stuff you notice other problems (like, me trying to run test this on Putty with my Mac) and so you start hacking on that, and your stupid tenacity makes it so that you don't give up until the very end. Of course, by the end of the night, I was being really really slow, even watching the Corporation on the my computer while waiting for darcs to recompile for the umpthinged time (which of course slowed down the compilation and also made the viewing very choppy and unpleasant).
In my more disciplined days, I would have been smart enough to have told myself that anything I can do at night, I could also do after waking up, and much more efficiently at that (you know, without the fatigue-induced stupidity). Instead of staying up to do darcs hacking, going to bed at 09:00 and then going to work at 15:00, I could have just gone to bed, gotten up early, done my darcs hacking, and still gone to work late, only probably not nearly as late as before. Silly me. I will get back in gear. This was the thing I was afraid of. You take one little holiday and all your (completely artificial) sleep schedule goes all out of whack. Need to get my discipline back and remember that until the end of next year, everything I do needs to be secondary to the thesis.
Anyway, hope my sleep-derived patches actually work as expected, and aren't chuck full of stupidity. Learned a bit about Unix in the process, like what /dev/tty does.
In my more disciplined days, I would have been smart enough to have told myself that anything I can do at night, I could also do after waking up, and much more efficiently at that (you know, without the fatigue-induced stupidity). Instead of staying up to do darcs hacking, going to bed at 09:00 and then going to work at 15:00, I could have just gone to bed, gotten up early, done my darcs hacking, and still gone to work late, only probably not nearly as late as before. Silly me. I will get back in gear. This was the thing I was afraid of. You take one little holiday and all your (completely artificial) sleep schedule goes all out of whack. Need to get my discipline back and remember that until the end of next year, everything I do needs to be secondary to the thesis.
Anyway, hope my sleep-derived patches actually work as expected, and aren't chuck full of stupidity. Learned a bit about Unix in the process, like what /dev/tty does.
ssh issue hacking
2006-05-28
laziness, unsafePerformIO, atexit
Just learned a bunch of neat stuff this weekend. Had a discussion on darcs-devel with Juliusz over issue171. I had propoposed sort of a naive fix based on looking for ssh paths on the command line arguments, and he suggested instead something that would call the ssh control master when need be, using laziness and unsafePerformIO. My reaction to this was... "uh, sounds nice, but I don't know how?". So after I submit my patch, he shows me what he has in mind, and lightbulb! It makes perfect sense when you look at it, but it so is not something I could have come up with by myself. The pattern goes like this:
And the effect is that when you call foo, the embedded IO action gets executed when needed (because of laziness), but only once! Haskell is still a pretty mysterious and magical language to me, but the way I like to think of it goes like this: we're doing functional programming, right, so once we know the value for something, that value is never going change, so there's no point reevaluating it. We just keep it around all pointer-like (hand waves). Kinda scary how long I've been getting by without really understanding how things work underneath.
There's two things I do with laziness at work:
type Bar = ...
foo :: Bar
foo = unsafePerformIO fooIO
fooIO :: IO Bar
And the effect is that when you call foo, the embedded IO action gets executed when needed (because of laziness), but only once! Haskell is still a pretty mysterious and magical language to me, but the way I like to think of it goes like this: we're doing functional programming, right, so once we know the value for something, that value is never going change, so there's no point reevaluating it. We just keep it around all pointer-like (hand waves). Kinda scary how long I've been getting by without really understanding how things work underneath.
There's two things I do with laziness at work:
- learn to live with it - i.e. program without actually caring about when things actually happen
- use it to simplify code (since it's lazy and you don't care, you can write some things in a naive-looking way and know that they'll work just fine)
atexit
The other wow-neat moment was looking at the AtExit code. Not something I neccesarily understand, although I do recognise bits and pieces of Concurrent Haskell that I gleaned from one the Simons' Asynchronous Exceptions paper (we needed asynchronous exceptions at work), but very neat nonetheles. The net effect is that the unsafe+lazy idiom that Juliusz showed me combined with Tomasz's atexit means that all the SSH stuff is now all nice and encapsulated. No details! The ssh control master stuff just works magically and the person invoking it doesn't have to know a danged thing about it. This black box has been brought to you by lazy evaluation and people with names that end in Z.patch set
Not only did I not go to work this weekend like I told myself I would be doing, I even procrastinated on my hobby. Basically put off till almost bedtime looking into darcs internals and figuring out what the heck a patch set is so that I can implement the minimal context function. My one insight after unrolling the big ball-o-yarn is that there probably is some relationship between patch sets and inventories; and that the best way to find out what a patch set was would be to look at the code that actually makes them out of thin air. So now the function I'm staring at isDarcsRepo.read_repo_private. Slowly getting closer. Guess I'll figure more stuff out next weekend.
Just learned a bunch of neat stuff this weekend. Had a discussion on darcs-devel with Juliusz over issue171. I had propoposed sort of a naive fix based on looking for ssh paths on the command line arguments, and he suggested instead something that would call the ssh control master when need be, using laziness and unsafePerformIO. My reaction to this was... "uh, sounds nice, but I don't know how?". So after I submit my patch, he shows me what he has in mind, and lightbulb! It makes perfect sense when you look at it, but it so is not something I could have come up with by myself. The pattern goes like this:
And the effect is that when you call foo, the embedded IO action gets executed when needed (because of laziness), but only once! Haskell is still a pretty mysterious and magical language to me, but the way I like to think of it goes like this: we're doing functional programming, right, so once we know the value for something, that value is never going change, so there's no point reevaluating it. We just keep it around all pointer-like (hand waves). Kinda scary how long I've been getting by without really understanding how things work underneath.
There's two things I do with laziness at work:
type Bar = ...
foo :: Bar
foo = unsafePerformIO fooIO
fooIO :: IO Bar
And the effect is that when you call foo, the embedded IO action gets executed when needed (because of laziness), but only once! Haskell is still a pretty mysterious and magical language to me, but the way I like to think of it goes like this: we're doing functional programming, right, so once we know the value for something, that value is never going change, so there's no point reevaluating it. We just keep it around all pointer-like (hand waves). Kinda scary how long I've been getting by without really understanding how things work underneath.
There's two things I do with laziness at work:
- learn to live with it - i.e. program without actually caring about when things actually happen
- use it to simplify code (since it's lazy and you don't care, you can write some things in a naive-looking way and know that they'll work just fine)
atexit
The other wow-neat moment was looking at the AtExit code. Not something I neccesarily understand, although I do recognise bits and pieces of Concurrent Haskell that I gleaned from one the Simons' Asynchronous Exceptions paper (we needed asynchronous exceptions at work), but very neat nonetheles. The net effect is that the unsafe+lazy idiom that Juliusz showed me combined with Tomasz's atexit means that all the SSH stuff is now all nice and encapsulated. No details! The ssh control master stuff just works magically and the person invoking it doesn't have to know a danged thing about it. This black box has been brought to you by lazy evaluation and people with names that end in Z.patch set
Not only did I not go to work this weekend like I told myself I would be doing, I even procrastinated on my hobby. Basically put off till almost bedtime looking into darcs internals and figuring out what the heck a patch set is so that I can implement the minimal context function. My one insight after unrolling the big ball-o-yarn is that there probably is some relationship between patch sets and inventories; and that the best way to find out what a patch set was would be to look at the code that actually makes them out of thin air. So now the function I'm staring at isDarcsRepo.read_repo_private. Slowly getting closer. Guess I'll figure more stuff out next weekend.
laziness, unsafePerformIO, atexit
2006-05-13
still around
I have still been working on darcs since my last post, just at a much reduced rate at less than half an hour a day assuming it's not one of the (many) days that I'm not just way too tired to think about darcs. Managed to clear off a couple of hours here and there today. Mostly spent it writing regression tests for stuff I had broken in my previous patch (for implementing help --match), and well as slightly more aggressively testing the rmdir changes I made. Writing regression tests is like washing the dishes, I guess, extraordinarily dull but also very satisfying when you get it done.
Next I shall concentrate whatever bits and pieces of my darcs energy on minimal context.
If I get that done (and this might take forever with my new darcs pace), I'll continue working on the wikibook.
Next I shall concentrate whatever bits and pieces of my darcs energy on minimal context.
If I get that done (and this might take forever with my new darcs pace), I'll continue working on the wikibook.
I have still been working on darcs since my last post, just at a much reduced rate at less than half an hour a day assuming it's not one of the (many) days that I'm not just way too tired to think about darcs. Managed to clear off a couple of hours here and there today. Mostly spent it writing regression tests for stuff I had broken in my previous patch (for implementing help --match), and well as slightly more aggressively testing the rmdir changes I made. Writing regression tests is like washing the dishes, I guess, extraordinarily dull but also very satisfying when you get it done.
Next I shall concentrate whatever bits and pieces of my darcs energy on minimal context.
If I get that done (and this might take forever with my new darcs pace), I'll continue working on the wikibook.
Next I shall concentrate whatever bits and pieces of my darcs energy on minimal context.
If I get that done (and this might take forever with my new darcs pace), I'll continue working on the wikibook.
still around
2006-04-23
monad tutorial, slow darcs
monads tutorial
Fixed one of the flaws in my monads as spacesuits tutorial (well, nuclear waste containers rather) on wikibooks. It was in my definition of theget and put functions where I was accepting an argument too many (and then discarding it). The tricky bit was that using the correct definition of get/put involved introducing the anonymous bind >> operator to the reader. I hope I did it right... I think it's probably clearer anyway that I went ahead and did this... it makes the bit where I explain IO a tiny bit less shaky.Though this is a wiki, I seem to be in the habit of (1) profusely thanking people who modify the tutorial (2) reverting their change with a plea to read my comments on the discussion page. It's happened three times, already, one with ihope127's replacement of € with |> (which was a reasonable thing for him to do, since € wasn't Haskell, but € is useful because you can think of it as $, but backwards), another time with the get/put thing and a third with the use of the modify function. I really really DO want to collaborate, though (hence the profuse thanks), it's just that I keep disagreeing with what people do to it. I'm not a control freak, really. I hope I'm not, anyway. I mean, I do try to solicit the other party's opinion on matters and try to integrate what s/he thinks into the writing. Hope I'm not turning anybody off from the project.
slow darcs hacking
My darcs development is going soooo slowly. Part of it is because I'm working on it like 15 minutes a day, instead of a few hours, and 15 minutes isn't enough to get you into that state of intense concentration where everything just flows out of your fingers. I'll need to allocate a somewhat larger chunk of weekend to darcs, just so I can keep any promises I made. The other part is that it's kinda boring writing test suites, and I've got a little bit of that to be doing. Need to get a test suite for matching, and one for mv/rmdir testing out the issue154 fix. But I am workin' on it, making little bits of progress here and there.
That's the way it'll have to be I guess... it has occured to me that the only way I'm going to finish my thesis in the allotted 3 years is by working really fricking hard (I've got slightly under 1.5 years to go), so bye-bye hobbies. Oh well, it's been fun and very educational, not that this is goodbye darcsers or anything.
monads tutorial
Fixed one of the flaws in my monads as spacesuits tutorial (well, nuclear waste containers rather) on wikibooks. It was in my definition of theget and put functions where I was accepting an argument too many (and then discarding it). The tricky bit was that using the correct definition of get/put involved introducing the anonymous bind >> operator to the reader. I hope I did it right... I think it's probably clearer anyway that I went ahead and did this... it makes the bit where I explain IO a tiny bit less shaky.Though this is a wiki, I seem to be in the habit of (1) profusely thanking people who modify the tutorial (2) reverting their change with a plea to read my comments on the discussion page. It's happened three times, already, one with ihope127's replacement of € with |> (which was a reasonable thing for him to do, since € wasn't Haskell, but € is useful because you can think of it as $, but backwards), another time with the get/put thing and a third with the use of the modify function. I really really DO want to collaborate, though (hence the profuse thanks), it's just that I keep disagreeing with what people do to it. I'm not a control freak, really. I hope I'm not, anyway. I mean, I do try to solicit the other party's opinion on matters and try to integrate what s/he thinks into the writing. Hope I'm not turning anybody off from the project.
slow darcs hacking
My darcs development is going soooo slowly. Part of it is because I'm working on it like 15 minutes a day, instead of a few hours, and 15 minutes isn't enough to get you into that state of intense concentration where everything just flows out of your fingers. I'll need to allocate a somewhat larger chunk of weekend to darcs, just so I can keep any promises I made. The other part is that it's kinda boring writing test suites, and I've got a little bit of that to be doing. Need to get a test suite for matching, and one for mv/rmdir testing out the issue154 fix. But I am workin' on it, making little bits of progress here and there.
That's the way it'll have to be I guess... it has occured to me that the only way I'm going to finish my thesis in the allotted 3 years is by working really fricking hard (I've got slightly under 1.5 years to go), so bye-bye hobbies. Oh well, it's been fun and very educational, not that this is goodbye darcsers or anything.
monad tutorial, slow darcs
2006-04-06
cutting back
I've just sent my issue91 and resubmitted the issue154 patch... wow this goes a lot slower when you're only working in 45 minute increments. I'm going to be radically scaling back on my darcs activity until at least 19 April. Got some paper submission deadlines till then, and I'm basically going into thesis-overdrive. I'm only a 2nd year student, no writing up to do, but I'm going to need to bust ass if I want to emerge from this whole process with my fancy degree and to actually deserve it.
Still have some remaining darcs commitments: the wikibook still has huge gaping holes and I promised David+Juliusz that I'd implement the minimal_context stuff. Not that it would be hard for them to do it, the whole point was that it was easy and (1) they could farm it out (2) this would be a good way for a yellow belt like me to get to know some of the real meat behind darcs. So I still aim to get those done, but other than that, I'm hoping to get focused from here on out.
Still have some remaining darcs commitments: the wikibook still has huge gaping holes and I promised David+Juliusz that I'd implement the minimal_context stuff. Not that it would be hard for them to do it, the whole point was that it was easy and (1) they could farm it out (2) this would be a good way for a yellow belt like me to get to know some of the real meat behind darcs. So I still aim to get those done, but other than that, I'm hoping to get focused from here on out.
I've just sent my issue91 and resubmitted the issue154 patch... wow this goes a lot slower when you're only working in 45 minute increments. I'm going to be radically scaling back on my darcs activity until at least 19 April. Got some paper submission deadlines till then, and I'm basically going into thesis-overdrive. I'm only a 2nd year student, no writing up to do, but I'm going to need to bust ass if I want to emerge from this whole process with my fancy degree and to actually deserve it.
Still have some remaining darcs commitments: the wikibook still has huge gaping holes and I promised David+Juliusz that I'd implement the minimal_context stuff. Not that it would be hard for them to do it, the whole point was that it was easy and (1) they could farm it out (2) this would be a good way for a yellow belt like me to get to know some of the real meat behind darcs. So I still aim to get those done, but other than that, I'm hoping to get focused from here on out.
Still have some remaining darcs commitments: the wikibook still has huge gaping holes and I promised David+Juliusz that I'd implement the minimal_context stuff. Not that it would be hard for them to do it, the whole point was that it was easy and (1) they could farm it out (2) this would be a good way for a yellow belt like me to get to know some of the real meat behind darcs. So I still aim to get those done, but other than that, I'm hoping to get focused from here on out.
cutting back
2006-04-03
issue154
Got patches in to fix issue154. Zachary Landau pointed out that I had some arguments in a non-conventional order, so I unrecorded and flipped the arguments around. Good thing too. In the process, I spotted a bunch of cases where I was setting the flag to indicate that I was in the working directory, when that clearly was not the case. Being forced to go through this a second time was quite useful for spotting the errors.
Spent today working on help. Wasted a bunch of time trying to refactor some of the command line parsing stuff to use my disambiguate_commands function, but I just kept breaking darcs. Ended up deciding it wasn't worth it. Not really saving that much code, anyway.
Implemented issue91. Easy enough... maybe should have left it to newer developers, reel them in with breadcrumbs exactly the way I got sucked in. I did try to refactor PatchMatch.lhs in the process. It's one of those bad refactors, the kind that makes nice airy looking code and makes it compact and unfriendly. Good refactors, on the other hand, take a bunch of useless verbiage and make it concise. Short and sweet. Hmm... can't really convey this in a non-arbiratry-sounding way.
Whoah! It's past my new good eric bedtime. Need to learn to renounce, leave things for another day. Good night.
Spent today working on help. Wasted a bunch of time trying to refactor some of the command line parsing stuff to use my disambiguate_commands function, but I just kept breaking darcs. Ended up deciding it wasn't worth it. Not really saving that much code, anyway.
Implemented issue91. Easy enough... maybe should have left it to newer developers, reel them in with breadcrumbs exactly the way I got sucked in. I did try to refactor PatchMatch.lhs in the process. It's one of those bad refactors, the kind that makes nice airy looking code and makes it compact and unfriendly. Good refactors, on the other hand, take a bunch of useless verbiage and make it concise. Short and sweet. Hmm... can't really convey this in a non-arbiratry-sounding way.
Whoah! It's past my new good eric bedtime. Need to learn to renounce, leave things for another day. Good night.
Got patches in to fix issue154. Zachary Landau pointed out that I had some arguments in a non-conventional order, so I unrecorded and flipped the arguments around. Good thing too. In the process, I spotted a bunch of cases where I was setting the flag to indicate that I was in the working directory, when that clearly was not the case. Being forced to go through this a second time was quite useful for spotting the errors.
Spent today working on help. Wasted a bunch of time trying to refactor some of the command line parsing stuff to use my disambiguate_commands function, but I just kept breaking darcs. Ended up deciding it wasn't worth it. Not really saving that much code, anyway.
Implemented issue91. Easy enough... maybe should have left it to newer developers, reel them in with breadcrumbs exactly the way I got sucked in. I did try to refactor PatchMatch.lhs in the process. It's one of those bad refactors, the kind that makes nice airy looking code and makes it compact and unfriendly. Good refactors, on the other hand, take a bunch of useless verbiage and make it concise. Short and sweet. Hmm... can't really convey this in a non-arbiratry-sounding way.
Whoah! It's past my new good eric bedtime. Need to learn to renounce, leave things for another day. Good night.
Spent today working on help. Wasted a bunch of time trying to refactor some of the command line parsing stuff to use my disambiguate_commands function, but I just kept breaking darcs. Ended up deciding it wasn't worth it. Not really saving that much code, anyway.
Implemented issue91. Easy enough... maybe should have left it to newer developers, reel them in with breadcrumbs exactly the way I got sucked in. I did try to refactor PatchMatch.lhs in the process. It's one of those bad refactors, the kind that makes nice airy looking code and makes it compact and unfriendly. Good refactors, on the other hand, take a bunch of useless verbiage and make it concise. Short and sweet. Hmm... can't really convey this in a non-arbiratry-sounding way.
Whoah! It's past my new good eric bedtime. Need to learn to renounce, leave things for another day. Good night.
issue154
Subscribe to:
Posts (Atom)
