←2009-03-03 2009-03-04 2009-03-05→ ↑2009 ↑all
00:01:45 <ehird> [[If one extend slightly the syntax for gerunds, DIAL can be implemented
00:01:45 <ehird> as:
00:01:46 <ehird> PLEASE ABSTAIN FROM EVERYTHING EXCEPT COMING FROM + ANSWERING
00:01:49 <ehird> WHILE REINSTATING THEM ]]
00:01:50 <ehird> more literate than cobol
01:11:50 <AnMaster> :D
01:12:00 <AnMaster> night really (failed to sleep first)
04:24:03 -!- psygnisfive has joined.
06:56:33 -!- calamari has joined.
07:48:01 <Dewi> Does anyone know of any unicode characters other than eszet where the toUpper() or toLower() cannot be reversed?
07:48:20 <Dewi> (ie changing case twice returns you to a different codepoint)
07:48:42 <Dewi> (Unicode counts as an esolang right? :P)
07:49:50 <oklopol> it's scary reading the logs, fizzie is such a me.
07:50:28 <oklopol> what does eszet do when you change it twice?
07:50:54 <fizzie> ß uppercased is SS.
07:50:59 <fizzie> And SS lowercased is just ss.
07:51:19 <fizzie> Ligatures have similar behaviour.
07:51:31 <fizzie> Just look at the list in http://www.unicode.org/Public/3.2-Update/SpecialCasing-3.2.0.txt for all special-cased things.
07:54:46 <fizzie> Of course for all uppercase characters x, toLower(toUpper(x)) "returns" to a different codepoint, but I suppose that wasn't the question.
07:55:34 <fizzie> Actually http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt is a better link, since it's version 5.1.0 instead of 3.2.0.
07:56:07 <fizzie> It does not seem to be very much different.
07:57:30 <oklopol> hmph, god it's hard searching the logs based on remembering a topic.
07:57:48 <oklopol> should probably make a better searcher program
07:57:51 <oklopol> one that understands
07:58:06 <fizzie> Incidentally, what especially "you" I did in the logs this time?
07:58:27 <oklopol> you said something about not seeing a reason to make mistakes
07:58:41 <oklopol> it may have been a joke, but i'm pretty sure i've said the exact same line.
07:59:43 <oklopol> there was also some other one, but by then i may just have been looking for similarities sub...erconsciously.
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:00:58 <fizzie> I seem to have been writing no-uppercase-at-the-beginning-of-sentences as late as 2004.
08:02:15 <oklopol> your style has actually changed a lot, while i see oklisms in both the old and the new fizzie, you're not always very *fizzie* in the backlogs.
08:02:31 <oklopol> this i cannot give examples of.
08:03:36 <fizzie> Yes, I don't recognize myself in 1990s-age logs (of other channels) at all.
08:04:05 <oklopol> anyway what i was searching the logs for is i remember once correcting an error of ehird's, and for some reason he just wouldn't admit he was wrong even though i clearly couldn't go on with my life without him admitting it. but maybe he did admit it then, or maybe i just imagined this, because i couldn't find it.
08:04:30 <fizzie> It is not trivial to write a regexp to match that.
08:04:46 <oklopol> indeed not, also i don't even use a regexp.
08:04:59 <oklopol> i just search for a string
08:05:08 <fizzie> Maybe you could graph ehird- and oklopol-densities over time, and look only at spots where those have noticeable peaks simultaneously.
08:05:27 <oklopol> yeah there will only be like 2-3 of those per day.
08:05:45 <oklopol> well
08:05:46 <fizzie> Yes, but I like graphs.
08:05:58 <oklopol> maybe like dialog densities
08:06:06 <oklopol> but
08:06:18 <oklopol> there was also oerjan or someone there, it was very spread out...
08:06:55 <oklopol> anyway i should probably start my readings ~>
08:11:27 <oklopol> fizzie: Yes, but I like graphs. <<< i like the good kind of graphs
08:33:28 -!- tombom has joined.
09:01:05 -!- calamari has quit ("Leaving").
09:44:32 -!- oklopol has quit (Read error: 110 (Connection timed out)).
10:22:31 <AnMaster> <fizzie> Yes, but I like graphs. <-- :D
10:25:49 <fizzie> Since it's been such a while after my last graph-drawing, here's a messy one of channel activity over the whole year 2008: http://zem.fi/~fis/esoteric-2008.png
10:26:17 <AnMaster> fizzie, what is the scale?
10:26:26 <fizzie> Who knows. :p
10:26:45 <AnMaster> fizzie, what is the gap with 0 activity in the beginning?
10:27:29 <AnMaster> fizzie, oh and what app did you use to draw this?
10:27:33 <fizzie> Well, the Y axis is "number of lines over three consecutive days", with each X-axis pixel stepping the window start time by 8 hours; and the nicknames are ordered by total line-counts.
10:27:42 <fizzie> It's a custom Perl script with GD.pm, again.
10:27:47 <AnMaster> ok
10:27:51 <fizzie> That's why there's no grid. :p
10:28:06 <AnMaster> fizzie, btw, that interactive fungot browser thingy... what was the url now again?
10:28:07 <fungot> AnMaster: here's a problem: you're modifying a global packages.scm; i never considered tic-tac-toe a game
10:28:11 <fizzie> Gap is in my logs, I probably again forgot to "/connect freenode", since I don't have it on automagically.
10:28:33 <fizzie> It was at http://zem.fi/~fis/fungot.html but I haven't continued the commentation, and the source might be a bit old.
10:28:33 <fungot> fizzie: hi evoli.
10:28:40 <AnMaster> ah
10:28:40 <fizzie> fungot: I'm not evoli.
10:28:41 <fungot> fizzie: so should i waste time on irc" ( ircnet)
10:28:48 <AnMaster> who is evoli?
10:29:14 <fizzie> Someone on #scheme.
10:29:23 <AnMaster> mhm
10:29:32 <AnMaster> fungot, I prefer if you spent your time in here
10:29:32 <fungot> AnMaster: but decided not to bother u for this one
10:29:41 <AnMaster> .
10:29:45 <AnMaster> good
10:29:50 <AnMaster> I gess
10:29:53 <AnMaster> guess*
10:30:49 <fizzie> Uh... actually it seems that the source is current (since it's fetched with a xmlhttprequest-style ajaxy thing from fungot.b98.txt) but the syntax highlighting doesn't match it. :p
10:30:49 <fungot> fizzie: dating advice? mzscheme? gambit? sisc?
10:31:11 <fizzie> fungot: Are you sure those things have to do with dating?
10:31:11 <fungot> fizzie: i found on the net." this is a public forum
10:31:29 -!- Slereah_ has joined.
10:41:23 -!- Slereah has quit (Read error: 110 (Connection timed out)).
10:49:35 <fizzie> Oh, and here's the same thing as relative activities: http://zem.fi/~fis/esoteric-2008-r.png -- about the only clear thing in it is the ehird/tusho nickname-switcheroo.
11:03:00 -!- oklopol has joined.
11:40:28 -!- psygnisfive has quit ("Leaving...").
12:43:05 -!- ais523 has joined.
12:50:39 <oklopol> okay enigma pack 3, level 46 was a fun, nontrivial puzzle
12:51:24 <oklopol> well okay it was kinda trivial after i familiarized myself with the concept of moving bricks, but it took me a while to get there
12:51:31 <oklopol> so yeah, enigma++
12:53:03 * ais523 finds it interesting to see what oklopol sees and doesn't see as hard
12:53:48 <oklopol> well more interesting than hard, took me three attempts, and on the first one i just tried something at random
12:54:39 <oklopol> on the second i rationalized the beginning but took a few chances on intuition and failed
13:00:20 -!- FireFly has joined.
13:02:48 -!- Mony has joined.
13:03:56 <Mony> plop
13:04:03 <ais523> hi
13:07:21 <fizzie> Intuition: just say no.
13:08:17 <oklopol> yeah it's a pretty useless thing
13:35:57 <ehird> 10:25 fizzie: Since it's been such a while after my last graph-drawing, here's a messy one of channel activity over the whole year 2008: http://zem.fi/~fis/esoteric-2008.png
13:36:02 <ehird> i like it
13:36:15 <ehird> also, mine is kind of skewed since I say things in multiple lines.
13:36:18 <ehird> 08:05 fizzie: Maybe you could graph ehird- and oklopol-densities over time, and look only at spots where those have noticeable peaks simultaneously.
13:36:19 <ehird> 08:05 oklopol: yeah there will only be like 2-3 of those per day.
13:36:20 <ehird> :D
13:36:35 <ehird> 10:49 fizzie: Oh, and here's the same thing as relative activities: http://zem.fi/~fis/esoteric-2008-r.png -- about the only clear thing in it is the ehird/tusho nickname-switcheroo.
13:36:39 <ehird> tha's a lot of oklopol
13:36:58 <ais523> that's pretty
13:37:22 <ais523> I'm actually surprised how high "others" is
13:37:41 <ehird> well, it has the peaks, prolly from when new people arrive
13:37:44 <ehird> or asiekierka
13:37:53 * ais523 would like to see a smoothed version of the first graph
13:37:59 <ais523> maybe with weekly moving averages
13:43:45 <ehird> "Dan Bernstein awards $1,000 for a security hole discovered in djbdns -- its first in almost a decade!"
13:43:46 <ehird> woah
13:43:52 <ehird> he actually awarded it
13:43:53 <ehird> djb++
13:44:25 <ais523> well, aparently there was a security hole in qmail that was discovered a while back that he didn't award for
13:44:34 <ais523> because it only manifested on computers with at least 56GB of RAM
13:45:29 <ehird> yes, well, that makes sense
13:45:36 <ehird> this bug is one that can actually be exploited
14:10:37 <oklopol> i think that activity graph might be better if it also showed how much talk actually happened
14:10:52 <oklopol> also how's that a lot of oklopol, it's much more of everyone else
14:11:12 <oklopol> well maybe more than you'd've thought, but i don't see how that's an interesting observation :P
14:11:28 * oklopol mentions level 46 again
14:11:42 * oklopol goes back to his bookings ->
14:22:45 <ehird> oklopol: want a challenge? try the Experimental set, "Impossible?"
14:23:04 <ais523> ehird: I've done that one, it's easy
14:23:11 <ehird> wut :D
14:23:17 <ais523> there wasn't anything special about it IIRC
14:23:22 <ehird> sure there is
14:23:22 <ais523> AFAICT, it's unfinished
14:23:24 <ehird> it's impossible
14:23:29 <AnMaster> hi ais523
14:23:30 <ais523> how did I not notice?
14:23:33 <ais523> hi AnMaster
14:24:29 <AnMaster> <ehird> it's impossible <-- no, but you have to guess very luckily
14:25:07 <ais523> I'm pretty sure I remember finding a magic wand on that level, which makes it trivial
14:25:20 <ais523> ah, maybe there's a hidden wand somewhere that you can only obtain in the first few seconds
14:26:12 <ehird> ais523:
14:26:17 <ehird> you're thinking of Impultest
14:26:17 <ais523> but as AnMaster mentions, it's clearly possible if you get to the corner oxyds before the bolders do and they happen to be the right colour
14:26:17 <AnMaster> just finished it
14:26:47 <AnMaster> yep, you need to get to the one in the top right corner quickly
14:26:59 <AnMaster> and then you must get it correctly on the next block
14:27:02 <AnMaster> after that: trivial
14:27:25 <ais523> AnMaster: you actually get two tries, you can hit a block on your way to the corner oxyd
14:27:31 <AnMaster> ais523, true
14:28:08 <oklopol> i'm not interested in puzzles that require dexterity or any kind of guesswork, and usually not ones that require exploring either, unless they happen to be fun for some reason, but a good puzzle will always be nicer anyway.
14:28:45 <oklopol> well, i love exploring concepts, like how something moves, but i don't like searching the level for information, or physically exploring large areas
14:29:46 <oklopol> well. i guess i just like to solve the things in my brain and not in the game.
14:35:03 -!- jix has joined.
14:37:31 <FireFly> What game is this about? ;o
14:37:53 <ais523> it's basically a generic puzzle game
14:38:05 <ais523> which can emulate most of the others as long as you flavour them as involving marbles
14:38:14 <fizzie> ais523: "Great minds" and so on; I actually did weekly averages before you mentioned them. http://zem.fi/~fis/esoteric-2008-smooth.png
14:38:36 <ais523> so it has dexterity-based, speed-based, knowledge-based, intelligence-based, and patience-based puzzles
14:38:44 <ais523> oklopol seems to like the intelligence-based ones best
14:39:14 <ehird> fizzie: I'm basically the loudest person on average, then, if you discount AnMaster's 5 billion "Deewiant: boring thing about befunge" per day.
14:39:22 <ehird> That matches my intuitive experience. :P
14:39:46 <FireFly> Does this game have a name?
14:39:55 <ehird> FireFly: Enigma
14:40:07 <ehird> http://www.nongnu.org/enigma/
14:40:15 <FireFly> Ah
14:41:03 <ehird> oklopol: try the microban levels
14:41:33 <FireFly> Hm
14:41:37 <FireFly> I recognize this game
14:41:44 <FireFly> I think I've played it before
14:41:47 <ais523> pretty much everyone here does, somehow
14:43:55 <oklopol> it seems me and psygnisfive take turns being on top
14:44:00 <oklopol> hmm he isn't here
14:44:01 <oklopol> nm
14:44:04 <ehird> *groan*
14:44:45 <oklopol> :)
14:45:04 <oklopol> microban
14:45:15 <oklopol> maybe at some point i will
14:50:18 <fizzie> Occasional visitors are more visible in other graphs. http://zem.fi/~fis/test.png has 2009 January (day-long windows, X-scale 1 hour per pixel, relative percentages of activity) and the fluxo invasion is very visible.
14:51:05 <fizzie> Flexo, not fluxo. Anyway.
14:51:23 <fizzie> A grid would be nice too. And some labels.
14:51:29 <ehird> And a pony yo
14:52:23 <oklopol> who's flexo
14:52:24 <oklopol> :<
14:52:30 <ehird> a german guy
14:58:05 <FireFly> Statistics are interesting
14:59:48 -!- BeholdMyGlory has joined.
15:00:12 -!- M0ny has joined.
15:02:52 <fizzie> Yes, we're certainly putting the ATTIC back in the stATisTICs.
15:06:50 <GregorR> We're putting the TITS back in staTIsTicS!
15:07:17 <fizzie> I didn't want to be rude.
15:07:43 <GregorR> (There are 23 women and 15 men in a conference. The women's cup sizes are: (etc). The men weight: (etc). How many tits are there?)
15:08:08 <fizzie> If I only do the cumulative-activity-thingamajick but not the normalization inherent in the relative-activity-thing, the flexo invasion loses prominence: http://zem.fi/~fis/test2.png
15:09:18 <GregorR> ... wtfbbq?
15:10:15 <ehird> activity graph.
15:15:19 <ehird> HOLY SHIT
15:15:21 <ehird> * (del) (cur) 16:29, 22 September 2006 . . Tom Duff (Talk | contribs) . . 513×385 (10,841 bytes) (The output of a sample EXPLOR program.)
15:15:24 <ehird> --esolangs wiki
15:15:28 <ehird> Tom Duff.
15:15:34 <ais523> who is he?
15:15:40 <ehird> ais523: ... Duff's Device.
15:15:46 <ais523> ah, wow
15:15:56 <ehird> Also wrote Unix10/Plan9's "rc" shell
15:16:01 <GregorR> Not the same Tom Duff :P
15:16:15 <ehird> GregorR: no, it is
15:16:18 <ehird> http://esolangs.org/wiki/User:Tom_Duff
15:16:24 <ehird> My wikipedia bio links to tom duff on wikipedia
15:16:52 -!- Mony has quit (Read error: 110 (Connection timed out)).
15:16:55 <GregorR> *snaps*
15:17:10 <ehird> Was that your spine?
15:17:33 <GregorR> That's a godawful picture of him :P
15:17:38 <GregorR> Or at least, I sure hope it is :P
15:17:42 <ehird> Evil Tom Duff
15:17:56 <ehird> also, programmers aren't known for their beauty
15:18:01 <fizzie> "Your femur is broken." "Broken as in 'not functioning properly'?" "Broken as in, 'there are 2 smaller femurs where you used to have one.'" "Hmm, 2 femurs. Will this give me super powers?" "If you consider the ability to writhe in pain a super power, then yes."
15:18:03 <ais523> does he have a beard?
15:18:07 <fizzie> Sorry, the 'snap' just reminded me.
15:18:09 <ehird> ais523: no
15:18:12 <ais523> that's how we can tell if duff's device will stay popular
15:18:18 <ais523> as he doesn't, presumably it's falling out of fashion
15:18:27 <ehird> I think it never got into fashion
15:18:33 <ais523> well, exactly
15:18:56 <ehird> GregorR: his favicon looks better http://www.tomduff.com/index.html
15:19:05 -!- Judofyr has joined.
15:19:17 <ehird> "Sure. Here's a moderately recent picture of me sitting unshaven in my office scowling at my son, who was playing with the camera. At least I combed my hair. Do whatever you want with it. Tom Duff (talk) 05:53, 16 January 2008 (UTC) "
15:19:19 <ehird> -talk:tom duff
15:21:22 -!- ais523 has quit (Read error: 104 (Connection reset by peer)).
15:21:32 -!- ais523 has joined.
15:21:44 <ais523> wb me
15:21:54 <GregorR> Firefox 3 /added/ support for Gopher :P
15:21:57 <GregorR> That's weird :P
15:22:08 <GregorR> (Full support that is)
15:22:11 <ehird> IT CANNOT COMPETE WITH VONKEROR
15:22:14 <ehird> or sth
15:25:23 <ehird> So, I've thought up some definitions for IO-complete.
15:26:02 <ehird> I-complete: The program can, at its will, accept linear text input from the user and then use that text to modify its internal state with complete differentiation of all characters in the alphabet.
15:26:08 <ais523> GregorR: does it do client-BF?
15:26:09 <ais523> No?
15:26:15 <ais523> then it doesn't have full support
15:26:26 <ehird> O-complete: The program can, at its will, output linear text combined in any arbitrary way from its internal state.
15:26:28 <ehird> Thoughts?
15:26:53 <ais523> the usual definition is that it can produce any output that's a Turing-computable (or substitute other computational class here) function of its input
15:27:06 <ais523> in other words, that its input -> output processing computational class is the same as the computational class of the lang as a whole
15:27:09 <ehird> That doesn't handle interactive programs ala BF
15:27:24 <ais523> does it have to?
15:27:26 <ehird> I'm basically trying to define the set of languages that, to the user, are indistinguishable from BF.
15:27:29 <ais523> ah, ok
15:27:41 <ehird> which is basically the standard model with just stdin/stdout
15:27:45 <ehird> We use "BF-complete" for that, I'd like to formalize the definitions
15:27:59 <ais523> in that case, you need to change it to cumulative input -> cumulative output, and allow the program to produce output before all the input is read
15:28:11 <ehird> Yes, but I've already said some definitions
15:28:18 <ehird> I'm just wondering if they're any good
15:38:45 <ehird> I wonder what lazy apl would be like
15:39:55 <ehird> apart from awesome
15:49:09 <ehird> Oh look, Eric Schmidt slams Twitter with no more than a vague idea what it is.
15:50:01 <ehird> Hm, no. Just a bad headline.
15:51:47 -!- dbc has quit (Read error: 110 (Connection timed out)).
15:53:44 <ehird> http://imgur.com/3US8K.png Uhhh...
15:57:44 -!- oerjan has joined.
16:03:33 <comexk> hey ehird
16:03:38 <ehird> hello.
16:04:28 <ais523> hi
16:04:33 * ais523 is not ehird but says hi anyway
16:04:37 <comexk> also, 'againt the wall'
16:04:42 <comexk> was that intentional? :p
16:04:45 <ais523> no idea
16:04:51 <ais523> I'm not even sure if it was in the original proposal or not
16:04:54 <ehird> yes. also, you want ##nomic or /msg <someone>
16:05:07 <comexk> no, this is ##nomic
16:05:16 <ehird> you're mistaken.
16:05:20 <comexk> since ehird isn't in the other nomic channel
16:05:29 <ehird> i'm sure everyone else will appreciate that.
16:05:31 -!- ehird has left (?).
16:05:47 <comexk> hehehe
16:06:00 -!- ehird has joined.
16:07:31 <ais523> ehird: but Wooble isn't an op here...
16:12:08 <comexk> oh, is that the problem?
16:12:16 <comexk> I thought e was just being a jerk
16:12:25 <ehird> can we keep #esoteric to vaguely esoteric topics?
16:12:35 <ehird> if you're trying to direct messages to me, IRC has a facility for that
16:12:57 -!- Hiato has joined.
16:12:57 <comexk> at the moment, I'm trying to direct messges to ehird and ais523
16:13:04 <comexk> as well as anyone else who is interested in nomic
16:13:09 <ais523> IRC has a facility for that, too, but freenode blocks it
16:13:11 <ehird> there's a channel for that
16:13:18 <comexk> which one?
16:13:20 <ehird> see, people join channels they want traffic to do with
16:13:23 <ehird> and leave ones they don't
16:13:24 <ais523> the syntax is /msg ehird,ais523 This is a message to send to two people
16:13:29 -!- Hiato1 has joined.
16:13:34 <ehird> generally, disrespecting this choice leads to people ignoring you
16:13:34 <ais523> [16:13] <-> ehird,comex> test
16:13:35 <ais523> [16:13] [407] PRIVMSG Too many recipients. Only 1 processed
16:13:44 <comexk> ehird: except you're ehird
16:13:52 <ehird> so, if you want to continue to be able to direct messages at me, I'll take the same course of action
16:13:54 <comexk> and generally overreact to things
16:13:57 <ehird> if you keep doing this
16:14:10 <ehird> comexk: you want to talk to me, you play by my rules. simple enough
16:14:10 <comexk> ah well, i can just ignore you
16:14:34 <ehird> that would solve both problems
16:14:34 <comexk> ehird: why are you playing nomic if you don't want to talk about nomic?
16:14:48 <ehird> who said I don't want to talk about nomic? I don't want to talk about nomic in irc in ##nomic.
16:14:57 <ehird> Email me or something. Or use /msg.
16:15:08 -!- comexk has left (?).
16:15:20 <ehird> How will I deal with this loss.
16:17:58 <oerjan> <AnMaster> ais523, should I put up something following the same implementation in C but that is sane
16:18:14 <oerjan> i think that may be a violation of the spirit of Deadfish. Or not.
16:19:20 <oerjan> <ehird> Agh, I ran into GreyKnight -again-
16:19:36 <oerjan> sure it's the same person? it's a fairly obvious nick...
16:20:04 <ehird> relatively
16:20:13 <ehird> well,.
16:20:14 <ehird> not so much now.
16:20:21 <ehird> oerjan: quite, though.
16:20:22 <oerjan> of course running into people on Agora, esolang and wikipedia isn't unheard of from before.
16:20:26 <ehird> because it has information about his kilt.
16:20:37 <ehird> I don't recall how I know he has a kilt from other sources
16:20:38 <ehird> but I do
16:21:05 <ehird> also, apparently he's a christian who has vowed, among other things, to "Refrain from cutting the hair on one's head".
16:21:07 <ehird> go figure.
16:21:32 <ais523> well, christians don't have do vow that AFAIK, but presumably there's nothing to stop them vowing that if they want to
16:21:36 <oerjan> huh
16:21:46 <ehird> ais523: part of the nazirite vow, apparently
16:21:49 <ehird> although that's a jewish thng
16:21:50 <ehird> *thing
16:22:00 <ehird> it is a good excuse to avoid cutting your head if you're a teen, I suppose
16:22:13 <oerjan> what a sikh thing to do
16:24:21 <AnMaster> oerjan, hm ok
16:24:28 <oerjan> <AnMaster> how does Deadfish behave on EOF?
16:24:47 <oerjan> i think there may be some bug there too...
16:29:30 <oerjan> <ehird> and ais523, ihope (iirc), oerjan, everyone
16:29:45 <oerjan> the rumors of my adminhood are _still_ exaggerated
16:30:10 <ais523> me and keymaker are the only Esolang admins who are active with admin work, IIRC
16:30:18 <ais523> and we're only active with it when there's actual admin work to do
16:30:19 <ehird> # (diff) (hist) . . Esolang:Community Portal‎; 19:18 . . (+9) . . Zzo38 (Talk | contribs) (tunes.org logs are now listed in descending order of date)
16:30:23 <ehird> clever guy, my idea is indeed good.
16:30:23 <ais523> which is nearly all cleaning up spam
16:30:32 <ehird> even tho I stole it from #concatenative
16:30:32 <ais523> and blocking the people responsible
16:30:50 <ais523> or more likely the zombies responsible
16:30:59 <oerjan> Brains...
16:31:09 * oerjan is a responsible zombie. Oh wait.
16:31:16 <ais523> ^bf ,[.,]!This may not be a good channel to take brains into
16:31:16 <fungot> This may not be a good channel to take brains into
16:31:20 <ehird> I had a sort-of-unique idea, based on INTERCAL and Forte.
16:31:24 <ais523> ehird: yes?
16:31:36 <ehird> Basically, it's all redefining language constructs.
16:31:47 <ais523> clever
16:31:51 <ehird> So, to terminate a loop, for instance, you change the loop end command into a nop.
16:31:53 <ehird> Things like that.
16:31:57 <ehird> And the whole language is based around that one operation.
16:32:21 <ais523> that's how I normally terminate short loops in INTERCAL nowadays too, but your language would presumably go much further
16:32:35 <ehird> yes
16:33:24 <ehird> ais523: I'm trying to figure out how to have actual computation if all you can do is remap constructs...
16:33:49 -!- Hiato has quit (Connection timed out).
16:33:57 <ais523> you may be able to use the constructs as a minsky machine
16:34:03 <ais523> Don't do "jump to the next line."
16:34:09 <ais523> Don't do "Don't do "jump to the next line.""
16:34:10 <ehird> ais523: you need a nop then
16:34:17 <ais523> Remove a copy of Don't do from the preceding line
16:34:27 <ehird> 10 goto 20 -> nop 20 ...
16:34:31 <ehird> you need goto and nop there
16:34:36 <ehird> that's two more non-swap primitives
16:34:42 <ais523> yes
16:34:44 <ehird> i want to bake the computation into the swapping, somehow
16:34:49 <ais523> well, nop is easily represented by 0 commands
16:34:56 <ais523> just replace a command with nothing
16:35:02 <ehird> ah
16:35:02 <ehird> yes
16:35:09 <ais523> that might be a little hard to reverse, but I'm sure there's a way
16:35:23 <ais523> as for goto, you need some way not to fall off the end of the program
16:35:24 <ehird> then with one more operator: "current remapped value of"
16:35:26 <ehird> we could do:
16:36:11 <ehird> ^10;^20/.^20;stuff.
16:36:15 <ehird> ^ is the current value of
16:36:19 <ehird> on its own in a statement, does nothing
16:36:21 <ehird> so we use it as line numbers
16:36:25 <ais523> ehird: what about ///?
16:36:28 <ehird> . is statement terminator, ; is subexpression terminator
16:36:29 <ais523> your language is reminding me of that
16:36:35 <ehird> problem is, it just cancels out the ^20
16:36:36 <ehird> not the stuff
16:36:39 <ehird> so:
16:36:52 <ehird> ^10;[^20;?]/.^20;stuff.
16:36:59 <ehird> erases the ^20 line
16:37:01 <ehird> more spacious:
16:37:10 <ehird> ^10; [^20; ?] / .
16:37:12 <ehird> ^20; stuff.
16:37:28 <ehird> pretty sure that's tc.
16:37:48 <ehird> the RHS of / is evaluated ofc
16:38:41 <ehird> ^10; [20;?] / ^[10;?].
16:38:41 <ehird> ^20.
16:38:44 <ehird> I think that's an imnp
16:38:45 <ehird> imp
16:38:46 <ehird> not sure
16:38:48 <ehird> hmm
16:38:50 <ehird> no
16:38:53 <ehird> you can't use ? in a [] ofc
16:41:13 <oerjan> <kerlo> He's not here, but I'm sure that message will find him eventually.
16:41:21 <oerjan> LIES
16:42:09 <ehird> I forgot what I was doing. :(
16:42:19 <oerjan> <kerlo> Area-preserving affine transformations preserve both of these.
16:42:46 <kerlo> Hey!
16:42:50 <oerjan> what they do not preserve, however, are rectangles not aligned with the ellipse axes
16:43:08 <ehird> What was I doing, ais523?
16:43:13 <ais523> area-preserving affine transformations are rotations, reflections, translations, enlargements in one direction combined with an equal contraction in the other direction, shears...
16:43:19 <ais523> and lots of others, I expect
16:43:26 <ais523> ehird: inventing an INTERCAL/Forte hybrid
16:43:41 <ehird> No, no, I lost interest in that about half way through and returned to my previous doings, which was X.
16:43:43 <ehird> What is X?
16:44:00 <ais523> you were discussing GreyKnight before that
16:44:23 <kerlo> oerjan: but those are trivial to enlarge.
16:44:35 <kerlo> So we can ignore those.
16:44:39 <oerjan> kerlo: they are?
16:44:53 <kerlo> Yes. Just rotate and enlarge them.
16:45:06 <ehird> ais523: Yeah, well, I didn't actually tell this channel.
16:45:08 <oerjan> um no...
16:45:18 <ais523> ehird: how am I meant to guess, then?
16:45:28 <kerlo> ais523: I find it likely that those are the only area-preserving affine transformations.
16:45:29 <ehird> Telepathy.
16:45:39 <ais523> sorry, I'm fresh out of floating eye corpses
16:46:00 <ais523> kerlo: well, combinations of those are clearly also area-preserving affine transformations
16:46:02 <oerjan> you cannot rotate in an ellipse
16:46:39 <oerjan> you have to change into a circle first, which destroys rectangles
16:47:25 <oerjan> of course i find it unlikely that a largest rectangle would _not_ be aligned with the axes, but it needs proof
16:52:16 <ehird> gcc -E $*
16:52:20 <ehird> Pop quiz: Spot the fuck up.
16:53:26 <ais523> something to do with quoting?
16:53:39 <ehird> Nope, gcc will ignore non-.c files as "linker input"
16:53:55 <ehird> KICK ASS OR WHAT?!?!?
16:54:24 <ais523> that's fixable
16:54:24 <ais523> -x c
16:54:33 <ehird> I'm just doing /usr/bin/cpp -no-traditional-cpp $*
16:55:20 <ais523> -x c is a nice trick to know anyway
16:55:38 <oerjan> * ais523 glares at paste.eso-std.org
16:55:50 <oerjan> wait, eso-std.org exists again?
16:56:25 <ehird> WAIT WHAT THE FUCK, /usr/bin/cpp is a SHELL SCRIPT
16:56:28 <ehird> that-is-not-right
16:56:32 <ehird> # Transitional front end to CCCP to make it behave like (Reiser) CCP:
16:56:33 <ehird> # specifies -traditional
16:56:34 <ehird> # doesn't search gcc-include
16:56:36 <ehird> #
16:56:38 <ehird> # Copyright (c) 1990 The Regents of the University of California.
16:56:40 <ehird> # All rights reserved.
16:56:43 <oerjan> hm apparently not
16:56:44 <ehird> ha ha ha ha ha ha ha ha ha ha ha ha what the flying fck
16:56:45 <ehird> *fuck
16:56:53 <ehird> ais523: That's not right, is it.
16:57:32 <ehird> *Something* has shat all over my /usr/bin/cpp, methinks.
16:57:57 <ehird> ...nope, that's /Developer/usr/bin/cpp
16:58:11 <oerjan> ehird: they're trying to make it a killer app, i see
16:59:14 * oerjan is expecting bodily harm just about now
16:59:18 -!- ais523_ has joined.
16:59:27 <kerlo> oerjan: you can do whatever you want in an ellipse.
16:59:50 <kerlo> If you have a rectangle in an ellipse and their axes are aligned, that rectangle's corners do not all lie on the ellipse.
16:59:53 * oerjan swats kerlo -----###
16:59:58 <ehird> #!/bin/sh
16:59:58 <ehird> # apple's cpp is broken...
16:59:59 <ehird> # Update 2009-03-04: FUCK YOU APPLE PIECES OF SHIT
17:00:02 <ehird> The evolution of a file header.
17:00:18 <ehird> It works now. How unexpected.
17:00:32 <kerlo> It's easy enough to rotate a rectangle such that its two corners remain on the ellipse; you just have to scale it at the same time.
17:00:40 <oerjan> kerlo: by aligned i mean simply in direction
17:01:11 -!- ais523 has quit (Nick collision from services.).
17:01:14 -!- ais523_ has changed nick to ais523.
17:02:03 <kerlo> Me too.
17:02:03 <oerjan> kerlo: while preserving area?
17:02:33 <oerjan> kerlo: oh wait you were missing a "not"
17:02:38 <oerjan> or so i think
17:02:59 <kerlo> Not while preserving area, no.
17:03:28 <kerlo> What I'm saying is that the biggest rectangle you can fit in an ellipse is aligne with the ellipse.
17:03:42 <oerjan> kerlo: needs proof
17:04:30 <oklopol> well clearly that's the beautiful answer you'd expect.
17:04:49 <oklopol> so why prove it and risk ruining it
17:04:53 <kerlo> Suppose you have a rectangle that is in an ellipse and not aligned with the ellipse. It is possible to rotate the rectangle so that it is aligned with the elipse; upon doing so, it will be possible to make the rectangle bigger while remaining in the ellipse. Contradiction. Q.E.D.
17:05:02 <oklopol> err
17:05:05 <oklopol> where's the proof :D
17:05:29 <oerjan> kerlo: it's the remaining in the ellipse part that needs some proof
17:06:06 <kerlo> You prove it, then. :-P
17:06:12 <oerjan> too lazy :D
17:06:20 <oklopol> oerjan: adding enough formality will prove anything.
17:06:34 <oklopol> kerlo: um, unwrap definitions and you'll probably have it directly
17:06:53 <kerlo> That's nice.
17:07:08 <oerjan> i am assuming it would require some length calculations or something
17:07:30 <oklopol> basically you calculate the expression of the rectangle's area and find the zero of the derivative, prolly.
17:08:00 <oklopol> and by that expression i mean f(x) : angle -> area
17:08:11 <oerjan> which may not be hard, but rather diminishes the elegance of transforming to a circle afterwards
17:08:31 <oklopol> well i have no idea about context, i just found kerlo's statement funny :P
17:08:37 <oklopol> and now i need to go do a shoppe!
17:09:02 <oerjan> oklopol: just don't get caught
17:09:58 <oklopol> onion rings!
17:10:01 <oklopol> !!!
17:10:02 <oklopol> ->
17:10:33 -!- ais523 has quit (Read error: 104 (Connection reset by peer)).
17:10:39 <ehird> How do you trap overflow on x86?
17:10:47 <oerjan> when onion rings, don't answer
17:11:37 -!- ais523 has joined.
17:11:41 <ehird> hi ais523
17:11:45 <ehird> i don't suppose you would know:
17:11:46 <ehird> How do you trap overflow on x86?
17:11:54 <ais523> I don't know offhand
17:12:05 <ais523> but based on my experiences of x86, I'd guess "with difficulty"
17:12:05 <ehird> can you even do it?
17:19:26 <ehird> I wonder how to allocate huge things (1gb) on the stack with alloca
17:19:38 <ais523> probably you can't, is the stack that big?
17:20:03 <ehird> i guess not.
17:20:24 <ehird> wow, my malloc() returns surprisingly clean results. like 0x200000
17:21:42 <ehird> ais523: is there any way to expand the stack?
17:21:47 <ais523> depends on the OS
17:22:01 <ehird> bsd
17:22:03 <ais523> you need to map in more memory in the address space it expands into
17:22:13 <ais523> and I don't know whether that's possible or not on BSD
17:22:15 <ais523> nor how
17:22:23 <ais523> hmm... are you working on that INTERCAL VM?
17:22:31 <ais523> it sounds like it, based on what you're saying
17:22:31 <ehird> not right now
17:24:04 <oerjan> <ehird> Tom Duff.
17:24:19 <oerjan> he did quite a bit on the wiki on esolang history iirc
17:24:58 <ais523> writing about pre-INTERCAL esolangs, IIRC
17:31:44 <ehird> ais523: so, how do you do it in linux?
17:32:07 <ais523> I don't know that either
17:32:11 <ehird> :<
17:44:56 <oerjan> hm synchronicity
17:45:08 <ehird> oerjan: itym coincidence
17:45:12 <oerjan> Grey Knight is on wp Did you Know
17:45:18 <oerjan> whatev
17:45:31 <oerjan> *knight
17:45:37 <ehird> ha
17:46:08 -!- ais523 has quit (Read error: 60 (Operation timed out)).
17:48:07 <oerjan> oh and the third one is about broken femurs, which were _also_ mentioned in the channel logs today :D
17:48:39 -!- ais523 has joined.
17:49:04 <ehird> "The first time I saw a program written in Forth, I thought the developer was just making up the language as he went along. Then I discovered that he was."
17:49:09 <ehird> — reddit
17:49:15 <ais523> haha
17:50:02 <oerjan> that would apply to any language suitable for DSELs...
17:50:03 <Deewiant> ( http://www.reddit.com/r/programming/comments/8210z/forth_is_a_program_that_interfaces_keyboards_with/ )
17:50:14 <oerjan> er, EDSL?
17:50:21 <ehird> ESDLs
17:50:22 <ehird> but no
17:50:23 <ehird> forth is more fluid
17:50:24 <Deewiant> same difference
17:50:32 <ehird> you can't get rid of lisp's parentheses, but you can turn forth into anything
17:50:51 <Deewiant> sure you can get rid of lisp's parentheses
17:50:58 <ehird> not in r5rs.
17:50:59 <Deewiant> (interpret-my-language "................................................")
17:51:05 <ehird> that is not extending the language.
17:51:07 <ehird> that's not embedded.
17:51:53 <Deewiant> it's embedded in a sense, you could call stuff from the outer scope from in there
17:52:01 <ehird> no, it's really not.
17:52:06 <oerjan> hm the french term would have LSD in it, i'm sure
17:53:25 <Deewiant> Is there a sensible and generally accepted definition for what exactly a DSEL is anyway
17:53:49 <ehird> your put lol
17:54:31 <oerjan> ehird: er?
17:54:43 <ehird> I meant to say your butt lol.
17:54:46 -!- ais523 has quit (Read error: 60 (Operation timed out)).
17:55:09 -!- ais523 has joined.
17:56:04 <oerjan> ehird: ESDL gives all sorts of other meanings
17:56:17 <ehird> i meant EDSL
17:56:44 <oerjan> oh that actually gives a hit
17:56:46 <lament> DSEL is a buzzword
17:57:04 <oerjan> although there are still other meanings
17:57:10 <lament> it means, "I'm too cool for things like OOP but I still want my own acronyms"
17:57:58 <oerjan> oh DSEL is also defined
17:58:28 <ais523> ITCFTLOBISWMOA?
17:58:33 <oerjan> it's short for "acronym we cannot decide on the ordering of"
17:58:47 <ais523> AWCDOTOO sounds interesting, actually
17:59:11 * ais523 wonders what language-specific embedded domains are
18:00:14 <oerjan> bah the french term for domain specific language is "Langage dédié"
18:00:46 <oerjan> clearly someone censored the s part
18:08:35 <tombom> interesting
18:09:56 -!- jix_ has joined.
18:13:05 -!- M0ny has quit ("Quit").
18:15:19 -!- ais523 has quit (Read error: 104 (Connection reset by peer)).
18:23:12 -!- jix has quit (Read error: 110 (Connection timed out)).
18:38:53 -!- jix_ has quit (Read error: 60 (Operation timed out)).
18:42:55 -!- jix has joined.
19:05:21 <AnMaster> hi Deewiant
19:05:47 <Deewiant> yello
19:05:52 <AnMaster> hah
19:06:18 <AnMaster> Deewiant, see the comments I made directed at you during the past few weeks but that you never responded to
19:06:38 <Deewiant> there was nothing worth responding to :-P
19:06:46 <Deewiant> yay, cfunge almost runs on BSD, or something
19:06:48 <Deewiant> what should I say to that
19:10:20 -!- ais523 has joined.
19:11:46 <Deewiant> FILE lacks a way to truncate files: yes, it does, complain to mike if you feel something should be done
19:11:57 <Deewiant> nothing else, I guess
19:18:50 <ehird> http://drplokta.livejournal.com/109267.html
19:18:52 -!- jix_ has joined.
19:33:10 -!- jix has quit (Read error: 113 (No route to host)).
19:42:36 -!- olsner has joined.
19:50:38 <ehird> so!
19:50:41 <ehird> I'm writing a Forth in JS.
19:50:48 <ehird> Badly suited, you say? Quite so my good chap!
19:51:40 <oerjan> badly suited for forth, forsooth
19:52:36 <ehird> ais523 did a lot of interpreters in JS, I imagine he'd like it
19:53:06 <ais523> that's because JS is a good lang for quick throwaway programs that you can easily show to other people
19:53:11 <ais523> most people have a JS interp on them
19:53:21 <ais523> also, it's by far my favourite lang for programming in on public terminals
19:53:30 * oerjan picks his nose and pulls out a JS interp
19:54:07 <oerjan> 'snot what you think, honestly
19:54:48 <ehird> >_<
19:55:06 <oerjan> i blame picasso
19:59:31 * FireFly likes JS
19:59:58 -!- jix has joined.
20:01:30 <ehird> hmm
20:01:50 * oerjan likes swatting FireFly -----###
20:01:58 * FireFly dislikes swatters
20:02:18 <FireFly> Is that a swat I see, or what?
20:02:26 * oerjan confuses FireFly by making a JS swatter
20:02:32 <FireFly> :|
20:02:51 -!- jix_ has quit (Read error: 145 (Connection timed out)).
20:06:38 -!- jix has quit (Read error: 60 (Operation timed out)).
20:07:29 <ehird> hmm
20:07:37 <ehird> how big should my stack/heap/dictionary be, I wonder.
20:07:46 <ehird> well, return stack can be smaller than data stack
20:07:52 <ehird> i onl yhave 64mb to work with here
20:08:04 <ehird> dictionary will probably be tiny, let's say 5MB
20:08:05 <Deewiant> why not more
20:08:14 <ehird> Deewiant: you can't allocate too much with JS
20:08:16 <ehird> it just fails silently
20:08:29 <Deewiant> Surely that depends on your interpreter
20:08:33 <ehird> well, duh
20:08:36 <ehird> I'm running it in a browser
20:08:50 <Deewiant> Ah, that'd explain it now wouldn't it :-P
20:08:57 <Deewiant> Consider not doing so
20:09:12 <ehird> no, that's the whole point
20:09:22 <Deewiant> Okay, fine then
20:11:56 <ehird> dictionary 8MB
20:11:57 <ehird> return stack 8MB
20:11:58 <ehird> data stack 16MB
20:12:00 <ehird> heap 32MB
20:12:02 <ehird> seems reasonable to me
20:15:03 -!- clog has quit (^C).
20:15:03 -!- clog has quit (ended).
20:15:14 -!- clog has joined.
20:15:14 -!- clog has joined.
20:15:21 <ehird> ... clog just got ^C'd?
20:15:23 <ehird> wtf bbq
20:15:29 <ehird> nef is ALIVE?!
20:15:47 <Deewiant> Should he be dead?
20:16:04 <ehird> I haven't heard anything about him later than 2004
20:16:57 <ehird> 20:16 ehird: I was starting to think clog was running totally autonomously there for a few years ...
20:16:57 <ehird> 20:16 nef: it was
20:20:42 <ehird> and he's offline again
20:20:45 <ehird> *poof*
20:26:28 <lament> which channel was that
20:41:11 -!- Hiato1 has quit (Connection timed out).
20:57:23 <ehird> lament: /mag
20:57:26 <ehird> /msg
21:06:27 <ehird> Grah, nul-terminated strings are so stupid.
21:08:14 <oerjan> a bit too granular
21:11:06 <ehird> was that a pun
21:11:21 <oerjan> well, do you think it was groanular?
21:12:23 <ehird> 'Nantero built a functioning carbon nanotube memory prototype 10 GB (10 × 230 bytes) array in 2004."
21:12:26 <ehird> why did nobody tell me about this
21:12:31 <ehird> i want one, now
21:15:54 <ehird> hmm
21:16:03 <ehird> why is memory measured in bytes if you address words with it
21:16:05 <ehird> that's just ridiculous.
21:17:50 -!- oerjan has quit ("The time travelers said we should try to delay ehird finding it out as long as possible").
21:18:06 <ehird> no seriously, maybe ais523 knows.
21:18:36 <ais523> it's for advertising / comparison purpose
21:18:46 <ais523> people doing that sort of thing use inappropriate units just because of inertia
21:18:52 <ais523> if everyone's using units, so do you
21:18:55 <ehird> mm
21:19:02 <ehird> i just, stupidly, did this:
21:19:04 <ehird> var mm = new Array(8388608); // 8MB
21:19:07 <ehird> spot the bug
21:19:34 <ais523> hmm... did you get the number wrong?
21:19:42 <ais523> or are arrays not declared like that
21:19:46 <ais523> wow, my javascript's got rusty
21:19:55 <ehird> ais523: memory is an array of words
21:20:01 <ehird> 8388608 is 8MB measured in _bytes_
21:20:05 <ais523> aha
21:20:14 <ais523> well, javascript arrays auto-extend anyway
21:20:23 <ehird> yes, but in this case I'm trying to pre-allocate the whole heap
21:20:24 <ais523> so the bug won't be noticeable except in making things slightly less efficient
21:20:26 <ehird> ais523: and that -over- allocates
21:20:39 <ehird> new Array(4194304) // this is correct
21:21:17 <ehird> err, no
21:21:22 <ehird> 2097152
21:21:23 <ehird> ofc
21:25:33 <fizzie> Well, it's not like we can know your word size here.
21:25:42 <ehird> it's a VM
21:25:46 <ehird> so 32-bit, so 4 bytes
21:26:34 <fizzie> I don't think "VM" implies "32-bit".
21:27:01 <Deewiant> I know it doesn't!
21:27:08 * kerlo writes a 31-bit Subleq interpreter
21:28:06 <ehird> fizzie: I mean
21:28:09 <ehird> "your word size"
21:28:11 <ehird> I control the word size
21:28:24 <fizzie> Yes, and we can't know what you control it to.
21:28:26 <Deewiant> The "so" in 32-bit is still misplaced
21:28:57 -!- tombom has quit (Client Quit).
21:30:18 <kerlo> I think C would be a very appropriate language for a Subleq interpreter.
21:30:39 <ehird> No, Forth.
21:30:57 <kerlo> All you do is allocate a chunk of memory and then use pointers.
21:31:04 -!- jix has joined.
21:31:07 <ehird> Forth cuts out the allocation step.
21:32:36 <kerlo> Bonus: Let the Subleq programs refer to the locations of C functions, the stack, and so on.
21:32:55 <ehird> Forth gives you that for free.
21:33:22 <kerlo> Is there anything Forth can't do?
21:35:16 <ehird> kerlo: Make you toast.
21:35:32 <ehird> But, yeah, if you just use @ and ! you get the native machine/Forth memory.
21:44:31 -!- atrapado has joined.
21:45:37 <oklopol> '
21:48:57 <oklopol> heh, turns out that incredibly terrible fail of mine was 87.5 percent :P
21:49:20 <ehird> oklopol: lol
21:49:30 <ehird> oklopol: still angry about it? :P
21:50:52 <oklopol> how could i not be angry about having 3 out of 41 ppl get a better score than me!
21:51:14 <ehird> 87% would still count as 5/5 though right
21:51:54 <oklopol> i think so.
21:55:17 -!- jix has quit ("...").
22:27:17 -!- comexk has joined.
22:27:46 <comexk> So, anyone know how I can find out the CPU cache size and whether all my code will fit into it?
22:28:45 <ais523> it'll be on the datasheet for processors, which you should be able to get from the manufacturer, most give them away free
22:28:56 <ehird> comexk: are you optimizing Bayes?
22:28:58 <ais523> I'm not sure if there's a way to work it out from the OS itself
22:29:31 <comexk> not some embedded system, a nice big core 2 :p
22:29:41 <ehird> what are you trying to do
22:29:56 <comexk> you see, I got an assignment in java class to make a Morse Code translator as efficient as possible
22:30:09 <ehird> erm, the whole JVM would have to fit into the cache, then
22:30:14 <comexk> after I decided I couldn't make it fast enough in java, I used JNI to implement it in C
22:30:27 <ehird> I suspect you'll get deducted marks for that...
22:30:32 <comexk> hey, it's java
22:30:32 <comexk> anyway
22:30:35 <ais523> "as efficient as possible" is something you shouldn't say within range of an esoprogrammer
22:30:41 <comexk> ais523: except that's what I mean
22:30:52 <comexk> though I don't want to write it in assembly (and I doubt I would gain much from that)
22:30:54 <ais523> comexk: is there any way to do Java with inline asm?
22:30:59 <ais523> there's definitely no standard or sane way
22:31:03 <ais523> but surely there must be some way
22:31:03 <ehird> ais523: he's using JNI
22:31:05 <comexk> actually, there is a standard and a sane way
22:31:08 <ehird> that's just C<->Java interface
22:31:11 <ehird> he's writing it in C
22:31:12 <ais523> ah
22:31:13 <ehird> then binding it to java
22:31:16 <ehird> and claiming it's java
22:31:25 <ais523> I thought he was writing in java and compiling to C, and claiming it was java
22:31:27 <ehird> thus getting his answer marked as wrong...
22:32:05 <comexk> naah
22:32:13 <comexk> any sane grader will mark it correct
22:32:14 <ehird> 's what I would do
22:32:27 <comexk> it can be called from a java class just like any java code
22:32:28 <comexk> ANYWAY
22:32:29 <comexk> don't care
22:32:31 <ais523> did they state which java implementation had to be used?
22:32:32 <comexk> I want to optimize the c
22:32:45 <ais523> using gcj rather than the jvm should save you a lot of time if you write the code to be properly optimisable
22:32:48 <ehird> "How can you optimize this Python application?" "I rewrote it all in C then bound the main to python, so now it looks like this: app.main()"
22:32:51 <ehird> "Uh, no."
22:32:52 <ais523> and only do things that translate easily into C
22:32:59 <comexk> ehird: ever heard of cython?
22:33:12 <ehird> comexk: considering I told you about cython...
22:33:15 <ehird> plus, cython isn't python
22:33:16 <comexk> ais523: really, it compiles to native code?
22:33:20 <ehird> its an extension of python
22:33:22 <comexk> ehird: point
22:33:26 <comexk> I used it recently
22:33:29 <ais523> comexk: yep
22:33:32 <comexk> the native python MutableString implementation is hellslow
22:33:45 <comexk> ais523: I'm using JNI because I want efficiency. That's that.
22:33:45 -!- oklopol has quit (Read error: 104 (Connection reset by peer)).
22:34:00 -!- oklopol has joined.
22:34:03 <comexk> ...because it allocates a new string every time your string is modified
22:34:45 <ehird> comexk: so use a list
22:34:59 <comexk> ehird: and have a PyObject for every character in the string!?
22:35:08 <ehird> why are you using python
22:35:10 <comexk> naah, that was a perfect use case for Cython, which worked pretty well
22:35:10 <ehird> just code it all in C
22:35:16 <comexk> massive speed increase
22:35:23 <comexk> as in, 20 minutes --> 20 seconds
22:35:30 <comexk> (it used mutalestrings a lot)
22:35:34 <ehird> if you're writing in python and want a speed increase, start by rewriting the python interpreter because it's a shit naive bytecode interpreter
22:35:47 <comexk> ehird: good point, people do that, too bad nob ody's actually made a good python interpreter
22:35:58 <comexk> although 20 seconds is with psyco.full()
22:36:05 <comexk> but the code isn't optimized for speed
22:36:09 <comexk> the python is fairly naive
22:36:17 <ehird> python itself does not lend itself to efficiency
22:36:33 <comexk> yeah, but you can, e.g., not create massive amounts of objects
22:36:57 <ehird> if you want to write in a HLL and get blazing efficiency, i'd use Scheme + Stalin
22:37:19 <comexk> In a number of tests it has outperformed hand-written C, sometimes by a considerable margin.
22:37:22 <comexk> hmm
22:37:32 <comexk> well
22:37:32 <comexk> http://pastie.org/407681
22:37:33 <ehird> or rather Ponzi, which would be like stalin without the huge limitations but I haven't written it yet.
22:37:44 <comexk> tell me how that can be improved
22:37:46 <ehird> comexk: that's not optimized!
22:37:48 <ehird> use a lookup table
22:38:12 <comexk> ehird: what would that do
22:38:18 <ehird> be fast.
22:38:23 <comexk> lookup table of what?
22:38:24 <comexk> hashes?
22:38:29 <comexk> that would be slower
22:38:33 <ehird> no
22:38:33 <ehird> listen
22:38:41 * comexk listens
22:38:42 <ehird> comexk: key them by integers: a machine word can store 4 characters on a 32 bit machine
22:38:44 <ais523> presumably because the Scheme programs are written better than the C-by-hand would be
22:38:51 <ehird> you can actually do that
22:38:56 <ehird> and compare them natively
22:39:01 <ehird> with no overhead
22:39:07 <comexk> hey, that's a good idea
22:39:09 <ehird> lemme find the article showing how
22:39:24 <comexk> forgot about that -_-
22:39:40 <ais523> comexk: the binary if/else if thing is slow in practice because modern processors are really quite bad at jumps compared to everything else
22:39:50 <ehird> comexk: http://www.stdlib.net/~colmmacc/2009/03/01/optimising-strlen/
22:39:54 <ehird> see "Method 4: word-wise checks"
22:39:57 <ehird> and the glibc code it links to
22:40:08 <ehird> from that, you should be able to make an insanely fast lookup table version
22:40:10 <comexk> I've sen hellishly complex implementations of, say, memcpy
22:40:42 <ais523> well, on some processors, the best known memcpy implementation in asm is duff's device and copying 4 or 8 bytes at a time
22:40:44 <ais523> which is pretty complex
22:40:56 <comexk> ais523: on ARM I've seen
22:41:02 <comexk> first, try to use load multiple instructions to copy like 8 bytes at a time
22:41:05 <comexk> then copy words
22:41:06 <comexk> then copy bytes
22:41:09 <ais523> haha
22:41:15 <comexk> and I had to disassemb le the function and see what it did
22:41:17 <comexk> :p
22:41:51 <ehird> but yah, lookup table (nest them if you have keys longer than 4 bytes on 32-bit or 8 on 64-bit, ofc) of word-sized chunks of the string
22:41:53 <ehird> == insanely fast
22:42:01 <comexk> I don't know, are you sure that's faster? you'd have to check every combination linearly
22:42:06 <ehird> err, no
22:42:08 <comexk> what do you mean lookup table
22:42:09 <ehird> lookup table
22:42:24 <comexk> luckily, all morse code characters fit in 32 bits
22:42:24 <comexk> but
22:42:32 <ehird> comexk: a hash table, but indexed with machine words
22:42:34 <ehird> not hashes
22:42:37 <comexk> though that runs into endian issues
22:42:37 <ehird> comexk: also, mayhaps operate on java Strings, not char*
22:42:45 <ehird> to avoid the conversion overhead
22:43:32 <comexk> ehird: are you sure a hash table with only 26 entries would be faster than branching?
22:43:47 <ehird> not hash table
22:43:51 <ehird> you're not running any hash functions
22:43:52 <comexk> not hash table
22:43:54 <comexk> I know
22:43:59 <ehird> you're indexing on *((int *)str)
22:44:04 <comexk> but that requires memory loads
22:44:10 <comexk> doing it directly as in the pastie doesn't
22:44:15 <ehird> comexk: processors are terrible at branching.
22:44:20 <ehird> also, yours accesses memory
22:44:23 <ehird> s[0], s[1], s[2], ...
22:44:28 <ehird> at least this does one access
22:44:30 <ehird> yours does tons
22:45:12 <comexk> ehird: only as many as necessary, but I meant you would have to access the table from memory
22:45:23 <ehird> store it as a constant, static array
22:45:27 <ehird> then it'll go into the object file
22:45:31 <comexk> that doesn't make it not memory...
22:45:52 <ais523> comexk: a memory load on a bit of memory that was in cache anyway is really quite fast
22:46:11 <ais523> so the well-known trick is to store your lookup table in the same bit of memory in the program that's running
22:46:25 <ais523> you can do that by using inline asm for dat commands
22:46:49 <ais523> ehird: what I'm suggesting is your method but slightly more insane, it's a special case of your method
22:46:54 <comexk> that and casting bytes to ints limit me to i386 but that's okay I guess
22:47:04 <ehird> ais523: yes, but I'd try mine first
22:47:05 <ehird> then go to asm
22:47:06 <comexk> it makes me nervous, since this is supposed to be portable java
22:47:15 <ehird> comexk: you failed by doing it in C anyway
22:47:18 <comexk> but I guess there could be a pure c fallback
22:47:18 <ehird> also, you can be portable.
22:47:21 <comexk> ehird: c is portable
22:47:23 <comexk> ehird: endian
22:47:24 <ehird> what's not portable about *((int*)s)
22:47:24 <ais523> well, dat commands are relatively portable between architectures
22:47:30 <comexk> ehird: endian
22:47:36 <ehird> comexk: so, in you lookup table do
22:47:44 <ehird> *((int*)".-.-")
22:47:47 <ehird> instead of 3485783457345
22:47:52 <ehird> (in the literal)
22:47:52 -!- atrapado has quit ("Abandonando").
22:47:57 <comexk> does that actually work?
22:48:02 <ehird> why not
22:48:21 <ehird> comexk: you'll probably have to nest the tables
22:48:27 <ehird> since there are morse code patterns longer than 4 bytes, right?
22:48:42 <comexk> no
22:48:46 <ehird> oh
22:48:50 <ehird> then that'll work fine
22:48:52 <comexk> as I said, it's well suited for that
22:48:55 <comexk> although 64-bit processors
22:49:04 <comexk> only problem is that
22:49:07 <comexk> what if you have
22:49:09 <ais523> the longest morse code pattern is 5 dots+dashes
22:49:14 <ehird> ais523: agh
22:49:16 <comexk> ais523: really? which one
22:49:16 <ehird> one off
22:49:20 <ais523> comexk: 5
22:49:28 <comexk> letters only.
22:49:34 <ais523> but notice that a dot/dash needn't store an entire byte
22:49:53 <comexk> but there is a problem with a lookup table
22:50:01 <comexk> if your letter is E
22:50:03 <comexk> you might have
22:50:05 <comexk> ". --"
22:50:07 <comexk> ". . "
22:50:09 <comexk> ". .."
22:50:10 <comexk> etc
22:50:21 <ehird> comexk: well, you know the string length ,right?
22:50:24 <ehird> it's a java String
22:50:28 <ehird> so getting the length is O(1)
22:50:35 <comexk> yes, but there are multiple letters
22:50:35 <ehird> then, just do
22:50:37 <comexk> separated by spaces
22:50:38 <ehird> (>>4)<<4
22:50:43 <ehird> or w/e
22:50:47 <ehird> so you get 0s instead of the rest
22:50:48 <ehird> before lookup
22:50:52 <comexk> ehird: but some patterns are 4 characters
22:50:57 <ehird> comexk: and?
22:51:09 <comexk> so length has nothing to do with it
22:51:11 <comexk> I have to find the space
22:51:21 <comexk> but I'm doing that anyway
22:51:22 <comexk> so fine
22:51:23 <comexk> I'll do that
22:51:40 <ehird> err
22:51:41 <comexk> other thing is
22:51:46 <ehird> if you find the space then there's no reason to do this
22:51:46 <comexk> I'm doing a binary search, aren't I?
22:51:52 <ehird> because that's inefficient
22:51:57 <comexk> *((char *) is portable but they wouldn't be in order in a different endian
22:52:04 <ehird> s/char/int/
22:52:07 <comexk> ehird:?
22:52:10 <comexk> yeah
22:52:14 <ehird> and that's why you don't put any endian-specific constants in
22:52:18 <ehird> i don't think you "get" this
22:52:26 <comexk> ehird: the idea would be to have it pre-sorted
22:52:35 <comexk> so I don't have to go through the table linearly
22:52:48 <ais523> I've written efficient morse decoders before
22:52:51 <comexk> well, let's try it
22:53:04 <ais523> the trick is to start with 1, and double every character you encounter, adding one if it's a dash not a dot
22:53:04 <ehird> comexk: ...
22:53:07 <ehird> there is no table
22:53:09 <ehird> just an array
22:53:15 <ais523> and use the total as an index into an array that retrieves your character
22:53:21 <ehird> you calculate all the values in words for the dotdashes
22:53:26 <ehird> then modulo them all 26
22:53:30 <ehird> and store them in an array, without the key
22:53:34 <ehird> just the value
22:53:43 <ais523> ehird: what do you mean by "value" here?
22:53:54 <ehird> the resulting letter
22:54:07 <comexk> ehird: hmm?
22:54:12 <ehird> like, static const char foo[] = "ZCBAFU...";
22:54:17 <comexk> my value might be very big, I can't have the _word_ as an index
22:54:30 <comexk> yeah, and then I have another array of the words
22:54:42 <comexk> ais523's suggestion might be faster
22:54:44 <ehird> do you know what a word is
22:54:44 <ehird> x_x
22:54:57 <comexk> ehird: four bytes, or two bytes sometimes
22:55:03 <comexk> or eight sometimes :p
22:55:10 <ehird> i'm really starting to doubt you actually understand the algorithm I'm trying to explain
22:55:15 <comexk> ehird:
22:55:22 <ehird> comexk:
22:55:28 <comexk> u32[] keys
22:55:30 <comexk> char[] values
22:55:34 <comexk> look up in keys, use the index into values
22:55:40 <comexk> if that's not it, you're not explaining clearly enough
22:55:41 <ehird> ...
22:55:43 <ehird> fuck no.
22:55:54 <comexk> then be clearer
22:55:57 <ehird> damn, I just wasted like 15 minutes attempting to explain that. have fun
22:56:24 <comexk> I don't think you know what you're talking about
22:56:41 <ehird> remind me not to try and help you again
22:57:25 <comexk> *sigh*
22:57:46 <ehird> so hey, anyone want help that can understand english & technical terms and doesn't tell me I don't know what i'm talking about when they don't understand?
22:57:57 <lament> ehird: sure
22:58:05 <ehird> excellent. how can I help you today.
22:58:50 <lament> ehird: Я буду играть на прослушивании в следующий вторник, как мне лучше подготовится?
22:58:55 <ehird> yes.
22:59:12 <ehird> if the question was, "are you fat?", no.
22:59:28 <comexk> ah, nice
23:00:41 -!- Slereah_ has quit (Read error: 60 (Operation timed out)).
23:01:30 <FireFly> Hm
23:03:28 -!- Slereah has joined.
23:06:39 <comexk> so ais523, what were you saying about inline data?
23:06:51 <ehird> it depended on my idea.
23:06:54 <ehird> which you've rejected
23:07:00 <comexk> if so, I support your idea
23:07:09 <comexk> I merely think you failed to explain it clearly
23:07:12 <ais523> well, the idea's you have an array with the possible translations
23:07:20 <ais523> a char array, probably
23:07:22 <ehird> comexk: you know how a hash table works?
23:07:29 <ais523> you work out a mathematical value from each dot-dash string
23:07:32 <ehird> it's an array, where [hash%size]
23:07:34 <ehird> is the value
23:07:36 <ehird> now, do the same
23:07:39 <ehird> but with
23:07:40 <ais523> ehird: this is not exactly a hash table
23:07:44 <ehird> ais523: i know
23:07:46 <ais523> definitely you don't want %26
23:07:48 <ehird> i'm explaining it to him
23:07:51 <ehird> also, yes you do...
23:07:54 <ais523> you don't want %anything, in fact, you want a perfect hash
23:07:54 <ehird> otherwise your array is huge
23:07:57 <comexk> no you don't, because you will have duplicates
23:07:59 <ais523> ehird: 64 bytes?
23:07:59 <ehird> it is perfect
23:08:01 <comexk> however, I tested and %59 works
23:08:02 <ais523> I wouldn't call that huge
23:08:06 <ehird> well, fine
23:08:08 <ehird> that isn't what i meant
23:08:20 <ais523> comexk: dividing by 59 is rather slow on a modern computer compared to other operations, apart from jumps
23:08:35 <comexk> ais523: really? so I would be better off with an evener number?
23:08:36 <ehird> use >>
23:08:40 <ehird> power of 2
23:08:53 <ehird> the thing is
23:08:55 <ehird> it's not a perfect hash
23:08:56 <ehird> it's not a hash
23:09:02 <ehird> it's the literal char data interpreted as a word
23:09:24 <ais523> it is a hash, per the definition of hash, it's just that it's a hash that doesn't contain a modulo interpretation whereas most do
23:09:28 <ais523> ehird: oh, I wasn't doing it like that
23:09:34 <ehird> ais523: that's the whole idea
23:09:37 <ehird> you skip the hashing step
23:09:40 <ehird> and just do *((int*)s)
23:09:45 <ehird> that's the whole key to why it's so fast
23:09:48 <ais523> I was unrolled-looping over each character in the input
23:09:57 <comexk> oh god unrolled
23:09:58 <ehird> yeah, that's entirely missing the point
23:09:59 <ais523> add, shift, add, shift, etc
23:10:04 <ais523> that is different from your method
23:10:06 <comexk> yeah, that's not what I'm doing
23:10:07 <ais523> but it may be faster
23:10:07 <ehird> *((int*)s) reduces it to one memory read
23:10:20 <ais523> 5 adds and 4 shifts is 9 memory reads not 1, I agree
23:10:28 <ais523> on the other hand, I think 9 reads are faster than 1 integer divid
23:10:29 <comexk> ehird: yeah, so I have an int corresponding to four bytes, and unique codes correspond to unique values
23:10:30 <ais523> *divide
23:10:33 <comexk> ehird: now what
23:10:35 <ehird> ais523: yes, but not >>
23:10:43 <ais523> heh, that's the trick
23:10:47 <ais523> you don't do a <<= 1;
23:10:48 <ehird> so (*((int*)s))>>foo
23:10:49 <ais523> you do a += a;
23:10:52 <ais523> and a will be in a register
23:10:56 <ais523> that's a one-cycle instruction
23:11:05 <ehird> how does that help moduloing it
23:11:13 <ehird> we're trying to fit it into a non-huge table
23:11:14 <ais523> you don't modulo, the numbers this way never end up more than 64
23:11:16 <comexk> problem is, I can't modulo by a power of two because then it'll just depend on the first bytesish
23:11:19 <ais523> so you just have a 64-element table
23:11:26 <comexk> ais523: is that really faster than one modulo?
23:11:32 <ehird> ais523: well, does it use the (int*)s trick?
23:11:36 <ais523> ehird: no
23:11:38 -!- Judofyr has quit (Remote closed the connection).
23:11:39 <ehird> it should
23:11:46 <ais523> why? that would make the numbers much too large
23:11:51 <ehird> i'm relatively certain (75%) it'd be faster
23:11:56 <ehird> ais523: so reduce them
23:11:59 <comexk> ais523:
23:12:02 <ais523> if you preferred, you could use the int* trick then /multiply/ by a large number
23:12:03 <comexk> is that faster than a single modulo?
23:12:07 <comexk> maybe I can use a multiplication trick
23:12:10 <ehird> ais523: ah, that'd be best
23:12:10 <ais523> that shifted all the bits to the bottom end of the number
23:12:18 <ais523> I think repeated addition on bits may still be faster
23:12:18 <ehird> (*(int*)s)<<foo
23:12:24 <comexk> I think some compilers will do that automatically
23:12:35 <comexk> ehird: what will that achieve, you just get one of the bytes
23:12:37 <ais523> gcc will if you happen to divide by a constant that can be converted by that
23:12:52 <comexk> so I'll do a - a/b instead of a%b
23:13:01 <comexk> but how do I get a constant I know can be converted by that,
23:13:09 <ehird> (*(int*)s)
23:13:15 <comexk> ehird: only if I have 4gb of memory
23:13:24 <ehird> maybe what I'm saying would make more sense if you actually listened.
23:13:27 <comexk> k
23:14:18 <ais523> ehird: I just looked it up, on a pentium 3 a single 32-bit divide is 39 cycles, although you can run other commands in parallel with it; an addition is 1 but ties up all 4 ports, so you can't run things in parallel with it
23:14:22 <ais523> let me try to find multiply
23:14:29 <ais523> 4 cycles
23:14:31 <ehird> i said bitshift
23:14:32 <ehird> not divide
23:14:32 <comexk> ewwww, 39 cycles
23:14:37 <ais523> well, multiplication beats division hollow, that's for one
23:14:39 <ehird> because they're the sam damn thing on powers of 2
23:14:46 <ehird> and I can tell you like hell it won't take 39 cycles
23:15:35 <ais523> well, how does your bitshift work
23:15:41 <ais523> to get things into the hash table order?
23:15:47 <ais523> can you do that in a single bitshift?
23:16:02 <ais523> also, a complication for both methods: - is different from -. is different from --
23:16:06 <ais523> so you need to handle EOF, somehow
23:16:10 <ehird> ...
23:16:11 <ehird> dude.
23:16:14 <ehird> I covered that _an hour ago_
23:16:15 <comexk> ais523: so how do I manually find a constant to multiply by
23:16:22 <ehird> am I fucking speaking in spanish or something??
23:16:23 <ais523> ehird: well, I didn't understand either
23:16:36 <ais523> comexk: modular division
23:17:53 <comexk> ais523: ?
23:18:18 <ais523> comexk: basically, you know how if a * b = c, then c / b = a?
23:18:26 <ais523> modular division is defined the same way, but with modulos involved
23:18:53 <ais523> so modulo 11, for instance, 8 times 9 is 72 which is 6, so 6 divided by 9 is 8
23:19:07 <ais523> it always works with prime modulos, but in this case the modulo is a power of 2 and so not prime
23:19:12 <ais523> and the result is it /sometimes/ works, but not always
23:19:24 <comexk> ais523: how do I calculate that other than brute force? :p
23:19:27 <ais523> however, because we can mask away high bits, it's probably possible to find a situation that works
23:19:33 <FireFly> In what language?
23:19:46 <ais523> FireFly: "Java" which is a thin wrapper around C
23:19:55 <comexk> no, precomputed pls
23:20:14 <ais523> comexk: I'm pretty sure there's a non-brute-force way to do it, I just can't remember what it is offhand
23:20:51 <ais523> nearly all the modular divisions I've come across were simple enough to spot via pencil and paper
23:21:03 <comexk> the only modular division I've come across is AAA :p
23:22:17 <ais523> comexk: yep
23:22:22 <ais523> and it's pretty confusing there
23:22:36 <ais523> anyway, gcc can often optimise a division into a multiplication, so presumably it knows the algorithms for calculating these things
23:23:15 <comexk> yeah but I can change my divisor depending on what's convenient
23:23:17 <comexk> gcc odesn't know that
23:25:14 <ais523> the trick I think is to write the code you mean, then keep tweaking it until gcc optimises it into something efficient
23:25:46 <comexk> sounds boring
23:25:47 <comexk> :p
23:25:58 <ais523> well, I've done it before on a serious project
23:26:11 <ais523> that was insanely time-critical, there were parts of it I was trying to get down to under 10 cycles
23:26:28 <comexk> wait, so what am I trying to do
23:26:36 <comexk> find the inverse of whatever i'm dividing by?
23:26:53 <ais523> it's do to with wraparound
23:27:01 <ais523> what form's the input in, anyway?
23:27:04 <ais523> dots and dashes
23:27:36 <comexk> yeah
23:27:37 <ais523> you want some factor you can multiply by so that the bottom 4 bits of the resulting number depend on whether there were dots or dashes in the corresponding bytes
23:27:59 <ais523> actually, because you have bytes not bits as input, it's more complicated than just a division
23:28:11 <ais523> masking first would make things simpler, but waste a cycle
23:29:39 <ais523> what's the ascii code for dot and for dash, anyway?
23:29:49 <ehird> 45, 46
23:29:53 <ehird> dash = 45
23:29:55 <ais523> and what's the input if you have a morse code less than 4 bytes long? That's the really tricky bit
23:29:55 <ehird> dot = 46
23:30:01 <ehird> ...
23:30:14 <ehird> ais523: I explained all this before...
23:30:21 <comexk> how does that work, anyway
23:30:25 <comexk> oops, missende
23:30:26 <ehird> g=ig wekk
23:30:27 <ehird> *oh well
23:30:31 <comexk> fine, I'll get gcc to do it -_-
23:30:37 -!- olsner has quit ("Leaving").
23:31:06 <ais523> ah, just checked scrollback
23:31:19 <ais523> your plan seems to be to bitshift away the extra characters using your known string length
23:31:51 <ehird> well, that's the -essence- of it...
23:33:29 <ais523> hmm... what's the x86 bitshift operator called, I don't think I ever used it
23:33:45 <ais523> note that bitshifting by a value that isn't constant is inefficient on many microprocessors, but I can't remember offhand if x86 is one of them
23:34:00 <ais523> also, you can save yourself one shift by not shifting back and just using the data at the new position
23:34:29 <ehird> isn't it "bsl"
23:34:43 <ehird> well that's just too logical
23:35:08 <ais523> no, it isn't
23:35:16 <comexk> why isn't this working -_-
23:35:21 <ais523> at least, that's not in this list of opcode timings
23:35:26 <ehird> ais523: i meant, that would be too logical
23:35:37 <ais523> for x86? I see what you mean
23:36:40 <ehird> http://upload.wikimedia.org/wikipedia/commons/8/87/Prokudin-Gorskii-12.jpg that's some remarkable uality for 1915
23:36:52 <ais523> ok, it seems it's a weird x86ism
23:36:55 <ais523> the command's shl
23:36:56 <ehird> by which I mean, holy shit that's amazing
23:37:02 <ehird> ais523: SHift Left
23:37:05 <ais523> and it takes 2 cycles even for a variable shift, but only if the shift amount is in register cl
23:37:16 <ais523> the register cl thing is the x86ism I was talking about
23:38:09 <ehird> y'know, the prof isn't even gonna test this code
23:38:15 <ehird> I can almost guarantee it...
23:38:25 <comexk> I care this much:
23:38:32 <ehird> or he'll probably try and run it thru java...
23:38:33 <comexk> :p
23:38:56 <comexk> I like solving puzzles even useless ones
23:38:59 <comexk> that's the point of the channel isn't it :p
23:39:04 <ehird> yes P
23:39:05 <ehird> :P
23:39:22 <ais523> definitely
23:39:49 <ais523> does anyone know how to tell if a particular floor tile has a particular type of item on it in Enigma scripting, by the way?
23:39:53 <ais523> I decided to make an Enigma level
23:39:55 -!- FireFly has quit ("Later").
23:40:00 <ehird> doesn't it have docs? :P
23:40:04 <ais523> yes
23:40:07 -!- BeholdMyGlory has quit (Remote closed the connection).
23:40:13 <ais523> but I can't find a function that does that in the docs
23:40:21 <ais523> nor any obvious way to simulate it with what's there
23:40:26 <ais523> so it's a programming problem of its own
23:40:36 <ais523> given a language which appears to be missing a feature, figure out how to simulate that feature
23:40:41 <ais523> esolangers do that all the time...
23:48:32 * comexk looks at assembly
23:48:35 <comexk> what the fuck is a calll doing in here
23:48:47 <comexk> I guess it's used for speed somehow
23:49:24 <comexk> well, there are no divide instructions
23:49:35 <comexk> and a magic constant
23:49:43 <comexk> so, although I don't really understand x86 I'm assuming it's using multiply magic
23:49:57 <comexk> yet it's still not fast enough
23:50:10 <ais523> a large magic constant for no apparent reason is nearly always gcc optimising a divide
23:50:25 <comexk> here's my code:
23:50:26 <comexk> http://pastie.org/407770
23:50:39 <comexk> note the mask part, that looks slow but I don't know how to make it better
23:50:51 <ehird> s2 = strchr(s2, ' ');
23:50:55 <ehird> you're iterating through the string anyway
23:50:59 <ehird> so all that magic is buying you approx. nil
23:51:13 <ais523> ehird's idea was you could read the string length from java's internals
23:51:27 <ehird> you can
23:51:29 <ehird> it's not internals
23:51:31 <ehird> it's just .length
23:51:33 <ehird> trivial
23:51:38 <ehird> pass it to your c function from the java side
23:51:46 <comexk> yeah, i'll do that
23:51:57 <comexk> ehird: what
23:51:59 <comexk> it's not .length
23:52:04 <comexk> spaces may be found anywhere in the string
23:52:13 <ehird> ais523: ehird's idea was you could read the string length from java's internals
23:52:15 <ehird> i was responding to that.
23:52:15 <ais523> comexk: check to see what 1 << 32 is in gcc
23:52:24 <comexk> ais523: ?
23:52:24 <ais523> it's undefined behaviour in C itself
23:52:28 <ais523> but I bet gcc defines it to something
23:52:31 <comexk> how does that help?
23:52:32 <ais523> you may be able to avoid the if that way
23:52:43 <ais523> the mask would just be (1 << 32) - 1
23:52:48 <ais523> which is 0xffffffff
23:52:51 <ais523> if 1 << 32 is 0
23:53:02 <ais523> so the if would become redundan
23:53:04 <ais523> *redundan
23:53:07 <ais523> *redundant
23:53:17 <ais523> i.e. instead of the inside of the if not running, it runs and does nothing
23:53:20 <comexk> no, it was screwing up without the if
23:53:26 <ais523> ah, pity
23:53:36 <ais523> probably bitshifting by 32 is undefined on x86 too...
23:54:03 <comexk> actually
23:54:16 <ais523> anyway, wouldn't that masking scheme confuse ..-. with .-.?
23:54:30 <comexk> yeah
23:54:39 <ehird> ais523: but the strchr is slow anyway...
23:54:41 <comexk> ais523: hmm?
23:54:41 <ehird> this is pointless
23:54:47 <comexk> all it does is mask out any characters after the space
23:54:47 <comexk> ehird
23:54:50 <comexk> I HAVE to strchr
23:54:51 <ehird> it defeats the point of the (int*) trick
23:54:55 <comexk> I don't know where spaces are in the string beforehand
23:55:00 <ehird> comexk: write your own strchr
23:55:03 <ehird> that saves the int* as it goes along
23:55:16 <comexk> uhh what would that get me?
23:55:19 <comexk> other than a less optimized strchr
23:55:26 <ehird> not duplicated work
23:55:30 <comexk> well I'll use memchr to avoid the compare to zero
23:55:35 <comexk> ehird: casting a pointer is not work
23:55:43 <ehird> you don't understand.
23:56:17 <comexk> actually, strchr is FASTER than memchr
23:56:31 <comexk> ehird: it goes around and compares to a space, how do you intend I replicate that
23:56:49 <ehird> make it operate on 4-byte chunks
23:56:51 <ehird> using the int* trick
23:57:03 <ehird> http://www.stdlib.net/~colmmacc/2009/03/01/optimising-strlen/ has a link to glibc's strlen which uses that trick
23:57:09 <ehird> you can replicate it yourself
23:57:12 <comexk> why?
23:57:14 <comexk> not just use glibc's strchr
23:57:24 <comexk> really I want a version that doesn't bother comparing to zero
←2009-03-03 2009-03-04 2009-03-05→ ↑2009 ↑all