libera/#sicl - IRC Chatlog
Search
17:07:09
beach
Hmm, interesting... Suppose you have a sparse set of statically known values from a totally ordered domain, like a bunch of capital letters from the ASCII alphabet, like C, H, N, Q, W. Now you have some value v, and you want to check which of the elements of the set (if any) is equal to v.
17:07:12
beach
Even if you do a "binary search", it seems to me that you ultimately have to test for equality, so you have to do as many tests as there are elements of the set, plus the tests to split the set. So then, with binary search, you always have more tests to do than with sequential test.
17:07:56
beach
So "binary search" is advantageous only if the elements of the set are sometimes adjacent.
17:08:46
beach
I should know this already, because I recall integrating something like this into the algorithm for generic dispatch.
17:13:57
beach
Now it comes back a bit more. In generic dispatch, I check whether the endpoints of an interval are closed or open. If they are closed, I can omit the final test in some cases.
17:16:30
beach
I guess I should give up for today. I need to fix dinner for my (admittedly small) family.
18:07:10
yitzi
beach: I've got a partial fix for the AND issue. Doesn't address my weird initialization issue, but it does fix parallel stepping of subclauses. All ANSI tests now pass. Just FYI.
18:47:48
Bike
every time i think too hard about multiway branching i get lost in a world of fascinating intractable problems and i have to remind myself that in practice any advantage over binary search is probably not going to be very large.
18:50:08
Bike
i could probably put doctoral-thesis-level effort into making generic dispatch a few cycles faster if i was so inclined
2:19:45
moon-child
obviously, it is a safety problem to be able to turn an integer into a pointer. Is it a problem to be able to go the other way?
2:21:34
moon-child
I suppose it could be used to aid in exploiting other vulnerabilities. But while I can not see any problem with it per se, I also can not think of any reason why it would be useful to interpret the address of an object as an integer, unless debugging a gc
2:23:07
moon-child
many implementations will print an unreadable object using its address by default. But this seems suspect to me. An object could move to a different address; an object could be reclaimed, and another could be given the same address; addresses are not very distinctive, and a human may not immediately be able to tell the difference between two similar-looking addresses
2:23:39
moon-child
a display of slots, while somewhat unprincipled, would be no _less_ unprincipled due to the above problems, and probably more useful
2:25:48
hayley
I heard Java prints the identity hash code by default, which is stable regardless of GC.
3:35:58
Bike
displaying the pointer is pretty convenient practically speaking, and not as verbose as dumping slots
4:05:40
Bike
might be nice if you could kind of reverse hash it into something more human readable arbitrary text