tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (working)
[personal profile] tim
Dear world (including my co-workers): please remind me to not work remote ever if I can avoid it! At least not until rustc gets significantly faster. The reason is that when I have two laptops, I can work on something else while I'm waiting for a build, whereas with only one, I get to... stare into space for 5-ish minutes every time I make a change. "I can just work on the train" only works if I bring two laptops with me. And that just gets awkward. (Yes, I worked all day today on a train going from Los Angeles to San José. Actually, I'm still not even in Paso Robles yet. We have slow trains in my country.)

With that out of my system, today after finishing bug triage (not very eventful; I learned that in the 1500-2000 range, there are a lot of legitimately hard and unfixed bugs, many of which are more like feature requests but not all) I wanted to fix as many open ICEs as I can. There aren't that many of them. Issue 3091 was pretty quick. I just had to make region pointers not a scalar type (they're really not scalar, since they have sub-structure that's visible in the language) and then change all the code that was casting pointers to region pointers to, well, not do that. (This happened only once in the core libs and in a few test cases.) As with so many things (well, not really that many things, I hope) the solution was to introduce library functions that wrap unsafe::reinterpret_cast (which is the equivalent of Haskell's unsafeCoerce). I'm quite proud of the name I came up with for the function that takes an &T to a *T: assimilate (because it makes the pointer forget its region).

3044 was a bit harder. Niko was right about the basic problem: there was one type error; since most type errors in Rust are non-fatal (the idea, not a particularly unique one, is to collect as many type errors as possible before bailing out, so you can fix as many of them as possible before you recompile (ha!)), sometimes the typechecker has to do extra work to clean up after erroneous cases so that typechecking can continue. In this case, the code involved a do block with the wrong number of arguments. do blocks in Rust have nothing to do with do-notation in Haskell, so you know. The typechecking code expects that when we typecheck the body of a do, we already know its type. But in this code example, the body wasn't supplied, since there were one too few arguments for the do function (foldr, in this case). I feel like I copped out here, but my solution was simply to make the "wrong type of do body" path trigger, even though the do body looks like it has the exact right type here (if you don't notice there actually is no body!), and change the error message so it makes sense in this context.

Wednesday and Tuesday, I was officially on medical leave, but like a foolish person, I did some work anyway. Not very productively. I've finally reached my limit of banging on #2936 without getting more help; all I've accomplished is realizing how much I don't understand the typechecker. Actually, I had similar experiences today as well with working on #3029, except realizing how much I don't understand the liveness analysis. Oh well, that's the best I could do while drugged up (I just had surgery, 'k?)

I've been feeling somewhat of a mental block about working further on dependency-graph computation. Probably being back in Mountain View with two laptops, air conditioning, and the team will help with that. And snacks. The snacks are essential.

(no subject)

Date: 2012-08-03 05:20 am (UTC)
From: [personal profile] nikomatsakis
oh yeah I want to poke at #2936 with you. I think your basic fix was probably right, it's probably just that there are deeper and worse bugs floating around. Maybe gist the patch or push it to your repo or something.

2 laptops :)

Date: 2012-08-03 09:40 pm (UTC)
From: [personal profile] biscuit1001
I have 3 computers and 1 Android phone, and ALL have had issues this week! It's Mercury Rx on steroids...


tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (Default)
Tim Chevalier

October 2017

8910 11121314
15 161718192021

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags