←2010-04-21 2010-04-22 2010-04-23→ ↑2010 ↑all
00:01:12 -!- coppro has quit (Remote host closed the connection).
00:01:56 -!- Gracenotes has quit (Quit: Leaving).
00:10:09 <oerjan> actually [A] seems useful if you want to set an unknown S to empty - [r] would do that i think
00:11:50 <oerjan> and i cannot see any way to achieve that without [ ]
00:12:32 <oklopol> i believe all of those are correct
00:12:42 <oklopol> p was actually added after writing the program
00:12:54 <oklopol> or at least i implemented it after trying the program
00:13:02 <oerjan> mhm
00:13:55 <oklopol> and yes [] can basically just make S empty, unless it's the last loop
00:14:22 <oklopol> plus it can do io and other things not relevant to computational class
00:14:44 <oerjan> u(A{B}r seems like the way to do if-then
00:14:53 <oklopol> i thought i could change the semantics of [] to something like {} and {E} ending a loop
00:15:30 <oerjan> you're not specifying how E works with the rest of the commands, anyway
00:15:32 <oklopol> but changes can be made once someone makes some sense out of what currently exists
00:15:38 <oklopol> yeah i'm not
00:15:45 <oklopol> it's just useful for err
00:16:48 <oklopol> i mean it's just another set, so -(!-<>{B} will do B for exactly the set {{}}
00:17:05 <oklopol> not sure that's very useful
00:17:30 <oklopol> you can't currently remove it, so it's a bit special that way
00:17:46 <oerjan> oh, i assumed you could remove it explicitly...
00:17:47 <oklopol> but i could just add -E, -!E etc
00:17:55 <oklopol> well there isn't a command for that is there
00:18:10 <oerjan> hm i guess not, if E is not included in the <<<>>> syntax
00:18:22 <oklopol> it's not. i guess it should be
00:18:32 <oklopol> in fact i should definitely add it
00:18:51 -!- uorygl has quit (Ping timeout: 252 seconds).
00:19:27 <oerjan> otoh it's still interesting to see what can be achieved without E
00:20:23 -!- uorygl has joined.
00:20:24 <oklopol> the reason i didn't start fixing the language was i could only see it's nontrivial to show it's TC, but couldn't see any reason why it couldn't be
00:21:15 <oklopol> if that needs fixing
00:23:01 <oklopol> {^n }^n might be better numbers than ordinals btw
00:23:14 <oklopol> i haven't actually given that any thought either
00:23:38 <oklopol> well i suppose ordinals are nice because you can map over a number to do something that many times... sort of
00:25:28 <oerjan> there needs to be a way to do some other datastructures though
00:26:03 <oklopol> sure, but i have a hunch it'd be easier to encode them in integers...
00:26:23 <oerjan> i'm not sure you can actually do arithmetic, however
00:26:36 <oklopol> that's very possible
00:26:53 <oerjan> at least without a surrounding [ ]
00:27:06 <oklopol> i've been trying to find the parity of a number
00:27:17 <oklopol> but that seems impossible
00:27:27 <oerjan> basically without a [ ] there is no way to inspect arbitrarily deep within a set, i think
00:28:20 <oklopol> well ({} goes one deep, so you'll just get finitely deep if you use those nested
00:28:21 <oerjan> you can use [r] to "cut it off" at any level, however
00:29:33 <oklopol> i'm not sure i see what you mean
00:29:43 <oklopol> or maybe i do
00:29:51 <oerjan> replacing elements at some depth with empty sets
00:29:55 <oklopol> yeah
00:30:59 <oklopol> anyway [r-Er] would check parity if you had {} and {E} end a loop
00:31:13 <oerjan> ah
00:31:35 <oerjan> um no
00:31:45 <oklopol> oh it wouldn't?
00:31:47 <oklopol> err hmm
00:31:53 <oerjan> r never errors
00:31:59 <oklopol> oh err lol right
00:32:15 <oklopol> but assuming ordinals, we could do...
00:32:19 <oerjan> [r-!<>r] perhaps?
00:32:32 <oklopol> let's see
00:33:11 <oklopol> so umm
00:33:23 <oklopol> the r's will get the number to 0 anyways
00:33:32 <oklopol> the error set doesn't matter for that
00:33:40 <oerjan> hm
00:33:42 <oklopol> so you get it iff the first r gets you to 0
00:33:51 <oerjan> try [rr-!<>]
00:34:07 <oklopol> that's the same because {E}r = {E}
00:34:16 <oklopol> if you get my notation
00:34:29 <oklopol> that's also not specified :P
00:34:43 <oerjan> well i meant the last doesn't need specification
00:34:56 <oklopol> yes true
00:35:11 <oklopol> okay so yeah cool that'd work
00:35:47 <oklopol> but sort of a hack, i could just add a set called blerror set to get mod 3...
00:36:14 <oklopol> i mean
00:36:27 <oklopol> consider some (A{B} where [] occurs in B
00:37:24 <oerjan> hm that's the same as mapping all elements matching A to a constant, essentially
00:37:36 <oklopol> then the code after [] will have one of two sets, so the (A{B} can result in at most 2 different sets that replace the sets B is run on
00:37:53 <oerjan> er right with E stuff
00:37:54 <oklopol> yeah but two constants if you add the E thing
00:38:02 <oklopol> i'm just wondering if that changes anything
00:38:41 <oklopol> you basically filter with A, plus you can do something extra with some extra condition on the elems of A
00:38:44 <oerjan> you get one bit of information from a [ ]
00:38:55 <oklopol> yes
00:39:42 <oklopol> one thing that'd probably change things a lot is the following construct which i was thinking (once i'm convinced this thing doesn't have potential)
00:39:50 <oklopol> err and it goes
00:40:35 <oklopol> /A|B\ is like (A{B} but each B is run on the context S, in any random order
00:41:26 <oerjan> um you need the information of what element it is run for somehow...
00:41:35 <oerjan> *about
00:41:37 <oklopol> oh umm
00:41:49 <oklopol> actually i think i dropped that idea when i realized that
00:41:52 <oklopol> but forgot i dropped it
00:41:55 <oklopol> :P
00:41:56 <oerjan> ah
00:42:24 <oklopol> but anyway, something like that would be nice, because right now you just of a broken loop and map + filters.
00:42:34 <oklopol> then you'd have a reduce
00:43:22 <oerjan> hm what about just having a general loop with test
00:43:33 <oerjan> so /A|B\ is like while (A) B
00:43:34 <oklopol> oh umm
00:43:44 <oklopol> that's not a bad idea...
00:43:54 <oklopol> let's tell everyone it was mine
00:44:02 <oerjan> except B doesn't see the result of A, obviously
00:44:04 <oerjan> :D
00:44:14 <oklopol> hmm
00:44:52 <oklopol> S has some state, then A is run, and iff it results in nonempty, B is run on S... is there a problem with B not seeing the result?
00:44:55 <oerjan> or rather, the effect of A is always reverted apart from testing
00:45:36 <oerjan> no, that's what i mean, but B is run on the original S, not the one after A
00:45:41 <oklopol> i was thinking A runs with S, then if empty, S is returned, otherwise B is run on S, S is updated, and we repeat
00:45:44 <oklopol> yeah
00:45:53 <oerjan> right
00:46:22 <oklopol> so now you could return any amt of info
00:46:24 <pikhq>
00:46:43 <oerjan>
00:48:20 <oklopol> actually ([] could replace [] if there isn't a problem with that thing
00:48:45 <oerjan> you call this ([] ?
00:48:52 <oklopol> i could, then
00:49:00 <oerjan> i think empty A would be equivalent to []
00:49:13 <oklopol> yes, so also literally ([A] could replace [A]
00:49:58 <oklopol> and maybe []) for do while ;P
00:50:14 <oerjan> except that syntax is ambiguous, because (..[]..{...} is already legal
00:50:34 <oklopol> well it's not ambiguous if you drop [] altogether
00:50:40 <oerjan> (or hard to parse)
00:50:47 <oerjan> true
00:51:41 <oklopol> so anyway let's see if parity is a piece of cake with that thing
00:51:42 <oerjan> ([] and []) still seems ambiguous together
00:52:29 <oerjan> (r[r]), isn't it?
00:52:35 <oerjan> er, (r[r]
00:52:55 <oklopol> umm
00:52:56 <oerjan> er
00:53:03 <oklopol> no not with those semantics
00:53:06 <oerjan> (r[rr]
00:53:08 <oklopol> because A's result is just ignored
00:53:51 <oerjan> or possibly (rr[rr], if there is a difference
00:53:51 <oklopol> so while(n>=2){n-=2}
00:54:03 * ais523 reads up on Toi on the wiki
00:54:09 <oklopol> looks correct to me
00:54:11 <ais523> for some reason I find it easier to follow there than IRC
00:54:26 <oklopol> well the article is exceptionally well written
00:54:44 <ais523> yes, I like it when esolang articles do that
00:54:51 <ais523> and try to aspire to the same quality with mine
00:54:55 <oerjan> one is while(n>=2) the other is while(n>=3)
00:55:04 <oklopol> i was actually joking, but glad if you like it :P
00:55:09 <oerjan> or is that while(n>=1)
00:55:24 <oklopol> i just copypasted a page of keymaker's and changed everything to toi stuff :P
00:55:35 <oklopol> oerjan: who knows...
00:55:39 <oklopol> okay err
00:56:16 <oklopol> the loop ends if A gives you an empty set, so rr ends if n is of depth less than 3
00:56:30 <oklopol> because r decrements depth
00:56:38 <oklopol> by exactly one
00:56:40 <oerjan> 3 -> r -> 2 -> r -> 1 -> 0
00:56:48 <oerjan> argh
00:56:51 <oerjan> 3 -> r -> 2 -> r -> 1 -> r -> 0
00:57:23 <oerjan> (r[rr] will not halt on 2, while (rr[rr] will
00:57:39 <oklopol> 'will not halt on 2'?
00:57:42 <oerjan> so (rr[rr] could give 2,1 or 0 as result
00:57:47 <oklopol> oih
00:57:48 <oklopol> oh
00:58:10 <oerjan> so (r[rr] seems "correct"
00:58:21 <oklopol> (rr[rr] ~ while(depth>2){depth-=2}
00:58:30 <oklopol> err
00:58:39 <oklopol> so yeah
00:58:44 -!- ais523 has quit (Remote host closed the connection).
00:58:55 <oklopol> 0->0, and otherwise parity with 1/2 as output
00:59:14 <oerjan> hm, since there is only one set <<>> of depth 1, it will always return an ordinal even for non-ordinal input
00:59:29 <oklopol> a nice way to think about it is the loop ends iff S's depth is 0, and r will always decrement depth by exactly one
00:59:44 <oerjan> this will not hold for higher moduli
00:59:49 <oklopol> true
01:00:28 <oklopol> okay so how about addition
01:00:32 <oklopol> :P
01:00:36 <oerjan> argh
01:00:47 <oklopol> we need a tuple...
01:00:56 <oerjan> yes
01:01:36 <oklopol> there are probably standard ways to store this stuff in sets
01:01:48 <oklopol> 'probably'
01:01:59 <oerjan> yes, (x,y) = {x,{x,y}} but i don't think that is useable here
01:02:10 <oerjan> um
01:02:25 <oerjan> or (x,y) = {{x},{x,y}}
01:02:27 <oklopol> yes, i just realized there are relatively well-known formalisms based on sets.
01:02:37 <oerjan> i think one of them requires foundation, the other not
01:03:04 <oklopol> foundation = set has finite depth or something?
01:03:16 <oklopol> err
01:03:38 <oerjan> but neither can be used for our purposes, because we cannot detect which is {x} and which is {x,y} easily
01:03:47 <oerjan> ordinal depth
01:04:00 <oerjan> no infinitely descending chains of elements
01:04:17 <oklopol> so... set has finite depth?
01:04:21 <oklopol> oh
01:04:21 <oerjan> of course we do have finite depth
01:04:38 <oerjan> um
01:04:47 <oerjan> that was not an answer to your question
01:04:51 <oklopol> yeah those aren't the same thing
01:04:53 <oklopol> i know
01:04:58 <oerjan> but a comment on toi specifically
01:05:02 <oklopol> yes
01:05:47 <oklopol> but what about {^n }^n, then we could do {<>^n, {<>^m, <>^(m+1)}} and use the size of the sets to see which one is m
01:06:00 <oklopol> <>^n = {^n }^n
01:06:13 <oerjan> we cannot detect the size of a set
01:06:15 <oklopol> *do something like
01:06:20 <oklopol> well... no
01:06:32 <oklopol> but i mean err
01:06:41 <oklopol> in A, we can check if <> is in S, i think
01:06:43 <oerjan> at least not directly enough, we might be able to _after_ we solve this problem
01:06:57 <oklopol> so we just need to decrement the set that has two elems, and increment the other
01:07:10 <oklopol> this would be done with foreach
01:07:19 <oklopol> OR NOT
01:07:29 <oerjan> i was hoping for a pair construction that could contain more than just numbers
01:07:36 <oerjan> so it could be repeated
01:07:58 <oklopol> that would be nice, sure.
01:08:37 <oerjan> my idea is something like (x,y) = {{a,{x}}, {b,{x}}} where a and b are sets chosen specifically so we _can_ test for them
01:08:47 <oerjan> er
01:09:05 <oerjan> {{a,{x}}, {b,{y}}}
01:09:11 <oklopol> before i go along, can we solve the problem of checking if <> is in S for fun
01:09:25 <oklopol> i mean i don't see how to
01:09:34 <oerjan> except we may need to put more {} around x and y to distinguish them from a and b easily
01:09:40 <oerjan> ok
01:09:56 <oklopol> -!<> gives us the error set iff it's there, but currently E has no special properties that actually make that helpful
01:10:10 <oerjan> yeah so try without E
01:10:24 <oerjan> first step: turn every element _other_ than <> into <<>>
01:10:32 <oerjan> i think we can do that
01:11:07 <oklopol> ([([r]<>]
01:11:19 <oklopol> for every element: change to <>
01:11:21 <oklopol> ?
01:11:31 <oerjan> um you want { not [ somewhere there
01:11:40 <oklopol> oh whoops
01:11:46 <oklopol> ({([r]<>}
01:11:57 <oklopol> i love the unnested parens <3
01:12:40 <oerjan> um i think you miss one [
01:12:41 <oklopol> or umm am i confusing levels of depth there
01:12:54 <oerjan> also <> could be u instead
01:13:04 <oerjan> but i think both work
01:13:31 <oerjan> er wait
01:13:39 <oerjan> scratch that
01:13:51 <oklopol> if you run ([r] for some set, it will be emptied
01:13:58 <oerjan> ok i now official hate the unnested parend ;D
01:14:02 <oerjan> *ly
01:14:05 <oerjan> *parens
01:14:15 <oklopol> so ({ ([r] } gives you <<>> for all except <>
01:14:21 <oklopol> because it empties every element
01:14:23 <oklopol> of your set
01:14:38 <oklopol> hate is such a strong word
01:14:41 <oerjan> right
01:14:57 <oklopol> okay so now it should be trivial
01:15:01 <oklopol> we just remove <<>> first
01:15:03 <oklopol> -<<>>
01:15:08 <oklopol> and then we check for <>
01:15:13 <oklopol> with say -!<>
01:15:25 <oerjan> no, we don't want to use E :(
01:15:45 <oklopol> well that's what it's meant for, so ! makes sense
01:15:48 <oklopol> but hmm
01:16:02 <oklopol> i guess
01:16:03 <oklopol> there could be
01:16:05 <oklopol> <>
01:16:09 <oklopol> and -<>
01:16:12 <oklopol> and TOGGLE <>
01:16:17 <oklopol> that would serve the same purpose
01:16:19 <oklopol> maybe
01:16:30 <oerjan> i don't think we need that
01:16:36 <oklopol> ...which makes me realize we don't need to do *anything*
01:16:48 <oklopol> whether <> is there or not already makes A either say yes or no
01:17:12 <oklopol> so ({([r]}-<<>> should check for <>
01:17:15 <oerjan> i think you did miss one level of depth above, btw
01:17:53 <oklopol> it empties if <> is not in S, so we'd need to converse
01:17:55 <oklopol> i did?
01:18:02 <oklopol> in ({([r]}?
01:18:15 <oerjan> we are trying to check whether S _contains_ <>, not whether it _is_ <>
01:18:22 <oklopol> sure
01:18:43 <oklopol> ({([r]} maps ([r] over each element of S, so it turns every element of S to <>
01:18:43 <oerjan> that one changes every element of S to <>
01:18:55 <oklopol> which means if S is empty, then nothing happens, otherwise we get <<>>
01:18:56 <oklopol> oh
01:19:16 <oerjan> so what want to do is to apply that to every element of S
01:19:18 <oerjan> *we
01:19:43 <oerjan> ({({([r]}}
01:19:50 <oklopol> hehe
01:20:15 <oklopol> so ({({([r]}}-<<>>
01:20:19 <oerjan> yep
01:20:28 <oklopol> but...
01:20:31 <oerjan> and now we are left with either <> or <<>> as S itself
01:20:34 <oklopol> that's the negation of what we need
01:21:08 <oklopol> i mean i could add -([] tho, would fit the pattern
01:21:23 <oerjan> it shouldn't be hard to do a not though
01:21:51 <oklopol> okay so {<>} => {}, {} => {<>}
01:22:33 <oerjan> u({([r]}r
01:22:46 <oerjan> er wait
01:23:28 <oklopol> that's S => {S} => {<>} => {}, i think
01:23:49 <oerjan> u(-{([r]}r but not quite either
01:24:18 <oerjan> hm
01:24:21 <oklopol> (-{ is -({ ?
01:24:30 <oerjan> u(-{([r]u}rr maybe?
01:24:40 <oerjan> er right
01:24:47 <oerjan> u-({([r]u}rr
01:26:07 <oerjan> er
01:26:12 <oklopol> u-({([r]u}rr is... <> => <<>> => <<>> => <> => <> i think
01:26:27 <oerjan> u-({([r]uu}rr
01:26:30 <oklopol> -({} is for each nonempty
01:26:45 <oerjan> no, for each empty
01:26:49 <oklopol> argh yes
01:27:20 <oerjan> um wait
01:27:28 <oerjan> the [r] is redundant
01:27:28 <oklopol> <>, <<>>, <<<<>>>>, <<>>
01:27:32 <oklopol> yes
01:27:38 <oklopol> for each empty, and then you empty
01:27:42 <oerjan> *([r]
01:27:49 <oklopol> <<>>, <<<>>>, <>
01:27:54 <oklopol> nice
01:28:07 <oerjan> does this work now? :D
01:28:12 <oklopol> yes
01:28:14 <oklopol> i think so
01:28:18 <oerjan> u-({uu}rr
01:28:50 <oklopol> u-({uu}rr... inc depth, then if depth is exactly 2, inc depth by 2, dec depth by 2
01:29:07 <oklopol> so 1, 2, 4, 2
01:29:08 <oerjan> *exactly 1
01:29:09 -!- augur has joined.
01:29:17 <oklopol> 2, 3, 1
01:29:33 <oklopol> right i meant <> having depth 1
01:29:49 <oerjan> 0 is the usual i think
01:29:55 <oklopol> let's go with that
01:29:58 <oerjan> means ordinal has its own depth
01:30:03 <oklopol> right
01:30:33 <oklopol> so okay maybe back to the actual problem?
01:30:58 <oerjan> well if we append that not to what we had, we can test for element <>
01:30:59 <oklopol> or i'll collect the algo first
01:31:17 <oklopol> ({({([r]}} -<<>> u-({uu}rr
01:31:47 <oklopol> checks if <> is in S
01:31:55 <oerjan> although i have a hunch we might combine it more somehow
01:32:29 <oklopol> probably
01:34:06 <oklopol> so about this {{a,{x}}, {b,{y}}} you mentioned
01:34:19 <oerjan> ({([r]} is the equivalent of >0 in C it seems
01:34:28 <oklopol> umm
01:34:48 <oerjan> (as an anything -> 0,1 function)
01:35:12 -!- Tritonio_GR has joined.
01:35:24 -!- oklofok has joined.
01:35:52 <oerjan> 02:33 oerjan> ({([r]} is the equivalent of >0 in C it seems
01:35:52 <oerjan> 02:34 oklopol> umm
01:35:52 <oerjan> 02:34 oerjan> (as an anything -> 0,1 function)
01:35:59 <oklofok> damn
01:36:06 <oklofok> you missed my yes before you explained it
01:36:16 <oerjan> what yes
01:36:20 <oklofok> i said
01:36:20 <oklofok> umm
01:36:21 <oklofok> ys
01:36:24 <oklofok> *yes
01:36:27 <oerjan> heh
01:36:55 <oklofok> but yeah anyway are you sure you need to optimize that thing before we have a use for it?
01:37:20 <oerjan> er i'm not optimizing, just pointing out what that subroutine is
01:37:26 <oklofok> rrrright okay
01:38:05 <oklofok> i meant "<oerjan> although i have a hunch we might combine it more somehow", see it's starting to look like there's something to this thing, so tuples would be cooool.
01:39:08 -!- oklopol has quit (Ping timeout: 258 seconds).
01:39:15 <oerjan> let's say we make a = <>, b = <<>>, and add an extra {} around x and y so they are clearly of greater depth than either
01:39:40 <oerjan> then i think we should have a fighting chance of extracting x and y from it
01:40:55 <oklofok> so let's see, first of all is the idea {{<>, {x}},{<<>>, {y}}} and then ( end if x is zero [ decrement x, increment y ]
01:41:15 <oerjan> an _extra_ {} to x and y
01:41:24 <oklofok> so
01:41:39 <oklofok> {{<>, {{x}}}, {<<>>, {{y}}}}
01:41:48 <oerjan> yeah
01:42:06 <oklofok> okay actually this doesn't look all that hard
01:42:16 <oklofok> but let's see if the details are hard...
01:42:59 <oerjan> or wait
01:43:08 <oklofok> to decrement x, ( "check if contains <>" { rr and then you have x here }
01:43:25 <oerjan> {{<>, {{x}}}, {{y}}} might be enough
01:43:53 <oerjan> we don't need that <<>>, we can just reverse the test
01:44:09 <oerjan> erm
01:44:16 <oerjan> {{<>, {x}}, {{y}}} might be enough
01:44:31 <oerjan> (without <<>> that extra depth is one more than we need)
01:44:38 <oklofok> so to decrement x, how about ( "contains <>" { rr <> u }
01:45:02 <oerjan> sounds reasonable
01:45:39 <oklofok> so only {<>, {{x}}} triggers it and then it goes => {{x}} => {x} => {<>, x} => {{<>, x}}
01:45:40 <oklofok> so almost'
01:45:59 <oklofok> err
01:46:58 <oklofok> {<>, {{x}}} => r => {{x}} => <> => {<>, {x}}
01:47:12 <oklofok> where every second is an instruction
01:47:20 <oerjan> yeah
01:47:26 <oklofok> so to decrement x, ( "contains <>" { r <> }
01:47:58 <oklofok> inc y = ( "ain't contains <>" { u }??
01:48:01 <oklofok> can it be that easy
01:48:13 <oerjan> um
01:48:33 <oerjan> only if we use {{{{{...}}}} for numbers
01:48:40 <oklofok> oh right
01:48:44 <oerjan> but then yes
01:48:59 <oklofok> otherwise ua is succ, but you need to rr out the y first
01:49:09 <oerjan> yeah
01:49:38 <oerjan> anyway we are optimizing here using ur = nop
01:49:55 <oerjan> let's do an _arbitrary_ A on each
01:50:09 -!- augur has quit (Ping timeout: 252 seconds).
01:50:22 <oklofok> ah
01:50:53 <oerjan> for x, "contains <>" { rrr A uu <> }
01:51:14 <oklofok> the whole thing for this special case would be ( "remove sets not containing <>" "get x out" "check length" [ ( "contains <>" { r <> } ( "ain't contains <>" { u } ]
01:51:17 <oklofok> ?
01:51:35 <oerjan> erm what
01:51:51 <oklofok> well i just tried to get the addition algo out
01:52:15 <oklofok> the condition removes y, then gets x out of its tuple, and checks its length
01:52:24 <oklofok> all of which i believe we can do
01:52:57 <nooga> what is that?
01:53:08 <oklofok> *out of its set
01:53:13 <oklofok> well it's sort of a tuple
01:53:21 <oerjan> you mean for calculating (x,y) -> x+y ?
01:53:24 <oklofok> yes
01:53:44 <oklofok> then we'd have the result in y
01:53:52 <oklofok> nooga: <toi
01:53:55 <oklofok> *Toi
01:54:43 <oerjan> hm sounds reasonable
01:56:41 <oklofok> "remove sets not containing <>" = say -( "contains <>" {([r]} -<<>>
01:56:53 <oklofok> if it doesn't contain <>, then we make all its elements <>
01:56:54 <oklofok> err
01:57:15 <oklofok> not perfect but anyway it's clearly possible, i'm currently convinced anything trivial can be done
01:57:48 <oklofok> maybe if you add -<> it works
01:57:55 <oerjan> food ->
01:58:55 <oklofok> i fear ([] is not a one line parser change because of ({}... :<
01:59:25 <oklofok> maybe )[]!
01:59:28 <oklofok> :D
01:59:47 <oklofok> (A {B} C) [D]
02:00:09 -!- Asztal has quit (Ping timeout: 264 seconds).
02:00:19 <oklofok> i actually originally considered -- behold -- <{} for for each :D
02:02:41 <oklofok> ( "contains <>" { rrr A uu <> } runs X on {x} to get {y}, then uu => {{{y}}} => <> => {<>, {{y}}}
02:02:59 <oklofok> my other computer just bluescreened
02:03:06 <oklofok> i should probably consider doing some backups soon
02:04:03 -!- olsner has quit (Ping timeout: 258 seconds).
02:11:05 <oerjan> i am thinking this is probably TC now, even without the ([] extension
02:11:21 <oerjan> (we didn't actually use it for manipulating the pairs afaict
02:11:27 <oerjan> )
02:12:12 <oerjan> well it was used for the addition
02:12:19 <oklofok> without what extension?
02:12:35 <oerjan> (A[B] rather than just [B]
02:13:19 <oerjan> but we don't need addition for say a minsky machine, dec/inc is sufficient
02:13:29 <oerjan> and a minsky machine is just one large loop
02:14:05 <oklofok> so what's the rules exactly
02:14:36 <oklofok> finite amt of integers, and you have a finite amount of repeated rules like dec this inc this inc this if this is zero
02:15:20 <oerjan> it's a transition table of states like for a TM, technically
02:15:40 <oerjan> each transition a rule like you say
02:15:55 <oklofok> hmm alright
02:16:01 <oerjan> and two integers are enough, plus the state
02:16:17 <oklofok> the loop might be nice anyway
02:16:43 <oerjan> http://esoteric.voxelperfect.net/wiki/Minsky_machine
02:17:06 <oerjan> yeah if we want to do anything "practical"
02:17:21 <oerjan> and a loop would probably allow a more direct compilation of brainfuck into it
02:17:55 -!- olsner has joined.
02:17:58 <oklofok> yes
02:18:01 <oklofok> that'd be sweet
02:18:30 <oerjan> well ignoring IO as at present
02:18:49 <oklofok> i thought i'd add the optimization to the interp that every set ever used is actually cached, this will make ordinals usable
02:19:19 <oklofok> like you just have any given set in one place
02:19:25 <oerjan> ah
02:19:32 <oerjan> hash consing
02:20:50 <oklofok> i... think so
02:21:32 <oklofok> anyway for IO do you have better ideas? i don't really like p
02:22:36 <oerjan> bf-complete IO more or less requires byte representations
02:23:07 <oerjan> for binary IO
02:24:54 <oklofok> for hello world, you'd need 64 which requires a million universes to represent as an ordinal
02:25:19 <oklofok> errr 64?
02:25:53 <oklofok> anyway
02:26:02 <oerjan> O_o
02:26:50 <oerjan> hm without sharing you mean...
02:26:50 -!- augur has joined.
02:28:07 <oklofok> yes
02:28:26 <oklofok> redheads or brunettes
02:29:56 <oerjan> !haskell let sizes = scanl (+) 2 sizes in take 10 sizes
02:30:00 <nooga> he
02:30:09 <oklofok> ?
02:30:24 <oerjan> now what
02:30:25 <EgoBot> [2,4,8,16,32,64,128,256,512,1024]
02:30:29 <nooga> i was looking for a good optical raytracer that wouldn't cost $$$$$$$$$$$$$$$$$$$$$
02:30:35 <oerjan> ah just powers of 2
02:30:48 <nooga> and i realised that my only option is to write one
02:30:58 <oklofok> nooga: i could whip you one up in toi
02:31:13 <nooga> toi?
02:31:27 <oerjan> oklofok: 2^65 isn't _that_ big ;D
02:32:02 <oklofok> 2^65!
02:32:05 <oklofok> *?
02:32:10 <oklofok> i thought it'd be more like factorial
02:32:13 <oerjan> hm well H is 64+8 so 73
02:32:29 <oerjan> nah it seems it's powers of 2
02:32:40 <oklofok> huh.
02:32:41 <oerjan> <> <<>> <<><<>>> etc.
02:32:51 <nooga> what's toi?
02:32:59 <oklofok> nooga: the language
02:33:10 <nooga> which?
02:33:21 <oklofok> the one called toi!
02:33:25 <pikhq> All of them.
02:33:56 -!- olsner has quit (Ping timeout: 276 seconds).
02:34:15 <oerjan> nooga: oklofok is just joking, or possibly insane
02:34:30 <nooga> yea, i've noticed :D
02:34:34 <oerjan> (given what i've seen of toi so far)
02:34:49 <nooga> but i'm just curious about that toi
02:35:42 <oerjan> http://esoteric.voxelperfect.net/wiki/Toi
02:36:07 <oerjan> except the [A] command seems destined to be replaced with a more flexible (A[B] command
02:36:37 <oerjan> basically it's a language with finite sets
02:37:55 <nooga> lol
02:38:59 <oerjan> we suspect it is turing complete
02:43:25 <oerjan> (we can encode a pair of sets as <<<><x>><<y>>>, giving basic data structures to work with)
02:44:29 <Mathnerd314> just encode some other turing-complete language in it
02:45:00 <oklofok> we actually thought of that already
02:48:08 -!- olsner has joined.
02:48:55 <oklofok> okay so
02:49:31 <oklofok> oerjan: ([] and -([] or just ([]?
02:49:46 <oklofok> if we don't have -([] then -({} feels impure
02:49:59 <oklofok> hmm
02:50:01 <oerjan> -([] is probably convenient
02:50:54 <oerjan> and it fits with the rest
02:51:13 <oklofok> i'll add it, it's convenient and it's basically impossible it'd be TC with it and not TC without it.
02:51:25 <oklofok> yes
02:51:40 <oerjan> given that we already _know_ how to do a not, indeed
02:51:41 <oklofok> the interpreter change will have to wait till weekend because of my exam
02:51:47 <oklofok> well yes
02:53:33 -!- Mathnerd314 has set topic: #esoteric, the international hub for esoteric programming language design and deployment - #esoteric is not associated with the joke language Perl, please visit www.perl.org - logs: http://tunes.org/~nef/logs/esoteric/?C=M;O=D.
02:54:08 <pikhq> :)
02:54:39 <oklofok> should i just completely drop the error set?
02:54:46 <oklofok> doesn't really seem useful anymore
02:54:55 <oerjan> oklofok: actually we used -({} to construct not, so the same cannot be said for that one
02:55:15 <oklofok> yes, i did notice that
02:55:25 <Mathnerd314> oklofok: well, you haven't defined anything special for how the error set behaves
02:55:37 <oklofok> indeed i haven't
02:55:50 <oerjan> it's sort of a wart
02:55:53 <oklofok> i was going for the toggle behavior.
02:56:13 <oklofok> that you could remove <> or add it depending on whether it's there
02:56:18 <oklofok> or any other set
02:56:36 <oklofok> because that made it easy to check for some specific set
02:56:40 <oerjan> well it may still be awkward to test for sets other than <>
02:57:08 <oklofok> we should probably look into that
02:57:15 <oklofok> but i'll remove the error set for now
02:57:25 <oklofok> err
02:57:30 <oklofok> *for good
02:57:31 <oklofok> <.p
02:57:34 <oklofok> :P
02:57:59 <oerjan> down with evil errors!
02:59:28 <oklofok> http://esoteric.voxelperfect.net/wiki/Toi
02:59:39 <oklofok> the error set has been removed... sort of
03:00:07 <Mathnerd314> what happened to []?
03:00:17 <oklofok> it's been changed for convenience
03:00:22 <Mathnerd314> your example is no longer valid...
03:00:25 <oklofok> because addition was implemented with the new version
03:00:28 <oklofok> ah, true, thanks
03:00:59 <oklofok> fixd
03:01:01 <oklofok> i think
03:01:16 <oerjan> subtle, oklofok
03:01:52 <Mathnerd314> now I'm not following... ([ runs with the empty set?
03:02:06 <oklofok> okay i admit the explanation wasn't very good
03:02:07 <oerjan> Mathnerd314: basically the old [] could not be used to get much of any information _out_ of the loop
03:02:32 <oerjan> so it was hard to use it nested for anything other than clearing S
03:03:16 <oklofok> yes, so the conversation of ours invented a way to get something out of it
03:03:21 <oerjan> Mathnerd314: <> doesn't make S the empty set, it _adds_ the empty set as an element
03:03:35 <oerjan> (it is empty at the start)
03:03:42 <oklofok> oh was he confused about the example
03:03:55 <Mathnerd314> then why does <<>> add the set {{}}?
03:04:05 <oerjan> as an element, yes
03:04:22 <oklofok> <<>> adds {{}} to S, <> adds {} to S
03:04:37 <Mathnerd314> So, S={}, running <<>> gives S={{{}}}?
03:04:42 <oerjan> yeah
03:04:43 <oklofok> yes
03:04:49 <Mathnerd314> and S={}, running <> gives S={{}}
03:04:53 <oklofok> yes
03:04:55 <Mathnerd314> ok
03:05:19 <oklofok> oerjan: did we use all of rua up there btw?
03:05:25 <oklofok> are they all actually necessary
03:05:31 <oerjan> i don't think a is
03:05:35 <oklofok> i just took three random operations that seemed pretty
03:06:03 <oerjan> it's only necessary if you want to use von neumann ordinals
03:06:04 <Mathnerd314> oklofok == oklopol?
03:06:12 <oklofok> i'm oklo
03:06:15 <oklofok> yes
03:06:23 <oklofok> hmm right
03:06:46 <oklofok> it was actually a coincidence rua was exactly the successor and the precursor or whateversor
03:07:02 <oklofok> because i hadn't even thought of von neumanns at that point
03:07:04 <oerjan> oh
03:07:16 <oklofok> they just really were pretty operations.
03:07:31 <oerjan> there's one thing about a though - it's the only thing which copies information
03:07:43 <oerjan> but i'm not sure it does so in a useful way
03:08:13 <oklofok> like say you have x
03:08:18 <oklofok> and you want the tuple (x, x)
03:08:23 <oklofok> is that possible
03:08:39 <oerjan> i'm not sure and actually doubt it
03:08:41 <oklofok> hmm
03:08:46 <Mathnerd314> so, in Von Neumann, 0=<>, 1=<0>, 2=<0,1>, 3=<0,1,2>, etc.?
03:08:52 <oerjan> Mathnerd314: yes
03:09:22 <Mathnerd314> you might, instead of e, just have 0 1 2 etc.
03:09:37 <oklofok> i considered that
03:09:37 -!- olsner has quit (Read error: Operation timed out).
03:09:52 <Mathnerd314> or just remove e
03:10:07 <Mathnerd314> (since by definition it's just <>)
03:10:12 <oklofok> it's just a shorthand that accompanied the error set for fun.
03:10:19 <oklofok> eEeEEe
03:10:21 <oklofok> anyway
03:10:23 <oerjan> i think we actually forgot we had e in the above discussion
03:10:25 <oklofok> yes, it's useless
03:10:28 <oklofok> yeah
03:11:09 <Mathnerd314> maybe define error set = <error set> ?
03:11:18 <oerjan> heh
03:11:43 <oerjan> that would make ([r] an infinite loop, though
03:12:18 <Mathnerd314> that's the point of turing-completeness :-)
03:12:27 <oerjan> although we could do ([-Er] instead
03:12:42 <oerjan> (assuming E was made set notation)
03:13:04 <oerjan> Mathnerd314: not particularly, it's a trivial loop
03:13:18 <oerjan> turing-completeness requires undetectable ones
03:13:28 <Mathnerd314> ok, see you later
03:13:39 <oklofok> x >> u >> {x} >> <> >> {x} <> >> u >> {x <>} >> a >> {x <>} x <> >> -<> >> {x <>}, x >> u >> {{x <>} x}
03:13:59 <oerjan> bye Mathnerd314
03:14:17 <oklofok> so doesn't that get you from x to the tuple (x, x)
03:14:24 <oklofok> given some extra wrapping in the beginning
03:14:28 <oerjan> wait what
03:14:38 <oklofok> notation may be a bit confusing
03:14:41 <oklofok> at least
03:14:59 <oerjan> you mean wrong ;D
03:15:19 <oklofok> i don't think so, but do explain
03:15:27 <oklofok> x means S = {x}
03:15:37 <oklofok> every second is S, every second is an operation
03:15:47 <oerjan> oh well
03:16:16 <oklofok> i believe that works
03:16:36 -!- nooga has quit (Ping timeout: 264 seconds).
03:16:39 <oklofok> you should too
03:16:49 <oklofok> please believe :<
03:17:03 <oerjan> if i can wrap my head around that {x <>} >> a >> {x <>} x
03:17:08 <oklofok> oh and bye mathnerd
03:17:22 <oklofok> there's a <> in the end
03:17:28 <oklofok> {x <>} >> a >> {x <>} x <>
03:17:32 <oerjan> oh
03:17:53 <oklofok> >> is not the best notation maybe.
03:18:18 <oerjan> that's not the hard part
03:18:25 <oklofok> oh than what is
03:18:40 <oerjan> your weird set notation with contatenation
03:18:41 <oklofok> *then
03:18:49 <oerjan> let me untranslate it
03:18:55 <oklofok> i just drop <> around S...
03:19:37 <oerjan> {{x,{}}} >> a >> {{x,{}},x,{}}
03:19:43 <oklofok> yes
03:19:49 <oerjan> ok it seems correct there
03:19:50 -!- MizardX has quit (Ping timeout: 260 seconds).
03:20:00 <oklofok> my notation was prettier :)
03:20:40 <oerjan> heh
03:20:50 <oklofok> i just realized by accident that changing [] to ([] might actually make my parser *shorter*
03:20:58 <oklofok> i
03:21:06 <oklofok> i'm still not gonna do it now but anyway
03:21:44 <oerjan> ?
03:21:51 <oklofok> nevermind that
03:22:17 <oklofok> actually
03:22:41 <oklofok> having {} around S is nice because you can't confuse S with instructions
03:22:42 <oerjan> ok i believe you can get (x,x) that way
03:22:47 <oklofok> thanx
03:22:58 <oklofok> if you use {} for S and <> for instrs
03:22:59 <oerjan> although some wrapping care is needed
03:23:09 <oerjan> as you said
03:23:24 <augur> yeah!
03:23:27 <augur> we got chris barker!
03:25:20 -!- olsner has joined.
03:29:09 -!- coppro has joined.
03:31:40 <oklofok> augur: i'm happy for you people
03:31:59 <augur> you should be!
03:32:03 <augur> semanticist AND esolanger!
03:32:08 <augur> right here are our university!
03:32:48 <oklofok> a guy at uni is an esolanger as well
03:32:57 <oklofok> sort of
03:34:16 -!- Tritonio_GR has quit (Read error: Connection reset by peer).
03:37:10 <augur> yes well
03:37:13 <augur> barker invented Iota
03:37:15 <augur> and is a prof
03:37:16 <augur> so
03:37:41 <oklofok> he invented the combinator itself?
03:41:30 <Mathnerd314> oklofok: idea: add variables/functions to the language with =
03:41:44 <oklofok> no!
03:41:52 <Mathnerd314> like e=<>
03:41:54 <oklofok> the whole idea is that you can only do stuff to the global set S
03:42:10 <oklofok> well how exactly?
03:42:27 <Mathnerd314> well, it's just textual substitution
03:43:23 <oklofok> the whole beauty is the you can't access any individual object directly, you can just do an operation on all objects individually
03:43:46 <oklofok> well if it's done in such a way that it's convenient but essentially useless, then i might consider it
03:44:02 <oklofok> like numbers would be
03:44:13 <Mathnerd314> yeah; that's all I'm thinking of
03:44:31 <oklofok> if you can actually use letters as storage, sort of as another S, then noo
03:45:05 <Mathnerd314> maybe it's more like program-abbreviation
03:45:43 <Mathnerd314> but yeah, shouldn't change anything about turing-completeness or whatever
03:46:39 <oklofok> hmm umm i'm not convinced
03:46:50 <Mathnerd314> I'm guessing you should be able to define some of r, a, or u in terms of the others
03:47:21 <oklofok> with or without loops?
03:47:45 <Mathnerd314> with loops
03:47:51 <oklofok> then i believe oyu
03:47:53 <oklofok> *you
03:48:01 <Mathnerd314> your language has no meaning for <r>, right?
03:48:08 <oklofok> nnope
03:48:56 <Mathnerd314> that - is weird, then
03:49:15 <Mathnerd314> no real semantics
03:49:26 <oklofok> huh?
03:49:28 <Mathnerd314> pay no attention to me ;-)
03:49:30 <oklofok> - what
03:49:57 <oklofok> well i'll pay no attention to that last suggestion
03:50:03 <oklofok> compromise
03:50:38 <Mathnerd314> as an example: tuple=u<>ua-<>u
03:50:47 <Mathnerd314> you can write <> tuple
03:51:00 -!- coppro has quit (Remote host closed the connection).
03:51:23 <oklofok> oh you meant subroutines
03:51:31 <Mathnerd314> well, they aren't
03:51:57 <oklofok> well macros whatever, what i meant is oh not variables that contain sets
03:51:57 <Mathnerd314> because you just run it as <> u<>ua-<>u
03:52:07 <Mathnerd314> well, they do contain sets
03:52:14 <oklofok> but variables that contain programs
03:52:20 <Mathnerd314> like foo=<<<<>>>>
03:52:30 <oklofok> they can contain sets if they can contain programs, yes
03:52:38 <Mathnerd314> but yeah, it's not a real set, it's a program meaning "add this set to S"
03:53:09 <oklofok> that sounds like a better idea than having variables that contain sets.
03:53:10 <oklofok> but
03:53:43 <oklofok> this is always a bit of a subtle issue
03:53:50 <oklofok> macros make the language less pure
03:53:53 <oklofok> but programs nicer
03:54:14 <oklofok> the thing is you could easily just have the macros from some other preprocessor
03:54:51 <oklofok> but then you could only actually show the obfuscated substituted in programs as toi programs, because the macros aren't part of the lang
03:55:17 <Mathnerd314> yeah, it's a definite choice
03:55:19 <oklofok> i'll probably not add macros, and someone can make a derivative with macros WHEN it becomes popular.
03:55:26 <Mathnerd314> heh :-)
04:00:48 <oerjan> !
04:01:21 <oklofok> i should put clue on the wiki too given all this ATTENTION. except there's no mystery in clue so at least oerjan won't be interested
04:01:52 <oerjan> indeed, completely obvious
04:02:52 <oerjan> u-<<>>r
04:03:02 <oerjan> not without -({}
04:03:22 <oerjan> oh wait
04:03:26 <oerjan> u-<<>>
04:04:26 <oklofok> what are you doing
04:04:41 <oerjan> writing not...
04:05:03 <oerjan> to show that -({} is actually redundant
04:05:49 <oerjan> now more generally
04:07:02 <oerjan> u({([r]<>}-<<>>
04:07:44 <oklofok> u({...} ~ ...u?
04:08:08 <oerjan> no
04:08:21 -!- Gracenotes has joined.
04:08:24 <oerjan> ({...} runs on non-empty elements
04:08:38 <oklofok> right, we did this already
04:08:44 <oklofok> i don't learn that fast.
04:09:42 <oerjan> it turns every non-empty element into <<>>, so they can be removed
04:09:45 <oklofok> but yeah i think that's a correct not
04:11:11 <oklofok> S => {S} => {{{}}} => {} if S was nonempty
04:17:26 <bsmntbombdood> your FACE is nonempty
04:17:40 <oklofok> xDSSA
04:18:24 <oklofok> that's one reverse-ass smiley
04:21:02 <oerjan> stop mooning bsmntbombdood, oklofok
04:21:52 -!- bsmntbombdood has quit (Ping timeout: 246 seconds).
04:27:40 -!- Oranjer has left (?).
04:47:22 -!- zzo38 has joined.
04:47:36 -!- Gracenotes has quit (Read error: Connection reset by peer).
04:48:50 <zzo38> I have idea more to add to GCC __builtin_ functions/commands, including:
04:49:04 <zzo38> (all starting with __builtin_ prefix (or a different prefix))
04:49:25 <zzo38> _fastest { code } else { code } optimizer selects faster code.
04:49:36 <zzo38> _smallest same as _fastest but selects smallest code.
04:49:48 <zzo38> _assume(expr) makes optimizer assume expr is true even if it isn't.
04:49:56 <pikhq> Optimizer does not know what's fastest.
04:50:31 <oklofok> but maybe it could compile into a program that runs both and returns the result of the one that ran faster
04:50:53 <zzo38> pikhq: No, it would guess what's fastest
04:51:04 <pikhq> Yeah, that's feasible if it's possible to run the relevant snippets independently.
04:51:06 <zzo38> But either way, _smallest would still work
04:51:21 <pikhq> Yeah, _smallest is pretty easy.
04:51:26 <pikhq> Compile both, compare code size.
04:52:30 -!- coppro has joined.
04:52:35 <zzo38> And if you wrote, _assume(x==5); x+=1; then, it would compile x=6; instead if and only if x=6; is considered better in the current optimizer mode.
04:54:29 <zzo38> I don't know how well that would work, or if you would instead need multiple kind of _assume commands such as _assume_equal and so on.
04:54:45 <pikhq> _assume would work pretty well.
04:54:58 -!- Gracenotes has joined.
04:55:11 <pikhq> The optimisers already have a bunch of assumptions that they do that sort of thing with.
04:55:35 <pikhq> For instance, GCC assumes that a pointer cannot be NULL if it was previously dereferenced.
04:55:50 <zzo38> You can write: __builtin_assume(x==5); y=__builtin_constant_p(x); y will now be 1 if the optimizer is turned on.
04:59:03 <zzo38> Also a way to remove assumptions, with codes such as: __builtin_fake { p=__builtin_anything(); }
04:59:34 <zzo38> And now it will get rid of assumptions about "p" because it now assumes p could be anything.
05:01:19 <Sgeo> pikhq, wasn't there a security hole related to that?
05:03:49 <pikhq> Sgeo: In Linux.
05:03:54 <pikhq> Where that assumption is false.
05:03:56 <zzo38> What security hole do you mean? Probably it might be possible that there is such security holes. But I would like to know what security hole
05:04:15 <Sgeo> How did that assumption manage to be false?
05:04:35 <pikhq> Sgeo: In kernel-space, NULL might be a valid address.
05:04:42 <pikhq> Meaning that it is entirely valid to dereference it.
05:04:47 <Sgeo> Ah
05:05:09 <pikhq> (this is actually true in user-space with mmap, but *you will be shot* for doing so.)
05:05:36 <oerjan> linux execution squad
05:05:57 <Sgeo> Going to go eat now
05:06:56 <zzo38> Yes, of course it very well could be a valid address, but if that is the case you would probably not use functions such as strlen() with it, anyways. You might do *(char*)0=0xFE;
05:08:54 <pikhq> The exploit resulted from mmaping some space at NULL, then passing it to a system call that had a minor bug that *could* cause it to jump to arbitrary space.
05:09:37 <Sgeo> mmap?
05:09:38 <zzo38> Also, how do you figure out what the numeric type of a same size as a pointer address is?
05:09:42 <pikhq> *Normally*, it could only cause a jump into other bits of kernel space, but because a NULL check was being ignored, it managed to instead jump into a bit of user space.
05:09:52 <pikhq> zzo38: uintptr_t
05:10:00 <zzo38> pikhq: OK
05:10:17 <pikhq> Sgeo: mmap is a slightly odd and very flexible system call.
05:10:38 <pikhq> It allows you to lazily allocate memory, map a file into memory, and do a few other oddball things.
05:10:47 <zzo38> pikhq: Perhaps that is why you need to have such a command as __builtin_fake { p=__builtin_anything(); } so that you can stop ignoring such checks even in optimizer mode
05:10:47 <pikhq> You can request an address for it to map to.
05:11:08 <pikhq> zzo38: Command line option, actually.
05:11:14 <pikhq> Linux now builds with it.
05:12:09 <coppro> mmap is awesome
05:12:16 <zzo38> But what if you want to change all of the optimizer modes on each individual line of a code?
05:14:47 <pikhq> I beat you to death with a baseball bat.
05:15:29 <zzo38> My idea is that, the instruction __builtin_anything() the optimizer would assume that its return value could be anything, but it is an error for the __builtin_anything() instruction to actually be compiled into the executable (unless the optimizer can determine that the part of the code referencing __builtin_anything() can never actually get executed, such as: {return; __builtin_anything();} )
05:22:49 <zzo38> If GCC assumes a pointer cannot be NULL if it was previously dereferenced, can you check that with the __builtin_constant_p function?
05:23:07 <zzo38> (such as: __builtin_constant_p(!ptr))
05:25:19 <pikhq> I dunno.
05:26:01 <zzo38> Perhaps I can check what the compiler does (I do have GCC on this computer)
05:29:41 <zzo38> No, that doesn't seem to work. But this does work: x=1; __builtin_constant_p(x);
05:30:41 -!- sebbu2 has joined.
05:31:13 -!- sebbu has quit (Ping timeout: 260 seconds).
05:31:13 -!- sebbu2 has changed nick to sebbu.
05:34:41 <zzo38> Can this work: #define lengthof(_1) (sizeof(_1)/sizeof(typeof(*_1)))
05:34:50 <zzo38> And this: #define FORCE_CONSTANT(_1) __builtin_choose_expr((_1),(_1),(_1))
05:35:06 <pikhq> Yes and WTF?
05:35:24 <pikhq> (that's two answers, BTW)
05:36:09 <pikhq> Also, (sizeof(_1)/(sizeof(*_1)) should work.
05:36:20 <pikhq> Also, only (obviously) works right for actual arrays.
05:36:26 <pikhq> No pointers to chunks of memory.
05:36:43 <zzo38> Well, yes, obviously. It is meant for arrays, of course.
05:36:49 <coppro> zzo38: Is this C or C++?
05:36:54 <zzo38> C
05:37:01 <zzo38> And it is GNU C, to be specific
05:52:01 <zzo38> #define RANGE_X3(_1,_2,_3) (_1(_3 0)_2),(_1(_3 1)_2),(_1(_3 2)_2)
05:52:10 <zzo38> #define RANGE_X6(_1,_2,_3) RANGE_X3(_1,_2,_3),RANGE_X3(_1,_2,3+_3)
05:52:59 -!- augur has quit (Ping timeout: 245 seconds).
05:55:11 <zzo38> Is there a way to make pipes loop in Linux, so that the output of the last command in a pipeline sent to the input of the first command?
05:55:28 -!- augur has joined.
05:56:52 <pikhq> Yes, but it's a pain.
05:57:00 <pikhq> I suggest named pipes.
05:59:38 <zzo38> Does any shell support the following way of doing it like: |nc example.org 1323|tr A-Z a-z|
05:59:55 <zzo38> Perhaps if I get computer I can put Linux, I can write the shell like that
06:00:20 <zzo38> So if you put | at the beginning and another at the end of the command-line it will do loop like that
06:00:22 <pikhq> Could add it to zsh.
06:00:40 <pikhq> (it's the Emacs of shells already. Would fit nicely.)
06:02:19 <zzo38> I do know a few things about Zsh, it seems better for code-golf than bash is
06:03:02 <coppro> I'd suggest Perl, but IO is actually a pain in Perl
06:03:08 <coppro> one of the few things it's bad at
06:03:52 <coppro> pikhq: hmm... couldn't you do it with while true; do
06:04:13 <coppro> *while true; do foo=$(really <<<"$foo" | long | pipe | here); done
06:04:33 <pikhq> coppro: No, because shell is not lazy.
06:04:40 <coppro> that's what I'm relying on
06:05:04 <pikhq> Well, you're relying on nonexistent semantics.
06:05:09 <pikhq> Stop doing it.
06:05:21 <coppro> why are they nonexistent?
06:05:29 <pikhq> Because they are.
06:05:52 <coppro> the variable is substituted into the command, then the command is executed, then the output from the command is assigned to the variable
06:06:00 <coppro> if you are really afraid of that, you could always use two variables
06:06:33 <pikhq> And then you'd see how wrong you are about how this is working.
06:06:42 <coppro> uh
06:06:49 <coppro> why?
06:06:55 <pikhq> (namely, it isn't)
06:07:13 <pikhq> You set foo to the result of a command depending on foo.
06:07:24 <coppro> yes. And I just said you could use two variables
06:07:26 <pikhq> In order to get the result of that command, you must know the value of foo.
06:07:44 <pikhq> In order to get the value of foo you must get the result of that command.
06:07:56 <coppro> while true; do foo="$(<<<"$bar" pipe | line | goes | here)"; bar="$foo"; done
06:08:18 <pikhq> Technically works, but I hate you.
06:08:25 <coppro> you're welcome
06:08:33 <coppro> testing on dash
06:08:38 <pikhq> And has quite different semantics from a proper pipe.
06:08:48 <coppro> that much is true
06:10:08 <coppro> eh, dash can't handle the syntax
06:10:12 <coppro> so no way to test
06:10:52 <coppro> wait, got it. It works there too
06:11:07 <zzo38> In Anarchy Golf there is only one file in a current directory, which is the program itself, which means you can write a (cheating) quine 2-bytes in Zsh
06:14:33 -!- jcp has quit (Quit: I will do anything (almost) for a new router.).
06:15:21 -!- jcp1 has joined.
06:15:24 <zzo38> http://golf.shinh.org/reveal.rb?Quine/zzo38%28cheat%29_1269737774&zsh
06:15:51 <pikhq> :)
06:22:24 -!- jcp1 has changed nick to jcp.
06:32:37 -!- augur has quit (Ping timeout: 265 seconds).
06:39:10 -!- oerjan has quit (Quit: Good night).
06:43:49 <zzo38> Do you like to invent spells in D&D game?
06:44:15 <coppro> what?
06:44:57 <pikhq> No, tend to come up with very inventive ways of using spells in D&D instead.
06:44:59 <zzo38> Like, invent new spells for use in D&D game.
06:45:14 <pikhq> (presuming you mean D20 system)
06:45:22 <zzo38> Here are some of the ones I have done, if you are interested: http://zzo38computer.cjb.net/dnd/options/ (I cannot figure out what name I should give the _1 spell)
06:45:32 <zzo38> (_1 is just a temporary name)
06:46:08 <zzo38> I especially like the Object_Mirrored.s spell that I invented.
06:46:09 <coppro> ah, no, I do not
06:46:51 <zzo38> Do you know what name I should give to _1.p
06:46:56 <coppro> zzo38: where are you from?
06:47:28 <zzo38> coppro: Is that relevant? Check my IP address
06:49:27 <zzo38> Also, which D&D characters have you played (race/class/spells/etc)
06:49:47 <coppro> I have never really played :/
06:49:50 <coppro> only DMed
06:50:07 <coppro> also kept a book collection far larger than it should be
06:50:24 <pikhq> Most recently I played a barbarian bard cleric druid fighter monk paladin wizard warlock gestalted with soulblade.
06:50:33 <zzo38> coppro: OK, what campaigns, then? And what players have been
06:50:38 <pikhq> It was a very, very silly run through Tomb of Horrors.
06:50:46 <pikhq> Oh. And level 9.
06:50:56 <zzo38> pikhq: OK, what race and what spells?
06:51:11 <pikhq> zzo38: Human, and I actually didn't bother with a spelllist.
06:51:33 <zzo38> pikhq: Then how do you know what spells if you don't spells?
06:51:33 <coppro> zzo38: Is that relevant? Check my IP address
06:51:49 <pikhq> zzo38: Level 1 spells at level 9?
06:52:05 <zzo38> coppro: How am I supposed to figure out that from your IP address, and of course it is relevant, isn't it?
06:52:12 <pikhq> Screw that shit. Scrolls of level 9 spells.
06:52:13 <coppro> well, it might be
06:52:13 <zzo38> pikhq: Any level spells, whatever level spells you have
06:52:16 <pikhq> (there went *all* his cash)
06:53:09 <pikhq> Uh. Magic missile?
06:53:27 <zzo38> That's a common one. I never selected that spell, however.
06:53:36 <pikhq> It'
06:53:43 <pikhq> s probably the best level 1 spell.
06:53:57 <pikhq> I note that it is very, very, *very* hard to avoid damage from it.
06:54:22 <pikhq> No save, no AC, and almost nothing has DR against force.
06:54:44 <coppro> zzo38: use Swap Eye on itself
06:54:45 <zzo38> Maybe it is, but I don't like it much. I nearly always select spells that do not do any damage
06:55:03 <pikhq> You, sir, are probably playing very poor casters.
06:55:04 <zzo38> coppro: You can't, that's a feat and it can not be applied to feats
06:55:09 <coppro> zzo38: OH
06:55:13 <coppro> I get it now
06:55:15 <coppro> c s f
06:55:17 <pikhq> If you get clever you can do 1-shot nukes. :P
06:55:21 <coppro> hmm... the mirroring spell is a great way to kill someone
06:55:42 <pikhq> It gets... Much, much, *much* scarier with a good psion/wizard build.
06:56:14 <zzo38> pikhq: Actually I try never to do damage I try to win without damage or kill, whenever possible because I play good-aligned characters, that's why
06:56:40 <pikhq> zzo38: "Good-aligned" does not mean "cannot damage or kill" you know.
06:57:01 <pikhq> BTW, might I suggest looking into non-lethal damage? :P
06:57:17 <zzo38> pikhq: I know that, but that is one way to be good-aligned even if not the only way, and of course there are a few exceptions
06:57:23 <zzo38> And yes, I do understand non-lethal damage
06:57:50 <coppro> zzo38: the _1 sounds like a confession?
06:58:26 <zzo38> But what I like to do is to trick the opponent in different ways sometimes
06:58:54 <zzo38> coppro: The _1 is almost likea confession, I guess. Not quite, but still, I don't know the name?
06:59:03 * pikhq is still proud of geasing the drow race.
06:59:20 <coppro> zzo38: I think 'confession' or something similar should be in the name
06:59:30 <zzo38> coppro: OK, that's an idea
07:01:33 -!- augur has joined.
07:02:12 <zzo38> My character has no magic items except for harp (the magic gives it +2 Perform) (we are members of Harper, this is the campaign)
07:02:27 <zzo38> My brother's character doesn't have many either, but he has no harp
07:03:07 -!- Gracenotes has quit (Read error: Connection reset by peer).
07:04:49 -!- Gracenotes has joined.
07:06:40 -!- tombom has joined.
07:07:30 <zzo38> The kind of trick I do is, one of them is as follows: Metamorphosis into human of the size to wear the unform so we can disguised as the army, steal the scroll, hide behind the tent, dismiss metamorphosis, dark, web, wait for wizard to attempt to dispel darkness (my brother's character helped to tell when), just before was doing, teleport away, leaving a crystal and the clothes in the area.
07:08:43 <zzo38> This really confused everyone. Everyone now believes lies... Someone thought the wizard did it but the wizard said they did nothing. And the tent teleported into turned out to be the toilet tent and the people inside thought my character was a big cockroach. After they get out to tell someone, I hide and then they look and see there is nothing in there!
07:09:13 <zzo38> Someone thought the soldier must be crazy, someone thought they must be running around naked, someone thought they must have turned into a crystal... See, it works.
07:11:06 <pikhq> Ah, the *other* useful half of a wizard's spell list.
07:11:08 <pikhq> Being fucking Batman.
07:11:09 <pikhq> :P
07:12:23 <zzo38> (The soldier they were talking about was actually in jail by then, but the other soldiers did not know that.)
07:13:00 <zzo38> What does it have to do with Batman? (I don't know about Batman very well, actually)
07:14:27 <pikhq> Batman, much like a wizard, can quite reasonably defeat anyone given prep time.
07:15:38 <pikhq> Ready for *everything*.
07:16:04 <zzo38> Now we need to send a forged note to the army. However, I have a different idea: Write a forged note to the emperor of the army (the note I stole was to send to emperor), that will make the emperor send a note to the army of the way I want. (No magic needed here.)
07:18:42 <zzo38> In fact, about half the time we need no magic, just paper or speech or even just a wood box might just do
07:20:13 <tombom> this doesn't sound like the world i know
07:20:16 <tombom> i'm scared
07:22:48 <zzo38> If I actually *do* need to damage someone, I suppose I can just bite (and poison) them, but that is hardly ever needed. Usually we can win without harming anyone. In fact, at least one time we won by *healing* the opponents instead.
07:23:59 <zzo38> Mostly the bite is just used as a threat of eating them if they do not comply.
07:24:35 <zzo38> (I don't actually have a high enough attack bonus to effectively use it most of the time anyways.)
07:24:38 -!- jcp has quit (Quit: I will do anything (almost) for a new router.).
07:25:09 <pikhq> tombom: 魔法がある世界。なぜ知らないか。(も、人々は日本語で話す世界。)
07:25:11 <zzo38> (And I don't care; because I don't need a high attack bonus. It is OK if this misses 80% of the time)
07:29:06 <zzo38> Or, of course, my brother's character, he is a ninja and can use sudden strike. He prefers to fight a lot
07:29:55 <pikhq> GAH
07:30:21 <zzo38> pikhq: There are rules how to resolve them
07:30:48 <pikhq> zzo38: No, the Grand Melee variant introduces actual race conditions.
07:31:03 <zzo38> pikhq: OK. Sorry I thought you meant standard rules
07:31:07 <pikhq> What's relevant is the existence of multiple stacks.
07:31:13 <pikhq> Which function concurrently.
07:31:31 <zzo38> The Grand Melee variant does have actual race conditions
07:33:34 <pikhq> Fun fact: spell resolution is not atomic.
07:35:17 -!- zzo38 has quit (Remote host closed the connection).
07:50:21 -!- tombom has quit (Quit: Leaving).
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:13:35 -!- Sgeo_ has joined.
08:15:29 -!- Sgeo has quit (Ping timeout: 245 seconds).
08:22:01 -!- augur has quit (Remote host closed the connection).
08:22:11 -!- augur has joined.
08:24:25 -!- Sgeo has joined.
08:26:41 -!- Sgeo_ has quit (Ping timeout: 265 seconds).
08:30:12 -!- lament has joined.
08:34:57 -!- Gracenotes has quit (Read error: Operation timed out).
08:35:52 -!- augur has quit (Remote host closed the connection).
08:35:57 -!- augur has joined.
08:35:58 -!- Slereah has quit (Ping timeout: 246 seconds).
08:41:35 -!- Slereah has joined.
08:53:45 -!- Gracenotes has joined.
08:54:08 -!- lament has quit (Quit: lament).
09:03:25 -!- Gracenotes has quit (Ping timeout: 258 seconds).
09:15:36 -!- Gracenotes has joined.
10:34:00 -!- FireFly has joined.
11:04:30 -!- Slereah has quit (*.net *.split).
11:04:31 -!- dbc has quit (*.net *.split).
11:04:31 -!- fizzie has quit (*.net *.split).
11:04:31 -!- AnMaster has quit (*.net *.split).
11:04:32 -!- augur has quit (*.net *.split).
11:04:32 -!- Mathnerd314 has quit (*.net *.split).
11:04:32 -!- pineapple has quit (*.net *.split).
11:04:32 -!- fungot has quit (*.net *.split).
11:04:33 -!- myndzi\ has quit (*.net *.split).
11:04:34 -!- oklofok has quit (*.net *.split).
11:04:34 -!- iamcal has quit (*.net *.split).
11:04:34 -!- comex has quit (*.net *.split).
11:04:34 -!- jix has quit (*.net *.split).
11:04:34 -!- Leonidas has quit (*.net *.split).
11:04:35 -!- coppro has quit (*.net *.split).
11:04:35 -!- uorygl has quit (*.net *.split).
11:04:35 -!- ineiros has quit (*.net *.split).
11:04:35 -!- Sgeo has quit (*.net *.split).
11:04:35 -!- Quadrescence has quit (*.net *.split).
11:04:35 -!- olsner has quit (*.net *.split).
11:04:36 -!- rodgort has quit (*.net *.split).
11:04:36 -!- SimonRC has quit (*.net *.split).
11:04:36 -!- mtve has quit (*.net *.split).
11:04:36 -!- lifthrasiir has quit (*.net *.split).
11:04:36 -!- cheater2 has quit (*.net *.split).
11:04:36 -!- mycroftiv has quit (*.net *.split).
11:04:36 -!- sshc has quit (*.net *.split).
11:04:36 -!- Gregor has quit (*.net *.split).
11:04:37 -!- yiyus has quit (*.net *.split).
11:04:38 -!- Deewiant has quit (*.net *.split).
11:04:38 -!- FireFly has quit (*.net *.split).
11:04:39 -!- HackEgo has quit (*.net *.split).
11:04:39 -!- EgoBot has quit (*.net *.split).
11:04:39 -!- Geekthras has quit (*.net *.split).
11:04:39 -!- wareya has quit (*.net *.split).
11:04:39 -!- chickenzilla has quit (*.net *.split).
11:04:40 -!- Ilari has quit (*.net *.split).
11:05:45 -!- Adrian^L has quit (Read error: Connection reset by peer).
11:06:42 -!- sebbu has changed nick to 94SAAF2AN.
11:06:42 -!- pikhq has changed nick to 94SAAEFTX.
11:06:46 -!- Adrian^L has joined.
11:06:46 -!- pikhq has joined.
11:06:46 -!- sebbu has joined.
11:06:46 -!- FireFly has joined.
11:06:46 -!- Slereah has joined.
11:06:46 -!- augur has joined.
11:06:46 -!- Sgeo has joined.
11:06:46 -!- coppro has joined.
11:06:46 -!- olsner has joined.
11:06:46 -!- oklofok has joined.
11:06:46 -!- uorygl has joined.
11:06:46 -!- Deewiant has joined.
11:06:46 -!- cheater2 has joined.
11:06:46 -!- Mathnerd314 has joined.
11:06:46 -!- Quadrescence has joined.
11:06:46 -!- myndzi\ has joined.
11:06:46 -!- HackEgo has joined.
11:06:46 -!- EgoBot has joined.
11:06:46 -!- iamcal has joined.
11:06:46 -!- comex has joined.
11:06:46 -!- dbc has joined.
11:06:46 -!- mycroftiv has joined.
11:06:46 -!- fizzie has joined.
11:06:46 -!- rodgort has joined.
11:06:46 -!- Geekthras has joined.
11:06:46 -!- sshc has joined.
11:06:46 -!- fungot has joined.
11:06:46 -!- pineapple has joined.
11:06:46 -!- AnMaster has joined.
11:06:46 -!- Leonidas has joined.
11:06:46 -!- lifthrasiir has joined.
11:06:46 -!- mtve has joined.
11:06:46 -!- ineiros has joined.
11:06:46 -!- SimonRC has joined.
11:06:46 -!- jix has joined.
11:06:46 -!- wareya has joined.
11:06:46 -!- chickenzilla has joined.
11:06:46 -!- Gregor has joined.
11:06:46 -!- Ilari has joined.
11:06:46 -!- yiyus has joined.
11:06:51 -!- 94SAAF2AN has quit (Ping timeout: 280 seconds).
11:06:51 -!- 94SAAEFTX has quit (Ping timeout: 241 seconds).
11:10:11 -!- augur has quit (Remote host closed the connection).
11:10:20 -!- augur has joined.
11:24:36 -!- BeholdMyGlory has joined.
12:57:34 -!- kar8nga has joined.
13:06:31 -!- ais523 has joined.
13:10:24 -!- lereah_ has joined.
13:45:32 -!- nooga has joined.
13:48:34 -!- ais523 has quit.
13:49:46 -!- ais523 has joined.
13:50:28 -!- aschueler has joined.
14:08:08 <nooga> ll
14:20:49 <AnMaster> fizzie, there? Which llvm version are you using for jitfunge?
14:21:15 <Deewiant> AnMaster: Some 2.7 prerelease
14:21:18 <AnMaster> reading 2.7 release notes (note: 2.7 is at beta2 or something like that atm iirc): "The JIT now supports generating debug information, which is compatible with the new GDB 7.0 (and later) interfaces for registering debug info for dynamically generated code."
14:21:47 <fizzie> Whatever's in lucid; currently it seems to be "2.7~svn20100418-0ubuntu1".
14:21:58 <fizzie> I'll have to read about that later.
14:22:10 <AnMaster> fizzie, that dynamic debug info thing might help with that bug in generated code you mentioned
14:27:59 <AnMaster> interesting line from that same release notes:
14:28:01 <AnMaster> "# The ARM and Thumb code generators now using register scavenging for stack object address materialization.(FIXME: WHAT BENEFIT DOES THIS PROVIDE?)"
14:28:49 <AnMaster> hm that # seems to be a bug in firefox copy and paste
14:29:51 <AnMaster> "# The X86-64 backend does not yet support the LLVM IR instruction va_arg. Currently, front-ends support variadic argument constructs on X86-64 by lowering them manually." <-- that has been there since ages. I wonder when they will fix it finally
14:31:14 <fizzie> Doesn't it do that for <li> nodes deliberately? In which case it's a feature, not a bug.
14:31:25 <AnMaster> a weird feature
14:31:41 <AnMaster> mapping it to * or the middot char would make more sense
14:31:55 <Deewiant> Why does * make more sense than #
14:32:18 <AnMaster> Deewiant, for a dot list. It isn't a numbered list
14:32:26 <Deewiant> Why does * make more sense than #
14:32:47 <AnMaster> there is a dot on my screen for it. And * is closer to the same shape. Plus the usual way to render such lists in plain text files
14:33:11 <AnMaster> * or - are amongst the more common ones. # I never seen in any README or such for this purpose
14:33:12 <Deewiant> What the bullet is can be controlled by CSS anyway
14:33:30 <AnMaster> Deewiant, yes, and?
14:33:42 <AnMaster> Deewiant, now instead tell me why # makes more sense than * for this
14:33:51 <Deewiant> So "there is a dot on my screen for it. And * is closer to the same shape." is not a sound argument
14:33:59 <Deewiant> Because what is on the screen can vary.
14:34:03 <AnMaster> Deewiant, so why #
14:34:06 <Deewiant> Why not?
14:34:34 <AnMaster> Deewiant, See above. * is more common in plain text for such lists
14:34:55 <Deewiant> Maybe this dates to before * became common
14:34:58 <AnMaster> ever heard of "principle of least surprise to the user"?
14:35:15 <Deewiant> I am completely uninterested in the bullet
14:35:17 <AnMaster> Deewiant, you mean back to netscape 0.0.1 or such?
14:35:24 <Deewiant> It could be ~»÷—–, whatever
14:35:30 <Deewiant> any of*
14:35:44 <Deewiant> AnMaster: Probably not that far :-P
14:36:31 <AnMaster> Deewiant, well I think I have seen * for bulleted lists in really old text files. Older than the web certainly.
14:36:59 <AnMaster> (heirloom toolkit age kind of things)
14:37:05 <Deewiant> I've seen # for bulleted lists in text files
14:37:14 <AnMaster> Deewiant, and that I have never seen
14:37:35 <Deewiant> I've also seen - and § and others
14:37:54 <AnMaster> well § is "paragraph". And yes "-" is quite common too
14:42:42 <AnMaster> actually, some quick googling indicates that § is closer to "section". However the Swedish word "paragraf" is closer to this meaning. en:paragraph = sv:stycke. iirc sv:paragraf is mostly used in the context of law texts and similar
14:48:24 -!- nooga has quit (Ping timeout: 252 seconds).
15:06:18 <AnMaster> Deewiant, btw the GCC 4.5 miscompliation seems to be a gcc bug. Unless you tell me (size_t)(-count) is not allowed by the standards. Here count is a int64_t
15:06:41 <AnMaster> just printing the value out makes it not miscompile it btw
15:07:32 <ais523> AnMaster: can you cut it down to a minimal testcase?
15:07:41 <AnMaster> ais523, yes during the weekend I will do so
15:07:45 <AnMaster> don't have time today
15:08:04 <AnMaster> Deewiant, basically it miscompiles it so that: size_t stack_size = 6; stack_size -= (size_t)(-5); makes stack_size == 2
15:08:15 <AnMaster> wait
15:08:17 <AnMaster> not -5 there
15:08:21 <AnMaster> it is -(-5)
15:08:21 <AnMaster> even
15:08:32 <AnMaster> so 6-5 = 2 according to GCC :D
15:08:49 <AnMaster> only at -O3 though
15:10:16 <ais523> AnMaster: undefined behaivour
15:10:18 <ais523> *behaviour
15:10:47 <ais523> aren't you trying to subtract a very large number from a signed number?
15:10:54 <ais523> that causes signed overflow, which is undefined
15:11:18 <AnMaster> ais523, no
15:11:24 <AnMaster> ais523,
15:11:25 <AnMaster> } else if (count < 0) {
15:11:25 <AnMaster> stack_discard(SOSS, (size_t)(-count));
15:11:25 <AnMaster> }
15:11:34 <AnMaster> that will be a *positive* number
15:11:45 <ais523> ok, what type's the second argument to stack_discard?
15:11:46 <AnMaster> -(-x) = x
15:11:55 <AnMaster> ais523, size_t
15:12:01 <AnMaster> and count is a int64_t
15:12:24 <AnMaster> and the values that produce the bug are in the range "would fit in a signed char"
15:12:34 <ais523> why are you casting explicitly then? that's normally asking to suppress warnings
15:13:25 <AnMaster> ais523, iirc icc gave a spurious warning there otherwise.
15:13:33 <AnMaster> or maybe some older gcc version did
15:14:23 <AnMaster> ais523, point is however that there seems to be nothing undefined in that. Oh and just storing it to a size_t variable first and then passing that as argument hide the bug. So does printf("%zu\n",(size_t)(-count)) inside that block...
15:14:53 <AnMaster> (as in: on the line before or the line after the call to stack_discard())
15:15:11 <ais523> ok, that only seems to have undefined behaviour if count happens to be holding INT_MIN
15:15:13 <ais523> which presumably it isn't
15:15:38 <AnMaster> ais523, indeed it didn't. Also why would it be undefined at INT_MIN? Don't you mean SIZET_MIN or whatever it is called
15:15:49 <ais523> um, INT64_T_MIN or whatever it's called
15:15:49 <AnMaster> size_t is unsigned 64-bit after all
15:15:51 <AnMaster> yeah
15:16:00 <ais523> because the unary minus overflows before the cast happnes
15:16:01 <ais523> *happens
15:16:48 <AnMaster> anyway, it is hard to make a minimal test case. It seems to optimise differently with just trivial changes
15:23:33 <AnMaster> ais523, for example -fno-inline removes this bug
15:24:06 <ais523> hmm, it's a bug with the way stack_discard is inlined?
15:24:37 <AnMaster> ais523, hm removing restrict on stack pointer to stack_discard "hides" the bug too
15:24:48 <AnMaster> but I'm pretty sure restrict *is* valid there
15:25:03 <ais523> hmm, messing with restrict you always have to be careful
15:25:25 <AnMaster> ais523, so perhaps some combination of restrict and inlineing triggers a gcc bug
15:26:26 <AnMaster> ais523, yes but restrict should be valid here. It can't alias anything else in the scope of that function. However in the caller it could, but those vars are not visible in stack_discard.
15:27:00 <ais523> perhaps restrict is being inlined incorrectly? as in, it's inlining the restricts to refer to the wrong scope?
15:27:08 <AnMaster> on the other hand I think restrict is fairly pointless there nowdays since there should be no other variable of that type visible at all nowdays
15:27:14 <AnMaster> ais523, yes perhaps
15:27:19 <AnMaster> but then that is the compiler bug
15:27:55 <AnMaster> however I'm a bit unsure about how it can result in a one-off error like this...
15:28:25 <AnMaster> off-by-one*
15:31:54 <AnMaster> ais523, okay from checking the code it is doing 7-5 instead of 6-5
15:32:00 <AnMaster> which is even stranger
15:32:42 <ais523> have you at least got a test case minimal enough to dump the compiler internals to see what's going on?
15:32:45 <AnMaster> err, code as in asm and dumping registers
15:32:47 <ais523> say, a couple of functions or so
15:32:47 -!- coppro has quit (Remote host closed the connection).
15:33:31 <AnMaster> ais523, well that is what I'm not able to produce, I tried doing it and I had to have all the ip and funge stack logic needed to reach that point for it to happen. Oh and if you want to test this you need gcc 4.5.0
15:34:06 <AnMaster> also I don't know if it is x86_64 only or such, will test -m32 later
15:34:35 -!- Asztal has joined.
15:35:05 -!- Mathnerd314 has quit (Ping timeout: 260 seconds).
15:35:21 -!- MizardX has joined.
15:36:45 -!- samosa has joined.
15:44:25 * AnMaster diffs the asm for good/bad code
15:45:10 <AnMaster> okay that is strange
15:46:26 <AnMaster> it seems to load it from memory without restrict, with restrict it reuses it from a register
15:46:32 <AnMaster> but I think it reuses the wrong value
15:48:09 <AnMaster> ais523, http://sprunge.us/IhiB
15:48:14 -!- Mathnerd314 has joined.
15:49:01 <AnMaster> basically %rsi is what it thinks contains the top of the stack value, but for some reason it doesn't contain that.
15:49:02 <ais523> ah, ok; the restrict's saying that the value can't have changed in the meantime, which is fine
15:49:13 <ais523> but the register itself has been clobbered without gcc noticing?
15:49:35 <AnMaster> ais523, if so it did it. There is nothing else that could have clobbered it
15:49:39 <ais523> yep
15:49:43 <AnMaster> and there is no inline asm anywhere near here.
15:49:53 <AnMaster> unless assert() or something like that has inline asm
15:50:01 -!- lereah_ has quit (Quit: Leaving).
15:50:30 <ais523> what does that nopl statement do? it's an opcode I haven't seen before
15:50:36 <AnMaster> ais523, I'm not sure either
15:50:41 * AnMaster looks for the docs
15:50:51 <ais523> it almost implies a no-op operation with an unusually large bitwidth, but that surely doesn't make sense
15:51:27 <AnMaster> ais523, how so? For code alignment purposes perhaps?
15:51:39 <AnMaster> if you need more than 1 byte
15:51:42 <AnMaster> brb phone
15:53:39 <AnMaster> bacl
15:53:41 <AnMaster> back*
15:54:21 <AnMaster> ais523, anyway I don't know what it is named in intel syntax, which while a lot harder to read, have names matching the AMD and Intel docs
15:54:43 -!- samosa has quit (Quit: samosa).
15:55:17 -!- oerjan has joined.
15:55:45 <AnMaster> ais523, anyway, considering that it seems to use different nopl variants there I do think it is a wide nop
15:56:03 <ais523> that takes an argument that does nothing?
15:56:24 <AnMaster> ais523, the classical xchg %eax,%eax nop is iirc 1 byte and it takes an argument
15:56:39 <AnMaster> heck it takes 2 of them
15:56:45 <ais523> fair enough
15:57:23 <AnMaster> ais523, and iirc intel docs mentions special-casing that one as a nop in modern CPUs, so it doesn't block other things depending on that register
15:58:47 <AnMaster> ais523, anyway, from what I can tell yeah the restrict should be allowed there. And I can't find any place at all in the code where %rsi actually held the value gcc think it held
15:59:02 <AnMaster> I don't know what it is holding instead...
15:59:38 <AnMaster> ais523, do you remember how lea worked?
16:00:03 <ais523> it basically just uses the addressing system of the processor to do arithmetic
16:00:25 <AnMaster> ais523, so what about: lea -0x1(%rcx),%rsi
16:01:14 -!- Gracenotes has quit (Ping timeout: 276 seconds).
16:01:19 <ais523> that sets %rsi equal to %rcx minus 1
16:01:46 <AnMaster> huh
16:01:50 <AnMaster> also huh @ "test %rsi,%rsi"
16:05:41 <AnMaster> oh it probably tests if it is zero. I forgot the rFLAGS register stuff
16:11:01 -!- cheater2 has quit (Read error: Connection reset by peer).
16:11:54 -!- cheater2 has joined.
16:19:04 <AnMaster> actually... hm
16:20:43 <AnMaster> wth, if I remove the restrict on the argument to stack_pop_vector it give me *yet* another result
16:20:56 <AnMaster> I think restrict + inlining is completely broken in gcc 4.5
16:21:46 <AnMaster> except, if I remove all restrict it also gives me the wrong result
16:26:22 <AnMaster> ah wait there was still restrict on another called function. Well removing that too then it gives the right resylt
16:26:24 <AnMaster> result*
16:26:33 <AnMaster> but restrict *should* be valild there
16:26:35 <AnMaster> valid*
16:34:35 -!- Gracenotes has joined.
16:36:45 -!- lament has joined.
16:39:55 <AnMaster> ais523, possibly relevant from gcc 4.5 release notes: "The infrastructure for optimizing based on restrict qualified pointers has been rewritten and should result in code generation improvements. Optimizations based on restrict qualified pointers are now also available when using -fno-strict-aliasing."
16:43:56 -!- ais523 has quit (Remote host closed the connection).
16:52:03 -!- Gracenotes has quit (Read error: Connection reset by peer).
16:54:03 -!- Gracenotes has joined.
16:55:59 -!- lament has quit (Quit: lament).
17:15:59 -!- tombom has joined.
17:17:58 -!- Gracenotes has quit (Ping timeout: 260 seconds).
17:27:45 -!- oerjan has quit (Quit: leaving).
17:48:44 -!- jcp has joined.
17:52:59 -!- Mathnerd314 has quit (Ping timeout: 245 seconds).
17:54:35 -!- Mathnerd314 has joined.
18:10:52 -!- nooga has joined.
18:14:24 -!- augur has quit (Ping timeout: 265 seconds).
18:19:34 -!- Gracenotes has joined.
18:34:29 -!- pikhq has quit (Read error: Connection reset by peer).
18:50:00 -!- augur has joined.
18:54:05 -!- augur has quit (Remote host closed the connection).
18:56:42 -!- Slereah has quit.
18:56:56 -!- Slereah has joined.
19:01:38 -!- augur has joined.
19:02:04 -!- BeholdMyGlory has changed nick to BeholdMyGlory_.
19:02:22 -!- BeholdMyGlory_ has changed nick to BeholdMyGlory.
19:03:31 -!- nooga has quit (*.net *.split).
19:03:31 -!- MizardX has quit (*.net *.split).
19:03:31 -!- Deewiant has quit (*.net *.split).
19:09:13 -!- nooga has joined.
19:09:13 -!- MizardX has joined.
19:09:13 -!- Deewiant has joined.
20:04:07 -!- pikhq has joined.
20:04:18 -!- augur has quit (Remote host closed the connection).
20:04:30 -!- tombom_ has joined.
20:05:48 -!- tombom has quit (Ping timeout: 264 seconds).
20:24:35 -!- jcp has quit (Quit: I will do anything (almost) for a new router.).
20:36:53 -!- nooga has quit (Ping timeout: 276 seconds).
20:39:51 -!- oklofok has quit (Ping timeout: 252 seconds).
21:20:15 -!- nooga has joined.
21:49:19 -!- Mathnerd314 has quit (Ping timeout: 258 seconds).
21:54:21 -!- Mathnerd314 has joined.
22:15:03 <AnMaster> fizzie, there?
22:15:07 -!- Phantom_Hoover has joined.
22:15:21 -!- BeholdMyGlory has quit (Read error: Connection reset by peer).
22:17:06 <AnMaster> I had an idea for how to figure out FOV of my phone, since it doesn't export that info in EXIF. What you do is you find an outdoor landscape (so the parallax we will get is insignificant) then you take a panorama with a "known good" camera, and _from the same spot_ you then take photos using the unknown camera. Then you include both in the panorama and let hugin estimate the fov from that.
22:17:30 <AnMaster> of other there are other ways, from a 360° pano it should be possible to estimate it as well
22:18:17 <Phantom_Hoover> What is the fov?
22:20:06 <AnMaster> field of view. Well, what you really want is angle of view but no one seems to use the term "aov" for it
22:20:54 <AnMaster> Phantom_Hoover, don't know if you noticed it but both fizzie and me likes to make panorams and HDR images and such.
22:21:06 <AnMaster> for panoramas, you need to know the angle of view really
22:22:19 <fizzie> I would think you'd get some sort of FOV estimate simply by taking a pile of shots, adding control points and letting the optimizer optimize one fov for all the images. Might not be quite as accurate, but still.
22:22:43 <AnMaster> fizzie, how would that work?
22:23:22 <Phantom_Hoover> is there a reason that you can't do it with some pins and a protractor?
22:24:23 <AnMaster> Phantom_Hoover, huh?
22:25:09 <AnMaster> Phantom_Hoover, I want to estimate that on my mobile phone camera. Which, unlike my rather large and bulky "real" camera, I have handy everywhere.
22:25:44 <Phantom_Hoover> Well, if you're trying to work out the angle the pictures encompass, you could stick a couple of pins at the edge of the picture, keep the camera in a marked position, and then measure the angle.
22:25:56 <AnMaster> Phantom_Hoover, I tried with a protractor before (had to google what it was, didn't know the English word) but how does pins come into it?
22:26:07 <AnMaster> ah hm
22:26:11 <Phantom_Hoover> For marking points
22:26:26 <AnMaster> Phantom_Hoover, well I tried moving myself to use some fixed points in that case
22:26:47 <AnMaster> but the measurement error was too large to give any usable results
22:26:51 <AnMaster> when I tried to measure the angle
22:26:54 <fizzie> AnMaster: I would think the correct FOV should lead to best control-point fit, since it's a different sort of image transformation (basically the image "size") than the yaw/pitch/roll positioning; so if you optimize positions and view, I think you should end up with some sort of view estimate.
22:27:04 <AnMaster> more than 20° variation commonly
22:27:21 <AnMaster> fizzie, hm.
22:27:55 <AnMaster> fizzie, and then suddenly it rushes off to way wrong values (that commonly happens)
22:28:13 <AnMaster> like from around 40° it jumps to 230° or such
22:29:24 <fizzie> Yes, it can do that. But if you start with a reasonable guess and have good points, I'm thinking it should converge sensibly. Assuming the images are short with different enough directions.
22:29:43 <fizzie> Doing the whole 360 degrees would probably help in that too.
22:29:56 <AnMaster> fizzie, well yes but that is tricky with no tripod and so on
22:30:10 <AnMaster> I mean, not just tricky, near impossible
22:30:44 -!- kar8nga has quit (Remote host closed the connection).
22:31:42 <fizzie> I've done a couple of full-circle shots freehand, I wouldn't call it impossible. At least as long as there's nothing nearby so that parallax movement is minimized.
22:32:40 <fizzie> The Sun-Earth L4 Lagrange point would be one suitable place, for example.
22:34:33 <Phantom_Hoover> I leave the conversation for like 5 minutes and you've gone from photography to Lagrange points?
22:40:05 <Phantom_Hoover> GCC is refusing to accept __asm__("jmp %eax"
22:40:06 <Phantom_Hoover> :
22:40:08 <Phantom_Hoover> : "A" (bin)); as valid code. Any ideas?
22:40:32 -!- tombom_ has quit (Quit: Leaving).
22:40:44 <fizzie> Isn't that jmp *%eax (if you want an indirect jump) in the AT&T syntax?
22:40:45 <AnMaster> <fizzie> I've done a couple of full-circle shots freehand, I wouldn't call it impossible. At least as long as there's nothing nearby so that parallax movement is minimized. <-- yes quite
22:40:50 <Phantom_Hoover> Ah.
22:40:58 <AnMaster> but I know no such huge open areas nearby
22:41:09 <Phantom_Hoover> I don't know much about gas syntax in general.
22:41:24 <AnMaster> <fizzie> The Sun-Earth L4 Lagrange point would be one suitable place, for example. <-- for what?
22:41:40 <fizzie> AnMaster: For a huge open area, with no parallax movement problems.
22:41:50 <AnMaster> hah
22:41:50 <pikhq> Phantom_Hoover: goto **bin
22:41:57 <pikhq> Erm.
22:41:59 <pikhq> goto *bin
22:42:09 <Phantom_Hoover> Thanks.
22:42:12 <fizzie> Right, it has that computed-goto extension too.
22:42:14 <AnMaster> pikhq, depends on what he is doing
22:42:24 <AnMaster> pikhq, it needs to be a label for that doesn't it?
22:42:28 <AnMaster> well
22:42:32 <AnMaster> a pointer to a label
22:42:47 <pikhq> AnMaster: No, it needs to be a void* that points to an address to jump to.
22:42:49 <Phantom_Hoover> It's not.
22:43:05 <AnMaster> pikhq, wrong, I read about this on the llvm blog today.
22:43:14 <Phantom_Hoover> It's from some code I scrounged which is meant to jump to an address in memory that was mallocced.
22:43:18 <pikhq> *As documented* it needs to be a "pointer to a label", but it is treated as an indirect jump.
22:43:29 <AnMaster> pikhq, older (pre-2.7) llvm versions used to handle it by turning it into a switch case
22:43:30 <pikhq> AnMaster: LLVM handles it differently from GCC. ;)
22:43:37 <AnMaster> since that was the only way to represent it in the IR
22:43:43 <AnMaster> 2.7 can do a lot more
22:43:52 <AnMaster> pikhq, and yes "as documented"
22:44:14 <AnMaster> pikhq, please do not use undefined behaviour. It makes me said
22:44:15 <AnMaster> sad*
22:44:34 <fizzie> It's documented with the typical sort of warnings; "You may not use this mechanism to jump to code in a different function. If you do that, totally unpredictable things will happen."
22:44:34 -!- BeholdMyGlory has joined.
22:44:45 <fizzie> Note: not "may happen", but "will happen".
22:45:22 <fizzie> Still, I don't think they've quite managed to make absolutely sure that something unpredictable happens.
22:45:22 <AnMaster> fizzie, yes and also you may not do anything except jump to that label pointer
22:45:23 <Phantom_Hoover> But if one reads some raw machine code straight into memory how would one then execute it.
22:45:26 <Phantom_Hoover> ?
22:45:27 <AnMaster> you may not try to covert the value to an int to print what it is with printf or such
22:45:38 <AnMaster> Phantom_Hoover, by doing what you did
22:45:47 <AnMaster> not by computed goto
22:45:50 <Phantom_Hoover> goto *bin or the inline asm?
22:45:52 <Phantom_Hoover> OK.
22:45:56 <AnMaster> Phantom_Hoover, inline asm yeah
22:46:17 <fizzie> Alternatively, you could make the machine code correspond to the platform's calling conventions and then use a function pointer.
22:46:52 <pikhq> That would be the *cleanest* thing to do.
22:47:02 <pikhq> And work on any compiler, not just a particular version of GCC.
22:47:15 <Phantom_Hoover> Difficult.
22:47:29 <Phantom_Hoover> Need to go anyway.
22:47:32 <Phantom_Hoover> Bye.
22:47:33 -!- Phantom_Hoover has quit (Quit: ChatZilla 0.9.86 [Firefox 3.5.9/20100401213457]).
22:47:47 <AnMaster> fizzie, yeah
22:47:55 <AnMaster> fizzie, how does jitfunge with llvm do it?
22:48:02 <AnMaster> and how did the old backend do it?
22:48:12 <pikhq> AnMaster: Actually, the result of unary "&&" may be used whenever a constant void* would be valid. It's just the actual goto *foo that can break shit.
22:48:36 <pikhq> (erm. Constant of type void*, not a const void*.)
22:49:07 <AnMaster> pikhq, not according to the same llvm blog post
22:49:22 <AnMaster> which claimed llvm 2.6 was implementing this to the letter
22:49:31 <AnMaster> (giving us a DS9K implementation)
22:49:37 <pikhq> AnMaster: I'm looking at the GCC documentation.
22:49:55 <pikhq> "This value is a constant and can be used wherever a constant of that type is valid."
22:50:01 <pikhq> On the result of unary &&.
22:50:20 <AnMaster> for which gcc version?
22:50:23 <AnMaster> try an older one
22:50:26 <AnMaster> around 4.0 or so
22:50:28 <pikhq> Looking at 4.4 ATM.
22:50:39 <fizzie> AnMaster: LLVM mostly handles the ugly details; calling ExecutionEngine's getPointerToFunction(Function*) method -- where Function is LLVM's function type that has the LLVM IR body and whatnot -- gives you a "void *" that you have to (a bit messily) cast to a function pointer.
22:51:26 <pikhq> "The value has type void *. This value is a constant and can be used wherever a constant of that type is valid."
22:51:33 <pikhq> 4.0.4 documentation.
22:51:58 <pikhq> "The value has type void *. This value is a constant and can be used wherever a constant of that type is valid."
22:52:04 <pikhq> 3.4.6 documentation.
22:52:26 <pikhq> "The value has type void *. This value is a constant and can be used wherever a constant of that type is valid."
22:52:32 <pikhq> 3.3.6 documentation.
22:52:55 <AnMaster> hm
22:52:56 <pikhq> I'll let you know if I find a change in the documentation of that this side of the EGCS merge.
22:53:05 <AnMaster> pikhq, strange then I guess I was wrong
22:53:10 <fizzie> (The old jitfunge code generator also made the necessary function bits so that it was callable via a function pointer.)
22:53:32 <AnMaster> pikhq, but see http://blog.llvm.org/2010/01/address-of-label-and-indirect-branches.html
22:53:52 <AnMaster> "An interesting aspect about this extension is that the only thing you are allowed to do with an address taken label is to jump to it. While it is widely misused for other things (e.g. the BUG macro in the linux kernel, which prints the address of a label on error), you are really really only allowed jump to it. You are not allowed to use it in an inline asm, inspect the value, or do anything else."
22:53:56 <AnMaster> which is then wrong I guess
22:54:06 <AnMaster> pikhq, you should contact the person who wrote it
22:54:15 <pikhq> AnMaster: I should.
22:54:37 <pikhq> Though LLVM's implementation was, in fact, entirely correct.
22:54:54 <pikhq> GCC makes no guarantee that the address in question is an *actual* address.
22:55:10 <pikhq> Just that when you dereference it for an indirect goto, it jumps to the correct address.
22:55:31 <AnMaster> pikhq, yeah I guess llvm could do 1,2,3,4,...
22:55:35 <AnMaster> (in 2.6)
22:55:42 <pikhq> Which is what it does.
22:55:51 <AnMaster> pikhq, what? 1-indexed? ;P
22:56:00 <AnMaster> it should do zero-indexed of course ;P
22:56:03 <pikhq> Yes.
22:56:09 <pikhq> I've looked at the resulting assembly. ;)
22:56:15 <AnMaster> hah
22:56:24 <AnMaster> 1-indexed would be pretty strange though
22:57:15 <AnMaster> fizzie, why did you do it as a function pointer btw?
22:57:31 <AnMaster> surely using a custom calling convention would have had less overhead?
22:57:50 <AnMaster> well I guess less messing with storing registers in other ways...
22:58:45 <fizzie> Though it'd be the cleanest way to interface with the C code. There might have been some calls inside the generated code that used a non-standard convention, though.
22:59:49 <AnMaster> ah
23:00:36 <pikhq> AnMaster: C calling conventions have very low overhead.
23:00:52 <pikhq> Particularly in x86_64, where passing in the registers is the norm.
23:01:17 <fizzie> The Scheme compiler I wrote for a course recently didn't use the C calling conventions, but that's perhaps more reasonable.
23:02:07 <pikhq> x86 tends to handle all the stack-handling stuff quickly. ;)
23:02:07 <AnMaster> heh
23:02:07 <AnMaster> fizzie, oh, how comes?
23:02:15 <AnMaster> fizzie, and did you implement call/cc?
23:02:26 <pikhq> AnMaster: C calling conventions clash with most Scheme implementation methods.
23:02:39 <AnMaster> right
23:03:03 <fizzie> Yes, it did continuations; there's not much point otherwise.
23:03:40 <fizzie> Used the ridiculously trivial way of just putting the "stack" under garbage collection, I think.
23:03:51 <AnMaster> hah
23:04:09 <AnMaster> fizzie, own gc?
23:04:46 -!- jcp has joined.
23:06:59 <fizzie> Yes, a very simple one. I think it was a copying/compacting one. Didn't have much time to twiddle with that.
23:07:44 <AnMaster> fizzie, why not reuse an existing one?
23:07:49 <AnMaster> NIH NIH
23:08:10 <fizzie> call/cc implementation: http://pastebin.com/fsT5KaRn
23:08:23 <fizzie> That's not very many instructions.
23:09:39 <AnMaster> heh
23:09:48 -!- oerjan has joined.
23:09:52 <AnMaster> oerjan, hi
23:09:57 <oerjan> hi AnMaster
23:10:17 <oerjan> bah oklopol isn't here
23:11:01 <oerjan> i had another comment on defining tuples in toi
23:11:43 -!- augur has joined.
23:13:11 -!- Mathnerd314 has quit (Quit: ChatZilla 0.9.86-rdmsoft [XULRunner]).
23:14:30 -!- BeholdMyGlory has quit (Remote host closed the connection).
23:18:13 <oerjan> <fizzie> It's documented with the typical sort of warnings; "You may not use this mechanism to jump to code in a different function. If you do that, totally unpredictable things will happen."
23:18:30 <oerjan> can you use it in a different invocation of the same function?
23:19:42 <AnMaster> probably it will work, but imagine this is in a dlopen()ed library. then you unload and reload the library
23:19:48 <AnMaster> using it then would be stupid
23:20:06 <oerjan> well i was really asking whether it was guaranteed to work
23:20:18 <AnMaster> no idea
23:20:26 <AnMaster> probably not
23:20:43 <fizzie> oerjan: It doesn't seem to say, explicitly, but the example there is: "One way of using these constants is in initializing a static array that will serve as a jump table: static void *array[] = { &&foo, &&bar, &&hack };"
23:21:00 <AnMaster> fizzie, yes but that is quite different
23:21:15 <AnMaster> since it would be re-initialised on dlopen()
23:21:30 <AnMaster> as opposed to saving it in a variable outside the library
23:21:48 <fizzie> There's also the "alternate way":
23:22:03 <fizzie> "An alternate way to write the above example is
23:22:03 <fizzie> static const int array[] = { &&foo - &&foo, &&bar - &&foo,
23:22:03 <fizzie> &&hack - &&foo };
23:22:03 <fizzie> goto *(&&foo + array[i]);"
23:22:22 <fizzie> "This is more friendly to code living in shared libraries, as it reduces the number of dynamic relocations that are needed, and by consequence, allows the data to be read-only."
23:22:46 <AnMaster> ah
23:23:08 <AnMaster> &&foo - &&foo would be 0?
23:23:22 <oerjan> this seems to imply you can use pointer arithmetic on labels in the same function, then
23:23:49 -!- FireFly has quit (Quit: Hey! Listen!).
23:26:01 <AnMaster> hm
23:26:47 <pikhq> oerjan: Yes, it is in fact a valid void*.
23:27:23 <pikhq> The only thing that will break is going to a label in a different function.
23:27:23 <Sgeo> http://www.google.com/search?rlz=1C1CHNR_enUS321US321&sourceid=chrome&ie=UTF-8&q=BF-RLE
23:27:32 <AnMaster> would dlopen()ing libpthreads instead of linking to it result in mayhem do you think?
23:27:39 <AnMaster> same question goes for libm and libc
23:27:43 <Sgeo> :( at people pirating my bf-isomorphic esolang :(
23:27:45 <Sgeo> lol
23:28:02 <pikhq> Also, the pointer in question is not necessarily an actual numerical address. But, this is never guaranteed by C *ever*.
23:28:03 <AnMaster> Sgeo, ?
23:28:11 <Sgeo> AnMaster, my link
23:28:15 <Sgeo> Look at the first result
23:28:21 <oerjan> pikhq: well from the discussion so far it seems like saving a label outside the function is dubious if it can be reloaded
23:28:34 <AnMaster> "Fmin.v ((Rle min r) /\ ((f:float) (Fbounded b f) -> (Rle f r) ->(Rle f min))). (* Min is a projector *) Theorem ProjectMin: (ProjectorP isMin). ... www-sop.inria.fr/lemme/AOC/coq/Fmin.html - Cached - Filter"?
23:28:37 <AnMaster> Sgeo, that one?
23:28:42 -!- BeholdMyGlory has joined.
23:28:48 <Sgeo> AnMaster, no
23:28:50 <pikhq> oerjan: Only dubious because you might be able to jump to the label from outside the function.
23:28:50 <AnMaster> or do you mean the second one? which seems to fit better with what you said
23:28:57 <AnMaster> Sgeo, the second one is kazaa
23:29:01 <pikhq> Which will *usually* break the stack frame.
23:29:01 <AnMaster> which seems pretty strange
23:29:05 <Sgeo> That's what I was referring to
23:29:08 <pikhq> In very unusual ways, no less.
23:29:14 <Sgeo> For me, it's the top result *shrug*
23:29:18 <AnMaster> Sgeo, yeah, do no assume the results are in the same order for everyone
23:29:21 -!- BeholdMyGlory has quit (Remote host closed the connection).
23:29:33 <pikhq> And of course, in pre-2.7 LLVM, it'll just have the compiler kick you in the balls.
23:29:36 <oerjan> pikhq: hm this means the label _cannot_ be implemented as the actual code address pointer
23:29:44 <Sgeo> The Fmin one is the 7th down for me
23:29:46 <pikhq> Yes it can.
23:29:57 <AnMaster> Sgeo, well I'm logged in for gmail
23:30:02 <AnMaster> that would probably affect stuff
23:30:10 * Sgeo is also logged in
23:30:13 <pikhq> It's just undefined behavior if you jump to it when you're not in the function.
23:30:14 <oerjan> pikhq: if the function can be reloaded, that would break it
23:30:20 <AnMaster> and that would also personalise the results
23:30:22 <AnMaster> differently
23:30:23 <pikhq> "Can be reloaded" wha?
23:30:41 <Sgeo> When I'm not logged in, Kazaa does NOT appear in the first page of results
23:30:46 <pikhq> You mean... Uh... Linked in at a different address?
23:30:46 <oerjan> pikhq: AnMaster was pointing out functions from shared libraries
23:30:48 <Sgeo> Does Google think I'm a pirate? lol
23:30:50 <oerjan> yes
23:30:52 <pikhq> Oh, yes.
23:31:03 <AnMaster> oerjan, that only applies if you reload the shared library
23:31:14 <AnMaster> since most likely the library will end up elsewhere
23:31:25 <Sgeo> Just logged back in, but it's not appearing anymore
23:31:27 <AnMaster> the DS9K llvm-2.6 implementation *would* have worked there
23:31:33 <AnMaster> mhm
23:31:49 <AnMaster> Sgeo, see, it is unreliable to depend on the order
23:32:03 <pikhq> If you are reloading a shared library into the same program's address space, but a different address, you are doing nasty things with the shared linker and deserve all the breaking you get.
23:32:25 <AnMaster> <pikhq> If you are reloading a shared library into the same program's address space, but a different address, you are doing nasty things with the shared linker and deserve all the breaking you get. <-- eh?
23:32:33 <AnMaster> pikhq, I meant *unloading* and *reloading*
23:32:37 <Sgeo> Was GrainFimple ever implemented?
23:32:39 <pikhq> Yes.
23:33:01 <AnMaster> pikhq, due to ASLR it will most likely end up elsewhere
23:33:04 <pikhq> If you retain a pointer to *anything* in the shared library, you get to keep both pieces.
23:34:35 <oerjan> hm i guess it's unreasonable to consider a reloaded library function to _be_ the same function in all respects
23:35:22 <pikhq> oerjan: Any stored pointers to anything in a reloaded library will break, this is just fact. :)
23:35:29 -!- Asztal has quit (Ping timeout: 245 seconds).
23:35:53 <AnMaster> indeed
23:35:55 <pikhq> It's not just the stored labels, it's any global or static variable.
23:36:12 <oerjan> pikhq: although fizzie's "alternative method" quote seems to imply it could be safe to save _differences_ of label pointers. or maybe that's just an implementation convenience.
23:36:12 <pikhq> (including function pointers)
23:36:13 <AnMaster> or function pointer
23:36:24 <pikhq> oerjan: Yes, that is.
23:36:42 <AnMaster> oerjan, only difference in the same function
23:36:50 <pikhq> Because then, you're just encoding the offset from a different label.
23:36:55 <oerjan> AnMaster: well duh
23:37:11 <pikhq> So long as the actual *data* isn't changing, you're good.
23:37:45 -!- Asztal has joined.
23:37:49 <oerjan> mhm
23:38:01 <pikhq> If the dynamic library has changed between loads, well, you still geet to keep both pieces.
23:38:05 -!- Mathnerd314 has joined.
23:39:00 <AnMaster> I wonder if with PIE it would be possible to do a "user space kexec()" basically?
23:39:11 <AnMaster> loading a new binary and jumping to it
23:39:22 -!- coppro has joined.
23:39:30 <oerjan> i don't think that's legal proto-indoeuropean
23:39:31 <pikhq> That's... What exec does. And you can actually do it in userspace.
23:39:40 <AnMaster> oerjan, ?
23:39:53 <pikhq> You just need to implement the ELF loading manually.
23:39:55 <AnMaster> pikhq, no exec() would free the old address space
23:39:57 * oerjan swats AnMaster's pun detector into place -----###
23:40:04 <pikhq> AnMaster: Ah, yes.
23:40:05 <Gregor> AnMaster: http://codu.org/projects/gelfload/ :P
23:40:05 <AnMaster> I want to keep the values in static variables and such
23:40:11 <AnMaster> and all malloc()ed data
23:40:14 <pikhq> Still. You can do it without PIE just fine.
23:40:19 <pikhq> Erm.
23:40:23 <AnMaster> pikhq, well then you need to load it in the same place
23:40:30 <AnMaster> with PIE you can load it anywhere you want
23:40:43 <pikhq> You actually can relocate ELF files without it being PIE.
23:40:46 <AnMaster> Gregor, g for gnome or g for gnu?
23:40:59 <Gregor> AnMaster: No.
23:41:05 <AnMaster> pikhq, yes but that is a PITA
23:41:09 <AnMaster> Gregor, well what then?
23:41:22 <Gregor> AnMaster: Read that line again.
23:41:26 <pikhq> PIE is actually only used so the relocation can be done without modifying any memory.
23:41:27 <Gregor> AnMaster: Your own line that is.
23:41:33 <pikhq> Same for PIC.
23:41:51 <AnMaster> "4 months Gregor Richards Initial import.default tip" <-- 1) didn't use vcs from the start? 2) no longer working on it?
23:42:09 <AnMaster> Gregor, which one of them?
23:42:29 <pikhq> AnMaster: You're... Dense.
23:42:40 <AnMaster> pikhq, I'm sleep deprived
23:42:40 <Gregor> AnMaster: EVERY SINGLE ONE in which you asked one _G_regor Richards what the GEE in gelfload stands for.
23:42:41 <oerjan> practically a black hole, there
23:42:50 <AnMaster> Gregor, oh thanks
23:42:52 <AnMaster> right
23:43:10 <AnMaster> oerjan, I still don't get your pun
23:43:12 <Gregor> AnMaster: I developed it as part of a defunct project called crosslibc, then split it out a while ago.
23:43:13 -!- Oranjer has joined.
23:43:24 <AnMaster> Gregor, I know what it does
23:43:31 <oerjan> AnMaster: PIE = proto-indoeuropean, common linguist abbreviation
23:43:32 <AnMaster> you told us before
23:43:51 <Gregor> AnMaster: That was my answer to your question about VCS X_X
23:43:52 <AnMaster> oerjan, oh, never heard that. to me PIE = position independent executable
23:44:09 <AnMaster> oerjan, alternatively (but that is seldom all caps) it is something you can eat
23:44:19 -!- Asztal has quit (Ping timeout: 258 seconds).
23:44:20 <AnMaster> Gregor, oh right thanks
23:44:50 <oerjan> AnMaster: still, all the pieces for the pun were right there in the channel
23:44:58 <AnMaster> oerjan, mhm
23:46:12 <oerjan> AnMaster: with that and the gelfload i think we can conclude you are acronymically challenged :)
23:46:14 <nooga> I MUST CODE
23:46:21 <AnMaster> oerjan, okay
23:46:37 <AnMaster> oerjan, OPASFF
23:46:48 <oerjan> (disclosure: i didn't get g = Gregor either)
23:46:53 <AnMaster> oerjan, :D
23:46:55 <AnMaster> Gregor, ^
23:46:55 <oerjan> argh!
23:47:08 <AnMaster> oerjan, why "argh"?
23:47:15 <oerjan> OPASFF
23:47:38 <AnMaster> oerjan, oh but MPAAFFS, WALITC
23:48:00 <oerjan> AnMaster: can we just agree to forget this ever happened
23:48:10 <AnMaster> oerjan, forget what happened?
23:48:16 <oerjan> i dunno
23:48:20 <pikhq> nooga: THOU SHALT CODE A FUNGE
23:48:42 <pikhq> 0"EGNUF A EDOC TLAHS OUHT"
23:48:52 <AnMaster> oerjan, anyway, I don't think I should explain what it was due to YWGMAMFMSABP
23:48:55 <nooga> parallel, supercomputer funge
23:49:19 <oerjan> you realize i'm not even trying to decode you at this point?
23:49:24 <AnMaster> oerjan, hah
23:49:50 <AnMaster> oerjan, well it was "Oerjan's Puns Are Sometimes FarFetched" in the first one ;P
23:50:12 <oerjan> oh, but that was obvious
23:50:18 * oerjan ducks
23:50:21 <AnMaster> :P
23:50:50 <oerjan> "my puns are also far-fetched sometimes"
23:51:08 <AnMaster> oerjan, yes
23:51:36 <AnMaster> oerjan, but when you say it you can remove the "also"
23:51:37 <AnMaster> :P
23:51:51 <AnMaster> since you *are* oerjan
23:52:01 <oerjan> the one and almost only
23:52:15 <AnMaster> what?
23:52:19 <oerjan> TOAAOO
23:52:27 <AnMaster> yes you said that
23:52:49 <oerjan> "the one and only" is a cliche phrase
23:52:57 <AnMaster> ah
23:52:59 <AnMaster> right
23:53:22 <AnMaster> WALITC == "well, at least in this case"
23:53:50 <AnMaster> I keep reading that as "waltic"
23:53:55 <AnMaster> rather than "walitc"
23:57:40 <AnMaster> " This specifies the alignment for an integer type of a given bit size. The value of size must be in the range [1,2^23)."
23:57:47 <AnMaster> what a strange range
23:58:30 -!- coppro has quit (Ping timeout: 258 seconds).
23:59:01 -!- Asztal has joined.
←2010-04-21 2010-04-22 2010-04-23→ ↑2010 ↑all