00:00:04 <elliott> Gregor: Now come on, piracy is more a social issue than CS-related.
00:00:10 <elliott> And I've already made my mind up about copyright!
00:02:03 <elliott> Note to self: mention support of sodomy ==> conversation dies.
00:02:13 <Gregor> I had nothing further to say :P
00:04:15 <Vorpal> elliott, that 128x128x128 thing... do you realise how enormous it will actually be?
00:04:30 <Vorpal> elliott, considering a 25x25 room is HUGE
00:04:39 <elliott> Vorpal: I have a vague comprehension in my head. Is that 25x25 room there right now?
00:05:03 <elliott> Vorpal: I'm imagining it like a really tall shopping centre/mall, not a bunch of rooms. :p
00:05:05 <Sgeo> Dear Ubuntu: Learn to count
00:05:14 <Vorpal> elliott, well partly, and it is not 7 high yet
00:05:15 <zzo38> Idea for D&D game. When you play D&D game, maybe, you can make your character ettercap or other monster character, and then ask your brother if they want their character to be afflicted lycanthropy. And then see if there is human NPC in your party, too.
00:05:19 <Sgeo> Guess it's not counting a directory as a file
00:07:02 <Sgeo> Maybe I should just go online and find something?
00:07:07 <elliott> oerjan: it's the biggest cube possible because the world is only 128 high :)
00:07:13 <EgoBot> help: General commands: !help, !info, !bf_txtgen. See also !help languages, !help userinterps. You can get help on some commands by typing !help <command>.
00:07:14 <EgoBot> help: General commands: !help, !info, !bf_txtgen. See also !help languages, !help userinterps. You can get help on some commands by typing !help <command>.
00:08:02 <oerjan> !haskell 128^3 / 86400
00:08:27 <Vorpal> elliott, now it is all there
00:08:33 <oerjan> Gregor: this is not very promising
00:08:34 <Vorpal> elliott, though just 2 high so far
00:08:44 <Vorpal> elliott, don't think so. Anyway it is in my mountain
00:10:44 <oerjan> `perl print (2097152/86400)
00:10:53 <oerjan> `perl print (2097152/86400);
00:11:24 <Gregor> <HackEgo> I DON' WANNA
00:11:33 -!- EgoBot has quit (Ping timeout: 240 seconds).
00:12:23 <HackEgo> Runs arbitrary code in GNU/Linux. Type "`<command>", or "`run <command>" for full shell commands. "`fetch <URL>" downloads files. Files saved to $PWD are persistent, and $PWD/bin is in $PATH. $PWD is a mercurial repository, "`revert <rev>" can be used to revert to a revision. See http://codu.org/projects/hackbot/fshg/
00:12:52 <oerjan> `run perl -e 'print (2097152/86400);'
00:13:11 <oerjan> elliott: so how many blocks can you place per second?
00:13:35 <oerjan> if it's one, and you don't sleep, then that's how many days you need
00:14:37 <elliott> oerjan: yeah yeah fizzie's done all the calculation --
00:14:40 <elliott> oerjan: i don't need to fill the cube duh
00:14:44 <elliott> i'm just going to have floors inside it
00:14:58 <elliott> you can place like 2 blocks/s
00:15:02 <elliott> oerjan: what will take ages is emptying 128x128x5 or so
00:18:42 <elliott> fizzie: Question. Why does mkdir have an -m parameter?
00:19:58 -!- HackEgo has quit (Remote host closed the connection).
00:20:06 -!- EgoBot has joined.
00:20:10 -!- HackEgo has joined.
00:20:11 <Gregor> elliott: To make you cry.
00:20:19 <elliott> Gregor: BUT IT'S POINTLESS
00:20:30 -!- augur has joined.
00:20:30 -!- nooga has quit (Ping timeout: 250 seconds).
00:21:13 -!- zzo38 has quit (Remote host closed the connection).
00:21:22 -!- sftp has quit (Remote host closed the connection).
00:21:32 <Gregor> elliott: RACE CONDITIOX
00:22:02 <elliott> Gregor: There's one *already*; malloc has to use chmod() because mkdir() is limited to umaskable stuff.
00:23:16 <Gregor> Also, if you pass the mode requested into mkdir then chmod, you'll only be /expanding/ permissions, not /reducing/ permissions, which is OK.
00:23:27 <Gregor> (Idonno if it does this, and I'm just being a jerk anyway :P
00:23:56 -!- sftp has joined.
00:24:00 <Gregor> I figured it out, but it actually did take me a while ... like, 'til my next line :P
00:24:29 <elliott> Gregor: Anyway, mkdir is 9229 bytes and I consider this unacceptably large. :P
00:24:32 <elliott> It would be small without -m.
00:25:04 <elliott> whyy do i get this error it doesn't sense-make
00:25:27 <Gregor> Wow, that is bizarrely huge ... it'd be smaller if you used shared objects or a multibinary X-P
00:25:46 <elliott> Gregor: It is, in fact; I have a script to do that.
00:26:07 <elliott> Gregor: That's false, true, yes, sleep, pwd, echo, dirname, basename, uname, signal, link, cat, date, chroot, env, strings, vis, cal, kill and mkdir.
00:26:14 <elliott> Gregor: BUT WAIT, THERE'S MORE
00:26:40 <elliott> Gregor: $ upx --ultra-brute --overlay=strip box && ./sstrip box
00:26:55 <elliott> Also, it's bigger than it needs to be because UPX puts a UPX copyright notice in the file because it's stupid.
00:27:14 <elliott> (Supposedly even though it's GPL'd, somehow they think they can make removing this a license violation revoking even your permission to *use* it. :P)
00:27:28 <elliott> Gregor: BUT YEAH I TOTALLY JUST KINDA 14.5 DECIMAL KILOBYTESDED A BUNCH OF UTILITIES YO
00:27:51 <elliott> Gregor: Oh, and that box has flaws such as multiple copies of every signal name. And a few functions that could be shared.
00:28:00 <elliott> What I'm saying is: I'M AWESOME.
00:28:08 <elliott> Gregor: Did you ever bother actually unpacking that .minixfs.lzo? :P
00:28:18 <elliott> I spent at LEAST two minutes thinking of a format insane enough.
00:28:30 <Gregor> I like how it's just "box"
00:28:36 <Gregor> Not busy, tiny, anything.
00:28:40 <elliott> Gregor: I can't decide whether it's busy or not.
00:28:45 <elliott> But it definitely is a box!
00:29:11 <Gregor> How 'bout industriousbox :P
00:29:13 <elliott> Gregor: The box executable has some flaws right now; you can't symlink right now, only argv[1]. And it has no error reporting for no command arg (just segfaults) or command not found. :p
00:29:18 <elliott> Gregor: How about picobox.
00:29:37 <elliott> Gregor: Let's put it this way: I am pretty sure that nobody has used a toolchain capable of producing executables that small from this code before on Linux.
00:29:42 <Gregor> ... what could possibly be making it difficult to do with symlinks?
00:29:49 <elliott> Gregor: I am 99% sure I am the first person to compile dietlibc with pcc.
00:29:56 <elliott> (Since I had to do patching.)
00:30:01 <elliott> And yes, it produces smaller executables than gcc.
00:30:09 <elliott> <Gregor> ... what could possibly be making it difficult to do with symlinks?
00:30:14 <elliott> What if argv[0] has path components?
00:30:19 <Sgeo> VBoxGuestAdditions doesn't support Win98
00:30:23 <elliott> box.c is just a really quick autogenerated thing anyway.
00:30:47 <elliott> Gregor: Oh yeah, and the dietlibc-linked static pcc is 34K.
00:30:53 <elliott> Gregor: This is the kind of compiler fit for the late 80s. :P
00:30:55 <Gregor> Mmm right, path components, okidoke. Still, strrchr *shrugs*
00:31:24 <elliott> Gregor: Huh, I didn't realise strrchr was actually POSIX. Also, right back at ya: basename() :P
00:31:42 <elliott> Hmm, I think strrchr could HELP with some of my PROGRAMS.
00:31:59 <Gregor> There's a basename function as part of POSIX?
00:31:59 <elliott> (BASENAME actually GROWS in size when I just use basename(). I don't know why or how.)
00:32:08 <elliott> http://www.opengroup.org/onlinepubs/009695399/functions/basename.html
00:32:33 <Gregor> I didn't even know there was a basename function :P
00:32:51 <elliott> My hand-written basename is smaller SO YEAH
00:32:54 <elliott> (But not in larger programs.)
00:33:05 <elliott> (Only in basename(1). TODO: figure out where logic went.)
00:33:22 <elliott> while ((slash = strchr(path, '/')))
00:33:27 <elliott> Gregor: LOOK AT ME I DON'T KNOW WHAT STRRCHR IS HURRR
00:34:57 <elliott> Gregor: Did I mention I compile false and true specially so that I can avoid all startup code? They are both 248 bytes.
00:35:25 <elliott> Gregor: It's the best I can do with C that's even vaguely portable P
00:35:33 <Gregor> Mmm, vaguely portable :P
00:35:34 <elliott> Gregor: Yes; the alternative is assembly.
00:35:37 <Gregor> OK, that's ELF-portable :P
00:35:49 <elliott> I have to special-case true and false in mkbox because I can't link them to ANYTHING X-P
00:36:21 <Gregor> Surely the size added to box of a more conventional true and false command would be smaller than 248 bytes?
00:37:07 <elliott> echo " if (!strcmp(argv[0], \"true\")) return 0;"
00:37:07 <elliott> echo " if (!strcmp(argv[0], \"false\")) return 1;"
00:37:19 <elliott> Gregor: But I'm primarily targeting separate executables for now :P
00:37:51 <elliott> Gregor: No way, this is more hardcore. Because I have all the overhead to deal with.
00:38:07 <elliott> "Do nothing, unsuccessfully" -- GNU coreutils, attempting to describe false(1) and instead managing to confuse everyone who thinks about it for more than a second
00:38:10 <Vorpal> elliott, and what if you have argv[0] = "foobar"
00:38:16 <elliott> [[This version of false is implemented as a C program, and is thus more secure and faster than a shell script implementation, and may safely be used as a dummy shell for the purpose of disabling accounts.]]
00:38:20 <elliott> Our false: MORE SECURE THAN EVERYONE ELSE'S FALSE.
00:38:24 <elliott> Vorpal: Then the trick fails. Duh.
00:38:33 <elliott> They said their false is *faster* than other falses.
00:38:46 <elliott> Faster if it didn't respond to --help and --version!
00:38:50 <elliott> And have localised strings!
00:38:51 <Vorpal> true is a shell builtin
00:38:52 <Gregor> elliott: Actually, the "safely be used as a dummy shell for the purpose of disabling accounts" is pretty important.
00:39:01 <elliott> Gregor: Yes, but come on: faster?
00:39:24 <elliott> Gregor: Oh my god I want to delve into the kernel's executable loading code now to figure out the most optimised code path to exit with status 1 :P
00:39:39 <Vorpal> elliott, don't be silly
00:39:42 <Gregor> elliott: Do you require a.out binaries to be supported? ;)
00:39:49 <elliott> Vorpal: He says, in #esoteric.
00:39:53 <elliott> Gregor: I didn't say modify the kernel's code.
00:39:57 <elliott> Gregor: I meant analyse it.
00:40:06 <Gregor> elliott: The kernel DOES support a.out, but it's optional.
00:40:15 <elliott> Gregor: I know. I wanted to use a.out in Kitten a while back.
00:40:20 <elliott> Gregor: But debugging with a.out is a total clusterfuck :P
00:40:30 <elliott> Gregor: And N O T H I N G supports it.
00:40:42 <elliott> I think gcc dropped support too.
00:40:59 <elliott> Gregor: Clearly we need a Unix that runs on PE.
00:41:02 <Gregor> elliott: objcopy certainly supports it, it may even be able to produce correct a.out files from static ELF files, but I wouldn't rely on that :P
00:41:04 <elliott> (I know, I know, COFF. But I mean actual Windows PE.)
00:41:08 <Vorpal> the standard executable name is still a.out
00:41:17 -!- oerjan has quit (Quit: Good night).
00:41:28 <Vorpal> elliott, should be e.lf now
00:41:34 <elliott> Gregor: My objdump is so optimised it contains NO CODE AT ALL:
00:41:36 <elliott> bin/mkdir: file format elf64-x86-64
00:43:17 <Vorpal> elliott, hm does it contain any sections at all
00:43:43 <elliott> Vorpal: Yes, but it removes the section header table.
00:43:44 <Vorpal> elliott, if not, how does the kernel know what to load as executable and what to load as read only
00:43:49 <elliott> So silly tools think it has no sections at all/
00:43:50 <Vorpal> and then what to load as read-write
00:43:55 <elliott> * Most ELF executables are built with both a program header table and a
00:43:56 <elliott> * section header table. However, only the former is required in order
00:43:56 <elliott> * for the OS to load, link and execute a program.
00:44:15 <Vorpal> elliott, and does the former define what is read only and read-write?
00:44:22 <elliott> Vorpal: One would presume so :P
00:44:33 <elliott> sstrip has basically no effects on any program in my testing.
00:44:40 <elliott> Well, unless the compiler does Weird Thangs.
00:44:47 <elliott> No effect apart from dramatic size reduction, that is.
00:45:17 <Vorpal> elliott, not dramatic for large binaries I presume
00:45:35 <elliott> $ egrep -r 'malloc|calloc|alloca|printf|fopen|fwrite' bin
00:45:41 <elliott> Behold my not-using-most-of-libc skillz.
00:45:48 <elliott> Vorpal: Well, at least as dramatic as strip -s.
00:46:00 <elliott> And perhaps up to a kilobyte more? Maybe?
00:46:13 <elliott> Vorpal: It also strips trailing zeroes, which you can't do if you have a section header apparently.
00:46:19 <elliott> And I seem to recall seeing quite a lot of them in most ELF files.
00:46:30 <elliott> So sstrip is definitely worthwhile for a final-product no-debugging type thing.
00:46:54 <Vorpal> elliott, I'd want debug symbol packages available :P
00:47:06 <elliott> Vorpal: Do you do "strip -s" before debugging? No?
00:47:10 <elliott> Then you wouldn't sstrip either. :p
00:47:21 <Vorpal> elliott, I do aptitude install libsdl-dbgsym :P
00:47:34 <elliott> Vorpal: (Of course if debuggers were actually *useful* and not destroyed by most optimisation and a pain beside, then you wouldn't want to strip anything; see Lisp Machines.)
00:47:51 <elliott> (But on Unix, for a non-development program, a smaller size is almost always vastly more useful than that.)
00:47:52 <Vorpal> elliott, debuggers are still useful
00:47:58 <elliott> Vorpal: Not outside of development.
00:48:04 <elliott> And, uh, the occasional bug report.
00:48:08 <elliott> Which is basically development.
00:48:18 <Vorpal> elliott, and unix is so buggy you want lots of bug reports :P
00:48:25 <Vorpal> elliott, did you still want to shave off that trailing \0 from that char array?
00:48:38 <Vorpal> like months[] = "foobarquu"
00:48:40 <elliott> Vorpal: I would ... not be ... averse to doing so...
00:48:49 <elliott> But I don't want to write {'a','b','c'} etc. :P
00:48:49 <Vorpal> elliott, just give the size in the []
00:48:59 <Vorpal> elliott, to be exact fit without the zero byte
00:49:02 <elliott> Vorpal: Yeah, I just realised that. I'll get a warning though. Well. I would get a warning if pcc was any good with warnings.
00:49:12 <elliott> (It seems to go into "TRUST THE PROGRAMMER" mode if you specify -nostdlib -nostdinc.)
00:49:24 <elliott> I occasionally compile it with gcc just to see what headers I forgot :P
00:49:50 <Vorpal> elliott, -Wall -Wextra -pedantic -std=c89?
00:50:10 <Vorpal> of course C99 is nicer
00:50:14 <Vorpal> but I doubt you would use that
00:50:19 <elliott> Vorpal: pcc doesn't have any warning options; all the warnings that exist are always on.
00:50:24 <elliott> (There do not exist terribly many.)
00:50:28 <Vorpal> elliott, I meant for gcc checking
00:50:50 <elliott> Vorpal: Oh. Yeah. Well, usually I just do CC=gcc. But CC="gcc -std=c89 -Wall -pedantic" is a more thorough check.
00:51:13 <elliott> Deewiant: You are a horrible human being.
00:51:30 <elliott> Vorpal: Because it's mostly noise. Hey, Linus agrees with me, and lord knows he never does or says anything wrong!
00:51:32 <Vorpal> Deewiant, -Wwrite-strings
00:51:49 <elliott> $ make CC="gcc -std=c89 -Wall -Wextra -Wwrite-strings -pedantic"
00:51:52 <elliott> Ha ha, endless warnings for all.
00:52:04 <elliott> warning: initialization discards qualifiers from pointer target type
00:52:04 <elliott> warning: initialization discards qualifiers from pointer target type
00:52:04 <elliott> warning: initialization discards qualifiers from pointer target type
00:52:04 <elliott> warning: initialization discards qualifiers from pointer target type
00:52:05 <elliott> warning: initialization discards qualifiers from pointer target type
00:52:12 <Vorpal> elliott, you forgot const
00:52:15 <elliott> Vorpal: not really, that's basically deliberate
00:52:23 <elliott> Vorpal: const correctness is vastly overrated and hinders the readability of code
00:52:23 <Vorpal> elliott, why deliberate?
00:52:46 <Vorpal> elliott, "type checking is vastly overrated and hinders readability of haskell code"
00:53:07 <elliott> Vorpal: Maybe if cc could infer my consts I'd say differently, then.
00:53:42 <Vorpal> untyped haskell sounds completely wtf
00:54:15 <Vorpal> elliott, const decrease binary size
00:54:23 <Vorpal> elliott, because it can get rid of one page
00:54:32 <Vorpal> if you are lucky you just have .rodata
00:54:38 <elliott> bin/kill.c:39: warning: implicit declaration of function ‘kill’
00:54:38 <Vorpal> (and you will probably have that anyway
00:54:47 <elliott> I included all the headers in the man page.
00:54:49 <Vorpal> elliott, oh probably -std=c89
00:54:51 <Vorpal> elliott, that does that
00:55:01 <Vorpal> elliott, it doesn't think you want POSIX extensions then
00:55:17 <elliott> How do you turn off qualifier-discarding warnings? It's drowning out all the stuff I /want/ to fix.
00:55:26 <elliott> Also, I'm now tempted to try out consting EVERYTHING and seeing if binary size really decreases.
00:55:26 <Vorpal> -D_POSIX_C_SOURCE=200112L
00:55:33 <elliott> Vorpal: Or just ignore that one :P
00:55:36 <elliott> <elliott> How do you turn off qualifier-discarding warnings? It's drowning out all the stuff I /want/ to fix.
00:55:49 <Vorpal> elliott, well if there are many of them then it might help to add that -D
00:56:01 <elliott> I wonder what people who do -Wextra -Werror do when they get "unused variable argc!!"
00:56:13 <Vorpal> elliott, as for turning of that: removing -Wwrite-string would drop a few
00:56:36 <Vorpal> elliott, __attribute__((unusued)) maybe?
00:56:43 <elliott> bin/chroot.c:15: warning: implicit declaration of function ‘chroot’
00:56:43 <elliott> bin/date.c:11: warning: unused parameter ‘argc’
00:56:44 <elliott> bin/env.c:8: warning: unused parameter ‘argc’
00:56:46 <elliott> bin/kill.c:39: warning: implicit declaration of function ‘kill’
00:56:47 <elliott> bin/signal.c:21: warning: comparison between signed and unsigned integer expressions
00:56:58 <elliott> Two incorrect warnings, two irrelevant warnings, and one really really pedantic warning.
00:57:00 <Vorpal> elliott, the last one sounds a potential problems
00:57:11 <elliott> for (j = 0; j < 7 - strlen(signals[i].name); j++)
00:57:15 <Vorpal> elliott, -Wno-unused-parameter
00:57:25 <Vorpal> or something like that
00:57:38 <Vorpal> elliott, strlen returns size_t
00:57:42 <Vorpal> elliott, what is your j
00:57:42 <elliott> <Vorpal> -D_POSIX_C_SOURCE=200112L
00:57:50 <elliott> Even though I've included <unistd.h>.
00:57:54 <elliott> (Is chroot POSIX? Probably not.)
00:57:57 <Vorpal> (_XOPEN_SOURCE >= 500 ||
00:57:57 <Vorpal> _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) &&
00:57:58 <Vorpal> !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
00:58:00 <Vorpal> Before glibc 2.2.2: none
00:58:24 <elliott> Vorpal: j is an int. (I would love to see a system with so many signals that it overflows. signals is a constant array anyway.)
00:58:29 <elliott> int is smaller than size_t usually :P
00:58:34 <elliott> Maybe I'll make everything char.
00:58:41 <elliott> bin/mkdir.o: In function `main':
00:58:41 <elliott> mkdir.c:(.text+0x457): undefined reference to `__posix_getopt'
00:58:45 <elliott> lol ld --gc-sections is so stupid
00:58:49 <elliott> good thing it works with pcc :P
00:59:00 <elliott> (yes, it does decrease the binary size)
00:59:08 <elliott> Vorpal: Okay, Operation Const. Time to see if your THEORY has any MERIT!
00:59:09 <Vorpal> then pcc is doing something stupid
00:59:18 <Vorpal> elliott, it does help in many cases
00:59:20 <elliott> ld --gc-sections is *really* naive.
00:59:30 <elliott> pcc/dietlibc happens to not trigger it.
00:59:31 <Vorpal> elliott, if it needs gc-sections it is doing something stupid
00:59:40 <elliott> Vorpal: Um, --gc-sections helps with gcc too.
00:59:49 <Vorpal> elliott, I didn't say gcc wasn't stupid as well
01:00:02 <elliott> Vorpal: At least pcc has "70s" as an excuse :P
01:00:16 <elliott> It is a very reliable compiler though. Just not a super-feature-rich one.
01:00:28 <elliott> Vorpal: Okay, time to const EVERY SINGLE THING IN CAT.
01:00:41 <elliott> Ha, argc and argv are both mutated in this program.
01:00:52 <Vorpal> elliott, remember to do const char * const foo = ...
01:00:53 <elliott> In fact, uh, yup, cat has nothing I can const.
01:00:56 <Vorpal> if you have such constructs
01:00:57 <elliott> (Except the barfu library function, but.)
01:01:11 <elliott> Vorpal: Unless this saves a DRAMATIC amount of space, it's so ugly I don't care :P
01:01:23 <Vorpal> elliott, it saved over 1 KB in mosaic I remember
01:01:37 <elliott> Vorpal: Over 1K... in a gigantic program.
01:01:48 <Vorpal> elliott, well check it
01:02:02 <Vorpal> elliott, also look at readelf for .data and .rodata sections
01:02:05 <elliott> Yes, let's go with that. Constipate.
01:02:22 <Vorpal> elliott, "så konstigt"
01:02:22 <elliott> static const char const shortmonths[3 * 12] =
01:02:33 <elliott> shortmonths[...] const? :P
01:02:36 <Vorpal> elliott, I believe the const goes inside the []
01:02:37 <elliott> shortmonths const [...]? :P
01:02:42 <Vorpal> elliott, not completely sure
01:02:50 <elliott> static const char shortmonths[3 * 12 const] =
01:02:53 <elliott> MOST RIDICULOUS THING EVER :P
01:03:12 <Vorpal> I thought it was static const char shortmonths[const 3 * 12]
01:03:27 <Vorpal> elliott, actually I don't think that inner const matters
01:03:31 <Vorpal> since it is after all an array
01:03:38 <elliott> Vorpal: WHAT WOULD YOU KNOW
01:03:54 <Vorpal> elliott, your innermost secret?
01:04:08 <Vorpal> elliott, buggered if I knew :P
01:04:18 <elliott> Buggery and the Pirate Tradition
01:04:54 <Vorpal> elliott, also this will help at runtime
01:05:00 <Vorpal> elliott, since const stuff can be shared
01:05:05 <Vorpal> between running instances
01:05:13 <elliott> Vorpal: "char *const daydec;" means that I never do "daydec = ...", just "daydec[n] = ..." right?
01:05:37 <elliott> is that kosher if ultostr modifies a global buffer before returning?
01:05:42 <elliott> and returns that global buffer
01:05:42 <Vorpal> elliott, thus it will be faster since less data will have to be copied to a new page by t he kernel when the app is run
01:05:47 <elliott> as long as /I/ never mutate it later
01:06:04 <Vorpal> elliott, as you state the problem it should be
01:06:37 <Vorpal> elliott, check with valgrind. Always do that for any program written in C. It is _always_ a good idea.
01:06:46 <Vorpal> as long as you aren't linking to a crazy gc that is
01:07:13 <Vorpal> (crazy gc: anything that doesn't work with valgrind in this context)
01:07:24 <elliott> And code is now 110% ugly.
01:07:27 <Vorpal> elliott, what about .data vs. .rodata?
01:07:29 <Vorpal> elliott, remember speed
01:07:53 <elliott> Vorpal: I don't really care how fast these utilities run, I have trivially-unrollable loops that I don't because of size :P
01:07:57 <elliott> A clock cycle takes ~0 seconds.
01:08:13 <elliott> Vorpal: In fact, fuck reasonability. I'm going to constipate the util.h functions too.
01:08:16 <Vorpal> elliott, but what about my 386?
01:08:35 <elliott> Vorpal: You do realise BusyBox, designed for tiny slow hardware, optimises for size waay above speed? :P
01:08:49 <Vorpal> elliott, what about my pentium4 then?
01:08:52 <elliott> It pays off on modern machines, too.
01:08:56 <elliott> Vorpal: Your Pentium 4 is like unto an abortion.
01:09:08 <Vorpal> elliott, p4 unrolling probably pays off
01:09:16 <elliott> P4 throwing out of a window pays off :P
01:09:31 <Vorpal> elliott, yes in the electricity bill
01:09:51 <elliott> static const char *const ultostr(const unsigned long i)
01:10:12 <Vorpal> elliott, well duh there it won't do anything except help you catch errors
01:10:14 <elliott> Conclusion: const does FUCK ALL :P
01:10:27 <Vorpal> elliott, it is for static variables that it often helps
01:10:35 <elliott> Vorpal: Yep. Did it to every static variable (and cal.c has a lot).
01:10:57 <elliott> Maybe pcc is just TOO DUMB to do ANYTHING with them :P
01:11:00 <Vorpal> elliott, btw how many cm snow over in UK so far?
01:11:00 <elliott> IIRC a few binaries even have their rodata sections stripped by --gc-sections.
01:11:04 <elliott> So const there is likely to HURT things :P
01:11:16 <elliott> Vorpal: I don't measure the snow... but a decent amount (quite a lot) by our standards.
01:11:20 <Vorpal> elliott, your setup = crazy
01:11:23 <elliott> Probably not much by your Swedish standards.
01:11:24 <Vorpal> elliott, half a meter yet?
01:11:33 <elliott> Not that I know of at least X_D
01:11:36 <Vorpal> elliott, ah, nothing then
01:11:51 <elliott> Vorpal: You can't make me feel small, I'd like to live in Scandinavia.
01:11:58 <elliott> I LOVE SNOW (as long as I stay indoors forever)
01:12:25 <Vorpal> elliott, I remember that periodicvideo youtube clip where they went to Sweden last year
01:12:35 <elliott> I have not once regretted my choice of "barf" as the standard name for the error-reporting function.
01:12:48 <elliott> The middle one sounds amusingly Asian-stereotypy.
01:13:05 <Vorpal> I loved the comment about who he said "I got this brush when I hired the car, I wonder what it is for... but I do have a feeling the car might be snowy"
01:13:07 <Vorpal> or something like that
01:13:45 <Vorpal> elliott, after all, yttrium, ytterbium, erbium, and terbium are all named after the same place in Sweden
01:14:29 <elliott> Vorpal: I should visit Stockholm some time. ("You know, just one day. No big deal!")
01:14:37 <elliott> ("I might just spontaneously decide to go there.")
01:14:42 <Vorpal> elliott, let me find the clip
01:15:23 <Gregor> Snow on the high seas.
01:15:25 <Gregor> Snow and the pirate tradition.
01:15:31 <Gregor> What I'm trying to say here is sodomy.
01:16:13 <elliott> Gregor: Sodomy and the Sodomical Tradition
01:16:41 <Vorpal> elliott, about 55 seconds into http://www.youtube.com/watch?v=F9QmVM536Ks
01:17:06 <elliott> Vorpal: Ouch, interlacing.
01:17:26 <Vorpal> elliott, also some other cool winter scenery after that
01:17:32 <Vorpal> elliott, including a large snow plow
01:17:33 <elliott> Vorpal: But the interlacing!
01:18:05 <elliott> Vorpal: This flight path is rather indirect :P
01:18:31 <elliott> Is it usually that snowy in the summer? :p
01:18:45 <Vorpal> elliott, that is the winter duh
01:18:53 <elliott> HE SAID NICE SUMMER WEATHER
01:18:57 <elliott> I INTERPRET HIS STATEMENTS LITERALLY
01:19:39 <Vorpal> elliott, at least I think he said that
01:21:14 <elliott> Vorpal: i don't think these guys used a staircase mine
01:21:24 <elliott> drills? why didn't they use a pickaxe?
01:21:42 <elliott> explosives? dude, they must be really impatient, diamond pickaxe mines everything in like a second
01:24:45 <elliott> chroot is stupidly simple :P
01:25:53 <elliott> I love how little POSIX specifies.
01:26:14 <elliott> You could have the craziest file hierarchy ever, have no chroot(), no mmap(), no mount(), and still be POSIX-compliant.
01:31:17 -!- Zuu has joined.
01:40:21 -!- sebbu2 has joined.
01:42:19 -!- sebbu has quit (Ping timeout: 272 seconds).
01:47:28 <pikhq> Vorpal: The only thing worse than putting an interlaced video up on Youtube is scaling it as though it were progressive before uploading it.
01:47:35 <pikhq> (you CANNOT FIX THAT)
01:50:28 <elliott> pikhq: So I totally have a mostly-working malloc.
01:50:47 <pikhq> elliott: Any benefit over dietlibc malloc?
01:51:01 <elliott> God dammit why do I keep making that typo.
01:51:56 <elliott> pikhq: Oh, and uname. Did I have uname last time? Whatever.
01:52:15 <elliott> pikhq: BTW, question: You know the common "#!/usr/bin/env interp" trick?
01:52:25 <elliott> Any suggestions as for how to get that working if you don't have /usr?
01:54:29 <pikhq> Well, you could get Linux to think that "#!/usr/bin/env" is the magic for a new binary format.
01:55:21 <pikhq> Vorpal: Which, BTW, was done.
01:55:31 <pikhq> Vorpal: That video is impossible to fix.
01:55:37 <elliott> pikhq: You need the space there too. But yeah, I thought that, and then I realised "wait, it'd be easier just to patch exec to special-case /usr/bin/env".
01:55:58 <pikhq> elliott: Actually, no, it wouldn't be easier.
01:56:19 <pikhq> elliott: Linux lets you register an interpreter for a binary format just by writing to some file in proc.
01:56:46 <pikhq> I've used it for Java, WINE, and Plof in the past.
01:57:00 <elliott> "To register a new binary format you have to issue the command echo :name:type:offset:magic:mask:interpreter: > /proc/sys/fs/binfmt_misc/register with appropriate name (the name for the /proc-dir entry), offset (defaults to 0, if omitted), magic, mask (which can be omitted, defaults to all 0xff) and last but not least, the interpreter that is to be invoked (for example and testing /bin/echo). Type can
01:57:00 <elliott> be M for usual magic matching or E for filename extension matching (give extension in place of magic). If you do a cat on the file /proc/sys/fs/binfmt_misc/status, you will get the current status (enabled/disabled) of binfmt_misc."
01:57:25 <elliott> pikhq: Wow, there's Python in there.
01:58:07 <elliott> pikhq: How does one work out the magic? Just the hex of the magic? What endianness? (Does it matter?)
01:58:10 <elliott> Can you have multiple magics?
01:58:27 <Vorpal> pikhq, okay. I don't really care. It is still cool
01:58:42 <pikhq> Vorpal: Never mind, I totally fixed it.
01:58:53 <pikhq> Vorpal: -vf yadif,fspp=5 makes it tolerable.
01:59:01 <Vorpal> pikhq, I can tolerate it as it is
01:59:11 <Vorpal> pikhq, I don't know what it is with you
01:59:19 <Vorpal> pikhq, also is that to vlc?
01:59:22 <elliott> Vorpal: Actually, it /is/ really irritating.
01:59:29 <elliott> Why would you ever use VLC?
01:59:32 <elliott> It's like mplayer but worse.
01:59:46 <Vorpal> elliott, oh? I don't use subtitles
01:59:59 <pikhq> elliott: Uh, it will be a string that it should look for.
02:00:06 <elliott> Vorpal: Probably because you don't watch foreign-language content...
02:00:13 <elliott> pikhq: Python's is "magic d1f20d0a" from the proc thing
02:00:18 <elliott> So are you sure about that?
02:00:19 <Vorpal> elliott, indeed I don't
02:00:33 <elliott> pikhq: Or is that just how /proc shows it when I cat?
02:00:43 <pikhq> elliott: Probably just proc being weird.
02:00:57 <elliott> pikhq: So you can't have a magic with : in it then...
02:01:02 <elliott> Also, can you have multiple magics?
02:01:07 <pikhq> elliott: Hmm. Maybe it's a hex string.
02:01:31 -!- FireFly has quit (Quit: swatted to death).
02:01:43 <elliott> No, indeed, that seems to work.
02:01:48 <elliott> But do I really need two interpreters for two magics?
02:02:25 <pikhq> elliott: I dunno. I guess you'd need two entries for two magics.
02:02:38 <Vorpal> elliott, doesn't #! detection come before binfmt_misc?
02:03:01 <Vorpal> elliott, I thought lookup order was: ELF, a.out, #!, binfmt_misc
02:03:15 <Gregor> Vorpal: binfmt_misc always comes first
02:03:17 <Vorpal> yes it would register, but would it work?
02:03:17 <pikhq> binfmt_misc overrides.
02:03:34 <Gregor> Vorpal: Qemu has a script to set up binfmt_misc for foreign ELFs.
02:03:37 <pikhq> You can, in fact, make Linux valgrind everything.
02:03:38 <elliott> Now how do you get rid of an interpreter...?
02:03:50 <Vorpal> pikhq, what about valgrind itself
02:03:55 <Vorpal> wouldn't this get recursive
02:03:56 <Gregor> pikhq: Wouldn't that get into some horrible binfmt_misc loop? :P
02:04:06 <pikhq> Gregor: It's valgrind all the way down.
02:04:19 <pikhq> Gregor: Alternately, you could set up a noöp interpreter for valgrind.
02:04:28 <elliott> I approve of this meta-valgrind technology.
02:04:32 <elliott> Just evaluate the valgrinds lazily.
02:04:52 <Vorpal> actually I seem to remember it does loop detection nowdays
02:05:10 <Vorpal> it must hit ELF or a.out within n layers
02:05:21 <elliott> Seriously, how do I remove an interpreter? :P
02:05:27 <Vorpal> elliott, you read the man page
02:05:40 <Gregor> elliott: It compiles it into the kernel live, then it's stuck forever, even through reboots.
02:05:58 <elliott> There is no binfmt_misc man page here.
02:05:59 <Vorpal> elliott, buggered if I know
02:05:59 <Gregor> elliott: It even modifies the compiler so that if you compile a new kernel, you keep your binfmt_mscs.
02:06:12 <elliott> Vorpal: Then stop being annoying just because you can't help...
02:06:14 <Vorpal> Gregor, trusting trust reference eh?
02:06:26 -!- Sasha2 has quit (Remote host closed the connection).
02:06:29 <Vorpal> elliott, I done it before, I just don't remember where
02:06:32 <elliott> Gregor: But does it counteract Diverse Double-Compiling? http://www.dwheeler.com/trusting-trust/
02:06:46 <Vorpal> elliott, /usr/src/linux/Documentation I guess
02:06:59 <Vorpal> elliott, or whereever you have the kernel source
02:07:06 <elliott> Vorpal: I, like most people, do not have the kernel source on my system all the time.
02:07:18 <Vorpal> elliott, well that is your problem
02:07:25 <elliott> Thankfully I have a copy here.
02:07:35 <elliott> pikhq: Ah, you can select whatever : you want.
02:07:41 <elliott> Still, you can't have a 256-char magic :P
02:07:49 <elliott> Vorpal: Only because of Kitten.
02:08:06 <elliott> - 'magic' is the byte sequence binfmt_misc is matching for. The magic string
02:08:06 <elliott> may contain hex-encoded characters like \x0a or \xA4. In a shell environment
02:08:06 <Vorpal> elliott, again your problem
02:08:06 <elliott> you will have to write \\x0a to prevent the shell from eating your \.
02:08:22 <Vorpal> elliott, only if I want to
02:08:31 <elliott> Gregor: Seriously, tell him he's irritating.
02:08:50 <Vorpal> elliott, is Gregor some sort of higher authority?
02:09:02 <elliott> No, but if I can get pikhq on board too that's pretty solid.
02:09:39 <elliott> pikhq: Ugh, I can't make /bin/env the interpreter, because it'll just see "/bin/env /path/to/foo".
02:10:25 -!- sebbu2 has changed nick to sebbu.
02:10:45 <elliott> `addquote <elliott> Vorpal loves the sodomy. <Vorpal> elliott, sure why not
02:10:47 <Vorpal> (yes I know what the word means)
02:10:49 <elliott> Vorpal: OPEN TO TRYING NEW THINGS.
02:10:57 <HackEgo> 267|<elliott> Vorpal loves the sodomy. <Vorpal> elliott, sure why not
02:11:02 <pikhq> elliott: You'd need to write a custom interpreter to parse the shebang line.
02:11:20 <elliott> This is Vorpal's really subtle way of coming out.
02:11:23 <Gregor> btw, wots all this you're doing with binfmt_misc anyway?
02:11:32 <Vorpal> `addquote <elliott> [...] ALWAYS OPEN TO TRYING NEW THINGS.
02:11:33 <elliott> Gregor: "#!/usr/bin/env interp" is very common.
02:11:34 <HackEgo> 268|<elliott> [...] ALWAYS OPEN TO TRYING NEW THINGS.
02:11:43 <elliott> Vorpal: My love of sodomy is no secret :P
02:11:52 <Gregor> elliott: Soooo ... ln -s /usr /?
02:12:08 <elliott> Gregor: I refuse to accept such clutter. (But symlinking / to /usr sounds like fun.)
02:12:21 <Gregor> elliott: The HURD does it :P
02:12:43 -!- Sasha has joined.
02:12:46 <Gregor> Also /X11R6, though that one may have gone away.
02:12:56 <elliott> Gregor: What, symlink / to /usr? :P
02:13:16 <Vorpal> elliott, didn't you read that ln -s backwards
02:13:21 <elliott> <Gregor> elliott: Soooo ... ln -s /usr /?
02:13:39 <Vorpal> elliott, I just saw <Gregor> ln -s / /usr
02:14:29 <Vorpal> elliott, make it point to a custom wrapper file that just munges argv and passes the right thing to env
02:14:38 <Vorpal> elliott, however it needs to read the file
02:14:41 <elliott> Vorpal: I have to parse the shebang, duh.
02:14:53 <Vorpal> elliott, linux just passes #!<whatever> <whatever> along
02:14:57 <Vorpal> not anything more than that
02:15:19 <Gregor> Vorpal: His problem is he wants #!/usr/whatever to work with no /usr
02:15:41 <Gregor> Ohoho, make it point to.
02:15:50 <elliott> Vorpal: Sure, but I still have to open the file, read sizeof("#!/usr/bin/env")-1 bytes (or maybe one extra due to the space in some cases), read a space, read a space-terminated name, read a space-terminated argument, and make the call.
02:15:51 <Vorpal> elliott, you need the same for #!/usr/bin/python and #!/usr/bin/perl and so on
02:15:55 <elliott> So it's not exactly trivial.
02:15:58 <elliott> Vorpal: Nothing should do that :P
02:16:18 <Gregor> elliott: Are you unwilling to use stdio?
02:16:23 <elliott> And the distro solution to that is to s!/usr/bin/!/usr/bin/env !, usually.
02:16:25 <elliott> Gregor: What, in my coreutils?
02:16:36 <Vorpal> <elliott> So it's not exactly trivial. <-- uh the pseudo code fitted into one line of IRC
02:16:40 <Gregor> elliott: In your binfmt_misc /usr-shebang wrappermajig.
02:16:46 <elliott> Vorpal: It's not as trivial as one echo line :P
02:16:56 <elliott> Gregor: Even if I was willing, why would it affect anything?
02:16:57 <Vorpal> elliott, it is not as trivial as a nop yeah
02:17:05 <Gregor> elliott: Then it's just fgets and strchr
02:17:18 <elliott> Gregor: ...you do realise that fgets ~= read?
02:17:30 <Gregor> elliott: fgets always reads lines, and you want one line.
02:17:38 <elliott> Gregor: Stop when you encounter a \n, problem solved.
02:17:44 <elliott> fgets can read only part of a line if the buffer is too small, anyway.
02:17:57 <elliott> Gregor: stdio does not make this significantly easier at all :P
02:17:58 <Gregor> elliott: Finefine; in that case, strchr is sufficient
02:18:08 <elliott> Gregor: Good thing I have no objection to strchr, then.
02:18:08 <Gregor> strchr being in string, not stdio, but eh :P
02:18:09 <Vorpal> elliott, it is in poisix 2008 iirc
02:18:26 <elliott> Gregor: But note that I'll have to handle the argument being terminated by space OR \n.
02:18:51 <elliott> Gregor: Maybe I could do it as a perl script. :P
02:19:28 <elliott> Vorpal: Why even bother...
02:19:31 <elliott> It's a trivial C program :P
02:19:57 <pikhq> Vorpal: Okay, if you can wait like 15 minutes I can give you a better version of that Youtube video. Just so you can see how much of a difference simple things like "deinterlacing" can make.
02:20:13 <elliott> pikhq: Your tormenting Vorpal has little effect on him :P
02:20:18 <Vorpal> `addquote <elliott> So it's not exactly trivial. [Later about same thing] <elliott> It's a trivial C program :P
02:20:23 -!- p_q has joined.
02:20:28 <HackEgo> 269|<elliott> So it's not exactly trivial. [Later about same thing] <elliott> It's a trivial C program :P
02:20:36 <Vorpal> pikhq, nah I'm going to sleep
02:21:02 <Vorpal> pikhq, I'm sure it is better but I'm not very bothered by it
02:21:31 -!- poiuy_qwert has quit (Ping timeout: 245 seconds).
02:21:35 <pikhq> Vorpal: So, you're not bothered by the random horizontal lines EVERYWHERE there is motion?
02:21:50 <Vorpal> pikhq, not in that case, wasn't very noticable
02:23:02 <pikhq> Vorpal must be blind.
02:25:05 <elliott> pikhq: OK, so let's say I have /libexec/runenv and /libexec/runenvspace.
02:25:11 <elliott> And they're identical except one reads one byte more at the start.
02:25:19 <elliott> And then I just register them as the interpreters for the two magics you'd expect.
02:25:57 <pikhq> Yeah, that should keep the /usr/bin/env trick "just working" nice and easy.
02:26:23 <pikhq> May have to do more formats for, say, #!/usr/bin/perl or something.
02:26:31 <pikhq> But that should be much easier to handle.
02:27:56 <elliott> pikhq: the solution for that is to edit the file to use /usr/bin/env :P
02:28:15 <pikhq> elliott: Okay, true, that functions just as well.
02:31:59 <elliott> pikhq: So what command should I do next batman :P
02:35:29 -!- Sasha has quit (Remote host closed the connection).
02:35:50 -!- Sasha has joined.
02:36:30 <elliott> pikhq: http://www.opengroup.org/onlinepubs/9699919799/utilities/rm.html LOOK AT THE COMPLEXITY
02:36:52 <elliott> Okay, so it's actually pretty simple.
02:37:28 <Gregor> elliott: Do you have shar yet? :P
02:38:06 <Gregor> elliott: Because I'll bet it's obscenely complicated and harassing you is fun?
02:38:19 <elliott> Gregor: shar is not actually posix :P
02:38:34 <elliott> Gregor: Anyway, as far as "obscenely complicated" goes, dude, I've written most of a dd/shar creator in dd/sh.
02:38:56 <elliott> That is: Using only the Bourne shell and dd, I've written a program which takes a bunch of file names and outputs a program using only dd and sh to unpack them again.
02:39:01 <elliott> SO I THINK I'M HARDCORE ENOUGH
02:39:35 <Gregor> elliott: How 'bout script(1)?
02:39:54 <elliott> Gregor: Yes, yes, totally. Believe it.
02:41:04 <pikhq> Okay, I've got a highly-improved version of that Ytterby video, and nowhere to upload it. Poo.
02:41:18 <elliott> pikhq: filebin.ca if it's <50mb
02:43:28 <elliott> Even if it's already-compressed.
02:43:56 <pikhq> Come on, small amounts of redundancy!
02:44:26 <pikhq> Okay, xz doesn't reduce the size.
02:44:58 <elliott> pikhq: Compile an asm program that just prints it out, and UPX --ultra-brute it.
02:48:22 <pikhq> Eh, whatever. The point is, Vorpal is blinder than a bat, and I shall never trust his opinions on video quality.
02:49:19 <elliott> I think he acknowledges the complaint but just doesn't care :P
02:50:20 <pikhq> The point is, Vorpal is blinder than a bat, and I shall never trust his opinions on video quality.
02:50:26 * Sgeo almost considers just using VMware Server
02:50:38 <pikhq> Sgeo: You will regret it.
02:50:48 <pikhq> VMware Server has the worst UI I have seen.
02:50:56 <Sgeo> VBox whatever doesn't like Windows 98
02:50:58 <pikhq> AJAX to localhost.
02:51:03 <pikhq> AJAX. To. Localhost.
02:51:33 <Sgeo> Let's see if I can get sound on here, maybe I'll make do with that
02:51:41 <Sgeo> And just ignore lack of integration
02:51:48 <elliott> pikhq: I am considering writing my own getopt.
02:51:57 <elliott> dietlibc's seems to be more than, like, three bytes, which is unacceptable.
03:13:31 -!- Zuu has quit (Ping timeout: 272 seconds).
03:26:31 <elliott> pikhq: Guess what the hardest part of writing rm is.
03:29:20 <pikhq> Yeah, that would actually be annoying.
03:29:52 <elliott> pikhq: I dare you to write a routine using only read and write that (1) reads a line from standard input; (2) saves whether the first character is y or not; (3) discards the rest of the input up to the newline but (4) keeps the rest to use on the next call.
03:29:57 <elliott> It's possible but irritating.
03:30:10 <elliott> Oh, and (5) returns the first-char-is-y flag.
03:34:34 <elliott> pikhq: Well go on, I sure don't want to :P
03:44:36 <elliott> bin/rm.c, line 57: cannot recover from earlier errors: goodbye!
03:45:44 <Gregor> elliott: int yes() { char c, d; read(0, &c, 1); d = c; while (d != '\n') read(0, &d, 1); return (c == 'y' || c == 'Y'); }
03:46:16 <elliott> Gregor: I was fucking around with a buffer X-D
03:46:23 <elliott> (Although error-check that read call, man!)
03:46:44 <Gregor> Admittedly it's pretty inefficient, but we're talking about rm -i here ;)
03:48:02 <elliott> Gregor: That seems to wait for a double newline sometimes for me...
03:48:06 * Sgeo attempts to fix Brazil despite having little knowledge of either Brazil or Win32
03:48:21 <Gregor> elliott: That's ... weird?
03:48:31 <elliott> Sgeo: brazil is beyond fixing.
03:49:46 <elliott> Gregor: Something is up with this code :P
03:50:17 <Gregor> My code is given with NO WARRANTY
03:50:39 <elliott> Gregor: EXPRESS OR IMPLIED?
03:50:48 <elliott> Yeah I keep going OH and then wait no.
03:50:54 <elliott> if (read(0, &reply, 1) <= 0) return 0;
03:50:56 <elliott> if (read(0, &c, 1) <= 0) return 0;
03:50:58 <elliott> return (reply == 'y' || reply == 'Y');
03:51:25 <Gregor> That's ... pretty obviously OK.
03:52:30 <Gregor> I can only speculate that you're calling it wrong somewhere :P
03:52:36 <elliott> write(2, path, strlen(path));
03:52:55 <Gregor> Like that, for example.
03:53:07 <elliott> Remove x? Remove y? Remove z? elliott@dinky:~/code/tools$
03:53:26 <Gregor> But ... that's correct though.
03:53:27 <elliott> Heh, /bin/rm does the same, so let's ignore that.
03:53:47 <elliott> Now to do -r and it'll be done.
03:54:03 <Gregor> Have you written sh yet? :P
03:54:28 <elliott> Gregor: No. sh, if I do write it, will be in the "more commands!" set, and will do scripts only, designed for init scripts and the like. Interactive users should use a ksh.
03:55:09 <elliott> Gregor: There'll be three sets: the core utilities, i.e. what I'm writing now; the additional utilities, like awk and sh; and the extra utilities, like wget and ping and all that stuff.
03:55:41 <Gregor> At which level does the user become tainGNUted?
03:56:00 <elliott> Gregor: All code is original. By wget I mean "a reimplementation of wget".
03:56:07 <elliott> Oh, things like cpio will also be in the last set.
03:56:20 <elliott> Gregor: Of course I'm just as likely to write "wget: the curl wrapper!", but you get the idea. :P
03:56:27 <Gregor> And at what level do you get KDE4?
03:56:37 <elliott> Gregor: The level accessed by "rm -rf /".
03:56:45 <elliott> And unlike some pussy competitor products, *my* rm won't refuse to do that.
03:57:23 <Gregor> elliott: To be fair, the diagnostic about rm -rf / isn't about not accidentally removing everything, it's about the fact that you cannot, in fact, remove the root directory.
03:57:48 <elliott> Gregor: But the manual tells you it's For Your Own Good. :p
03:58:10 <elliott> Gregor: And no, but you can remove everything on the system and then try, and fail to unlink the root directory, print out an appropriate diagnostic, and dump the user back to a now-completely-useless shell prompt.
03:58:16 <elliott> Just like they asked you to.
03:58:33 -!- augur has quit (Remote host closed the connection).
04:01:06 <elliott> Gregor: Ha, POSIX requires me to not prompt the user on a file without write permissions if standard input isn't a terminal.
04:01:44 <elliott> If file is not of type directory, the -f option is not specified, and either the permissions of file do not permit writing and the standard input is a terminal or the -i option is specified, rm shall write a prompt to the standard error and read a line from the standard input. If the response is not affirmative, rm shall do nothing more with the current file and go on to any remaining files.
04:01:56 <elliott> Gregor: Pop quiz: What happens if this case happens but standard input isn't a terminal and -i is not specified?
04:02:08 <elliott> Demons flying out of your nose, washing the Windows API?
04:02:29 <elliott> (I say: print a diagnostic and exit(1).)
04:02:40 <elliott> (I say: print a diagnostic, process other files, and exit(1).)
04:03:29 <Sgeo> "process other files"?
04:03:30 <Gregor> Silent acceptance, almost assuredly.
04:04:08 <Sgeo> I KILLED JIMBO! :(
04:04:49 <elliott> if (((S_ISDIR(st) && recurse && rmdir(path) < 0)
04:05:27 <elliott> bin/rm.c, line 24: no alignment
04:05:44 <Sgeo> Isn't there some language where you have to say recurse() instead of the function's name, or something?
04:05:47 <elliott> Oh, it doesn't know what it is.
04:06:44 <Sgeo> Since the name is not defined during the thing... Forth
04:07:30 <elliott> if (((S_ISDIR(st.st_mode) && recurse && rmdir(path) < 0)
04:07:43 <elliott> Gregor: Spot the bug that makes "rm -r dir" manage to remove dir but then spew out:
04:07:48 <elliott> dir: No such file or directory
04:08:48 <elliott> Just need to add recursion and it's done.
04:09:37 <elliott> Gregor: No GNU code is actually looking pretty likely at this junction :P
04:09:43 -!- elliott has quit (Quit: Leaving).
04:14:12 -!- wareya has joined.
04:15:14 -!- wareya_ has quit (Read error: Operation timed out).
04:51:59 <pikhq> "Students Warned Not To Link To Or Even Read WikiLeaks If They Want A Federal Job"
04:52:58 <Sgeo> I thought that was one school, and a school that focuses on diplomacy
04:53:10 <Sgeo> (Or maybe just sent to students looking into diplomacy)
04:57:19 -!- augur has joined.
05:01:56 -!- hagb4rd has quit (Ping timeout: 245 seconds).
05:03:19 -!- zzo38 has joined.
05:04:24 <zzo38> I am making a variant of the Computer Modern fonts called Computer Hypermodern (I did change the filenames and the notice), which has three times as many parameters as Computer Modern.
05:05:51 <Sgeo> Respond to WM_VSCROLL is insufficient, isn't it?
05:07:20 <zzo38> Do you mean for Windows?
05:08:25 <Sgeo> I don't think it gets sent for scrolling via the mouse scroll thingy
05:26:55 -!- augur has quit (Remote host closed the connection).
05:28:26 -!- hagb4rd has joined.
05:30:25 -!- augur has joined.
05:34:56 <Gregor> What's your favorite libc function?
06:10:16 -!- hagb4rd has quit (Ping timeout: 245 seconds).
06:10:51 <Sgeo> The one that turns the computer into SkyNet
06:13:03 <zzo38> Gregor: I don't know!
06:28:54 <zzo38> Will an old piece of music come to life if you tune your piano at random?
06:35:53 <Gregor> Yes, but it will almost invariably be angry and murderous.
06:39:46 <zzo38> What does "HAMBURGEFONSTIV" mean?
06:47:43 <zzo38> Is it a real word?
06:52:10 <Gregor> I'm gonna guess "fake word" :P
06:52:26 <Gregor> `translate hamburgefonstiv
06:52:34 <Gregor> Yeah, I'm gonna guess "fake word"
07:31:15 -!- Sasha has quit (Read error: Connection reset by peer).
07:31:51 -!- Sasha has joined.
07:33:47 <pikhq> Gregor: My "favorite" libc function is, of course, gets!
07:36:04 * Sgeo stuffs malicious garbage inside pikhq
07:38:56 -!- nopseudoidea has joined.
07:39:05 -!- nopseudoidea has quit (Client Quit).
07:39:37 -!- zzo38 has quit (Remote host closed the connection).
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:12:25 -!- augur has quit (Remote host closed the connection).
08:22:22 -!- augur has joined.
08:45:43 -!- Sgeo has quit (Read error: Connection reset by peer).
08:52:44 -!- Goosey has quit (Ping timeout: 264 seconds).
08:54:51 -!- nopseudoidea has joined.
08:54:55 -!- nopseudoidea has quit (Client Quit).
09:24:40 <Vorpal> <elliott> I think he acknowledges the complaint but just doesn't care :P <-- correct, I do agree it would be better without the interlacing, but it doesn't bother me much
09:29:33 -!- cheater99 has joined.
09:38:50 -!- kar8nga has joined.
09:52:39 -!- MigoMipo has joined.
10:21:35 -!- nopseudoidea has joined.
10:43:08 -!- Phantom_Hoover has joined.
10:49:38 -!- ais523 has quit (Remote host closed the connection).
11:04:04 -!- nopseudoidea has quit (Quit: Quitte).
11:39:43 -!- nopseudoidea has joined.
11:46:06 -!- nopseudoidea has quit (Quit: Quitte).
11:52:44 -!- nooga has joined.
11:56:54 <nooga> http://besty.pl/upload/file/1019.jpg
12:02:26 -!- nopseudoidea has joined.
12:19:47 -!- FireFly has joined.
12:21:54 -!- oerjan has joined.
12:42:37 -!- cheater99 has quit (Quit: Leaving).
12:51:15 -!- Zuu has joined.
12:59:03 <Phantom_Hoover> You know, of all of the things wrong with modern Western culture, I think the worst is recursive fame.
12:59:39 <Phantom_Hoover> People on Celebrity Big Brother who are famous for /being on a previous series of Plebian Big Brother/.
13:02:59 <Phantom_Hoover> When the aliens invade I shall collaborate vehemently.
13:33:15 -!- Phantom_Hoover has quit (Remote host closed the connection).
13:34:38 -!- Phantom_Hoover has joined.
13:48:06 <Vorpal> elliott (for log reading): did some tests with pypy, it clocks in between cython and and the traditional cpython
13:48:38 <Vorpal> the difference between each of them is about one order of magnitude
13:52:00 -!- nopseudoidea has quit (Quit: Quitte).
14:08:48 -!- cheater99 has joined.
14:30:19 -!- nopseudoidea has joined.
14:31:07 <Vorpal> Phantom_Hoover, as I said: cython
14:31:33 <Vorpal> (since I talked about that yesterday and cython was so much faster than cpython)
14:32:08 * nooga wonder when they'll try to write cuby or cruby
14:32:32 -!- Slereah has quit (Ping timeout: 265 seconds).
14:34:04 <Vorpal> nooga, isn't the current one cruby, cpython is the name of the normal traditional python implementation written in C
14:37:59 -!- Slereah has joined.
14:38:27 -!- nopseudoidea has quit (Remote host closed the connection).
14:43:28 -!- nopseudoidea has joined.
14:46:55 <nooga> so classic python is written in ... ?
14:47:14 <nooga> sry, i didn;t pay attention
14:47:32 <nooga> they why do you call it cpython instead of python?
14:48:01 <Phantom_Hoover> Python is the language; CPython is the official implementation.
15:00:56 <nooga> ok, then i'm waiting for cuby
15:01:33 -!- Sgeo has joined.
15:09:19 -!- elliott has joined.
15:12:33 <elliott> 21:34:52 <Gregor> EVERYONE:
15:12:34 <elliott> 21:34:56 <Gregor> What's your favorite libc function?
15:12:39 <elliott> Gregor: Hey duuude I've asked that before.
15:14:23 <elliott> Gregor: My answer is: mmap, without contest.
15:14:25 <elliott> 06:32:08 * nooga wonder when they'll try to write cuby or cruby
15:14:38 <elliott> nooga: if you mean RubyRuby like PyPy, then it's called Rubinius.
15:18:15 <nooga> i know about Rubinius
15:18:43 <Sgeo> We are worms, we're the best, and we've come to win the war
15:19:30 <nooga> isn't cython that awkward language that looks like python mixed with C ?
15:22:33 <elliott> nooga: Doesn't seem that awkward to me.
15:23:30 -!- Goosey has joined.
15:28:57 <Phantom_Hoover> [[In the United States, summer vacation lasts for almost 3 months.]] — WP
15:29:26 <elliott> Vorpal: http://i.imgur.com/uwFQS.jpg LOL, SWEDEN
15:29:29 <Phantom_Hoover> Do they just not *have* Christmas and Easter holidays?
15:29:39 <elliott> Phantom_Hoover: Summer starts in JANUARY!
15:30:10 <Sgeo> Wait, elsewhere, summer doesn't last as long?
15:30:21 * Sgeo suddenly wants to move
15:30:45 <Phantom_Hoover> Sgeo, it's around 2 months here, although it depends on the school.
15:32:27 <oerjan> "The United States does not have national holidays in the sense of days on which all employees in the U.S. receive a day free from work and all business is halted. The U.S. Federal government can only recognize national holidays that pertain to its own employees; it is at the discretion of each state or local jurisdiction to determine official holiday schedules. There are eleven such Federal holidays, ten annual and one quadrennial holiday.
15:33:05 <oerjan> which includes christmas day, but not anything easter.
15:33:43 <Phantom_Hoover> Sgeo, there are 2-week-long Christmas and Easter holidays, though/
15:33:55 <Sgeo> Spring break == Easter, right?
15:34:57 <Sgeo> So yeah, we have off
15:37:36 <oerjan> i see some individual states have good friday, though
15:38:20 <Phantom_Hoover> oerjan, ask pikhq about US regulations about paid leave if you enjoy feeling smug.
15:39:47 <oerjan> "Often, universities schedule spring break such that Saint Patrick's Day falls during the week in order to lessen the amount of partying and drinking on their campuses. Many K–12 institutions in the United States coincide their spring break with Easter and Passover. In New York and Connecticut, most students have spring break in April.
15:40:08 <oerjan> so it's not consistent
15:40:58 <oerjan> (quotes from http://en.wikipedia.org/wiki/Public_holidays_in_the_United_States and http://en.wikipedia.org/wiki/Spring_break)
15:47:20 -!- Sasha has quit (Read error: Connection reset by peer).
15:47:32 -!- Sasha has joined.
15:54:19 <elliott> Gregor: Does util-linux count as GNU software?
15:58:01 <Phantom_Hoover> I never cease to be amazed by the glurge people are taken in by.
15:59:14 <Phantom_Hoover> elliott, latest moronic Facebook campaign: "Put a cartoon character as your picture TO STOP CHILD ABUSE!!1111!!!"
15:59:41 <Phantom_Hoover> Of course, noöne bothers giving any /money/ or anything, it only matters that you show that you care.
15:59:43 <elliott> I hated that so much that I beat up my three kids into a bloody pulp and they screamed.
16:00:04 <Phantom_Hoover> And the fact that it seems to be for the NSPCC just paints another layer of revulsion on the thing.
16:00:22 <elliott> Also Sgeo for good measure.
16:00:55 <Sgeo> You turned kids into me?
16:00:56 -!- kar8nga has quit (Remote host closed the connection).
16:02:59 <elliott> Sgeo: No, I beat you into a bloody pulp.
16:07:02 -!- nopseudoidea has quit (Quit: Quitte).
16:12:06 <nooga> 16:22 < elliott> nooga: Doesn't seem that awkward to me.
16:12:21 <elliott> while ((entry = readdir(dir)))
16:12:21 <elliott> if (!rm(entry->d_name)) ok = 0;
16:12:23 <elliott> SPOT THE MOTHERFUCKING BUG
16:12:43 -!- p_q has quit (Quit: This computer has gone to sleep).
16:13:04 <nooga> when I propposed adding few higher level constructs to C You said that it'd be awkward without even bothering to listen what I came up with
16:13:22 -!- poiuy_qwert has joined.
16:13:39 <nooga> and python is even more awkward and nazi
16:13:50 <nooga> if you connect c with python
16:13:55 <nooga> it must be awkward
16:16:12 <Phantom_Hoover> nooga, adding high-level constructs to C is completely missing the point.
16:16:17 -!- poiuy_qwert has quit (Client Quit).
16:16:41 <Phantom_Hoover> It's a high-level assembler for an abstract machine, not a general-purpose language.
16:16:54 <nooga> it'd be rather like syntactic sugar to cover things we do all the time in C itself
16:18:24 <nooga> i don't think that guys at NeXT sompletely missed the point making Objective-C
16:19:25 <Phantom_Hoover> Which is why Objective C isn't just "C with some extra crap papier-mâchéd on" like C++.
16:21:32 <nooga> Objective C is thin and feels almost like another preprocessor level over C
16:21:33 <Phantom_Hoover> Why on earth would you even include C as a subset of Objective-C anyway...
16:22:09 <nooga> for porting, for example
16:24:34 -!- yorick has joined.
16:24:37 <nooga> imagine you're writing a car navigation system for iphone and you've got a library previously written in C that does almost everything
16:25:05 <yorick> nooga: you'd port it to brainfuck, ofcourse
16:25:34 <nooga> okay, Phantom_Hoover, you're right
16:26:46 <nooga> elliott: do you know some papers on lisp machine lisp and it's implementation?
16:26:56 <nooga> or any hardware lisp implementation?
16:26:59 <elliott> nooga: which type of lisp machine
16:27:49 <nooga> i remember something on MIT ones
16:29:09 <elliott> nooga: well i don't think too much was published about it
16:29:12 <elliott> since they were usually quite commercial
16:29:14 <elliott> but i think some stuff was
16:30:02 <elliott> gah, a reason to dislike bruce perens
16:30:04 <elliott> is nothing sacred any more?
16:30:25 <Phantom_Hoover> nooga, basically, when you say "portability" you mean "copying and pasting some C code into your Objective-C project".
16:30:52 <Phantom_Hoover> If you have C code and you want to interface it with an HLL, you should use an FFI.
16:30:57 <nooga> but works like a charm
16:35:16 <Phantom_Hoover> nooga, OK, if you like poisoning your language's design and abstraction just so you can get a C library into it for slightly less effort, it's great.
16:36:18 <nooga> no, I exploit the design and abstraction AND use C library without hassle
16:39:01 <elliott> nooga: and you could get shit done in php, too
16:39:05 <elliott> it's just that you shouldn't.
16:39:16 <Phantom_Hoover> nooga, ...which is exactly what a good FFI does, without requiring you crowbar C into your language.
16:39:44 <nooga> what's the point!?
16:40:10 <nooga> Objective-C allows this and it's still pretty good C with 'cancer'
16:41:44 <elliott> Phantom_Hoover: why are you even bothering to argue, it's the same line from both sides forever
16:41:50 <elliott> neither of you are convincing the other
16:42:19 <Phantom_Hoover> elliott, surely you take a side in this? But yes, I'll leave it.
16:42:31 <elliott> Phantom_Hoover: When did I imply that I did not?
16:43:46 * nooga shuts up and gets back to playing with hedgehog lisp
16:44:30 <Zuu> Phantom_Hoover, that wasnt nice, to beat me into a bloody pulp :(
16:45:02 <Zuu> how am i supposed to eat cookies now?
16:45:13 <Phantom_Hoover> sshc turned out to be an actual moron, so I can't pick on him...
16:45:36 <Phantom_Hoover> dbc, you are a disgusting little man and you should be ashamed of yourself.
16:45:44 <elliott> Phantom_Hoover: Hey, that's Daniel B. Cristofani.
16:45:44 <Zuu> could someone please lay a cookie on top of my bloody pulplike body?
16:45:56 <elliott> Phantom_Hoover: Of all the people to pick on, http://www.hevanet.com/cristofd/brainfuck/ is probably *not* the one :P
16:46:44 <Zuu> Phantom_Hoover, did you have to shape me into an ashtray?
16:46:51 <elliott> oerjan: You eat pig dung for breakfast and put spikes in your own cranium on a daily basis! And you are a fascist!
16:47:00 <Phantom_Hoover> Leonidas, DON'T RESPOND TO THIS OR I WILL KILL YOU AND DON'T HAVE DONE ANYTHING COOL
16:47:00 <elliott> I call it "IRC Russian Roulette".
16:48:08 <elliott> "DON'T RESPOND TO THIS OR I WILL KILL YOU"
16:50:13 * Phantom_Hoover beats Leonidas into a bloody pulp, then uses that to replace the bits of Zuu that got splattered.
16:50:43 <Phantom_Hoover> mycroftiv, unlike your namesake, you are wantonly lacking in any analytical or intellectual capabilities.
16:52:30 <Sgeo> I think Phantom_Hoover is immortal
16:53:33 <elliott> Phantom_Hoover: mycroftiv is awesome
16:53:54 <elliott> Phantom_Hoover: i am not, he's a plan9 guy
16:54:08 -!- larsrh has joined.
16:54:43 <Phantom_Hoover> rodgort, what kind of a name is that? It sounds utterly stupid.
16:54:55 <Phantom_Hoover> Actually, I rescind that remark; it suits you perfectly.
17:07:10 -!- nooga has quit (Ping timeout: 240 seconds).
17:08:31 <elliott> I feel like implementing a simple Lua-esque language so I can do what PyPy did in it.
17:09:33 -!- Phantom_Hoover has quit (Ping timeout: 240 seconds).
17:10:54 -!- Phantom_Hoover has joined.
17:10:55 -!- nopseudoidea has joined.
17:13:56 <elliott> in C, is *x[0] *(x[0]) or (*x)[0]? i've forgotten
19:13:19 -!- clog has joined.
19:13:19 -!- clog has joined.
19:13:43 <nooga> busybox will be precompiled and then the compiler suite inside the built system will be changed
19:13:57 <elliott_> nooga: BusyBox is not actually all that small.
19:14:02 <elliott_> I'm packing stuff into much smaller space than it...
19:14:15 <elliott_> nooga: note that with busybox you CAN disable most stuff to get a small executable, but still, mine's smaller :P
19:14:32 <nooga> and what can it do so far?
19:15:11 <elliott_> nooga: false, true, yes, sleep, pwd, echo, dirname, basename, uname, signal, link, cat, date, chroot, env, vis, strings, cal, rm, kill, mkdir.
19:15:52 <elliott_> nooga: Those sizes are in bytes, for independent executables.
19:15:53 * oerjan looks at http://en.wikipedia.org/wiki/Tom_Duff and thinks elliott_ might like the first quote there
19:16:15 <elliott_> nooga: The whole thing compiled into one executable, like BusyBox, is 20K or so (and could be made smaller with some optimisations that I'm doing now).
19:16:24 <elliott_> nooga: When UPX'd, it goes down to 15K.
19:16:50 <elliott_> oerjan: well it /was/ on the plan 9 mailing list
19:17:30 <elliott_> > > AFAIK there are no shared libraries in plan9?
19:17:30 <elliott_> > > Any ideas will they be available?
19:17:31 <elliott_> > Shared libraries are the work of the devil,
19:17:31 <elliott_> > the one true sign that the apocalypse is
19:17:31 <elliott_> > at hand. Seriously, they're good for two
19:17:38 <elliott_> first being the ability to share code between the application
19:17:40 <elliott_> hate to see gnome ported and get 20meg staticaly linked
19:17:46 <elliott_> He wants to port GNOME to Plan 9.
19:18:09 -!- cheater99 has joined.
19:19:03 <elliott_> Phantom_Hoover: Considering that Plan 9 has its own, rather opinionated, very unique interface, and considering that GNOME is very ununixy -- big, bloated, no way to pass around simple text from program to program at all -- yes, yes it is.
19:19:33 <Phantom_Hoover> Sgeo, incidentally, why did you say you wanted to move here because the summer holidays were shorter?
19:19:43 <elliott_> nooga: Do you want the instructions and patches for a pcc/dietlibc toolchain? It is not very hard to get one working, and it produces exceedingly small executables.
19:22:49 <Vorpal> elliott_, hm, dynamic linking is useful for plugins
19:22:51 <nooga> i'd also need init :D
19:23:03 <Vorpal> elliott_, and for runtimes that can load "native" extensions, such as python
19:23:07 <nooga> busybox delivers that
19:23:20 <elliott_> nooga: init can be a shell script on embedded systems.
19:23:36 <nooga> i'm too lazy to write one
19:23:42 <nooga> i will try with init for now
19:23:57 <elliott_> nooga: It's a shell script! You do realise that with BusyBox init you have to write init scripts to get it to do anything?
19:23:59 <elliott_> Vorpal: He says that in the post itself.
19:24:01 <nooga> my plan is to build something working and then strip it
19:24:06 <elliott_> Vorpal: But really, dynamic loading isn't dynamic linking.
19:24:16 <elliott_> nooga: Use sstrip. (BusyBox does that as part of the build process if you enable it.)
19:24:21 <Vorpal> elliott_, true, they are however related
19:24:26 <Sgeo> Phantom_Hoover, I hate summers
19:24:30 <elliott_> Vorpal: Dynamic linking is turning all linking into dynamic loading for no real reason.
19:24:35 <Sgeo> I don't get out much during the summer
19:24:56 <Vorpal> elliott_, to avoid linking huge libraries like QT or boost into everything?
19:25:07 <Sgeo> Phantom_Hoover, what would I do?
19:25:10 <nooga> http://macournoyer.com/blog/2009/02/12/tinyrb/ i wan this :D!
19:25:16 <elliott_> Vorpal: That's a flaw in those libraries.
19:25:34 <Sgeo> Go on the computer
19:26:04 <Sgeo> Yeah yeah, that's very unspecific. My interests vary
19:26:07 <elliott_> nooga: http://sprunge.us/UeSF Instructions. Obviously set K to some reasonable directory, and you probably want to replace $K/stage2 with whatever you want your cross-compiler toolchain's install directory to be.
19:26:10 <elliott_> nooga: http://sprunge.us/HWUO dietlibc-for-pcc.patch
19:26:17 <elliott_> nooga: http://sprunge.us/LDHW pcc-zero-malloc.patch
19:26:28 <elliott_> nooga: http://sprunge.us/DfEc pcc-libs-quad-dietlibc.patch
19:26:30 <Vorpal> elliott_, yes indeed. But we live in a world where they exist and are widely used
19:26:34 <elliott_> nooga: Get pcc and dietlibc from their respective CVS repositories.
19:26:45 <Vorpal> elliott_, it is not realistic to hope to replace all that for your linux distro
19:26:47 <elliott_> Vorpal: And we also exist in a world where we have huge disks that can afford to waste space on crappy programs linking to huge libraries.
19:27:48 <Sgeo> And Smalltalk's just fine in its own little world. Working with the outside world is completely unnecessary
19:28:16 <elliott_> Vorpal: Sure, the disk bloat is unfortunate, but static linking also gets rid of a lot of headaches. And the programs that don't link to such huge libraries get smaller, so it's offset a bit. :)
19:28:28 -!- wareya has quit (Read error: Connection reset by peer).
19:28:42 <Vorpal> elliott_, how does it look for normal X programs?
19:28:55 <Vorpal> when it comes to static vs. dynamic binary size
19:28:57 <elliott_> Vorpal: Normal -- just libX11? Or GTK?
19:28:58 <Sgeo> Why not just do the dynamic thing, but manage the libraries properly?
19:29:08 <Vorpal> elliott_, both would be interesting to know
19:29:14 -!- wareya has joined.
19:29:15 <elliott_> Sgeo: (1) Doing so is either impossible or meaningless depending on your meaning.
19:29:28 <elliott_> Sgeo: (2) If Quake II's binary were statically linked, it would not run on anything today.
19:29:35 <pikhq> Vorpal: With Boost in particular, "dynamic linking" is a myth.
19:29:39 <elliott_> Because it is statically linked to the libc, it still works.
19:29:46 <elliott_> And Quake II is a fucking awesome game.
19:29:51 <elliott_> Vorpal: I haven't measured yet.
19:29:52 <pikhq> Vorpal: It uses templates heavily, making it effectively already statically linked.
19:29:59 <Sgeo> elliott_, you must have meant "weren't"
19:30:36 * elliott_ wonders what directory to install his recompiled pcc/dietlibc toolchain to.
19:30:45 <elliott_> pikhq: Wait, what's a triple again?
19:31:28 <Vorpal> elliott_, you still use binutils?
19:31:32 <Vorpal> elliott_, if so: why on earth
19:32:01 <elliott_> Vorpal: I don't see how you can infer that from what I said.
19:32:12 <elliott_> Vorpal: But yes, I do; I have searched far and wide and cannot find a binutils alternative.
19:32:14 <pikhq> elliott_: architecture-evendor-os for a triple, architecture-evendor-kernel-userspace for a quad.
19:32:24 <Vorpal> elliott_, "pcc/dietlibc/<no linker was mentioned> toolchain"
19:32:27 <elliott_> The BSD binutils will undoubtedly be BSD-specific.
19:32:38 <pikhq> elliott_: So, "x86_64-pc-linux-dietlibc"...
19:32:50 <Vorpal> elliott_, not really no. I presume gold is even worse? Plus iirc it is part of binutils
19:32:55 <elliott_> pikhq: Irritating. I want something that has the compiler in it :P
19:33:10 <Vorpal> elliott_, I thought it was C++
19:33:11 <elliott_> But it produced executables a few bytes bigger for me, so nyah. :P
19:33:14 <pikhq> elliott_: The build tuple is all about specifying an ABI.
19:33:16 <elliott_> But yeah, it is part of binutils.
19:33:21 <pikhq> elliott_: The compiler has nothing to do with the ABI.
19:33:29 <elliott_> pikhq: Then what should I use for my pcc/dietlibc name eh?! NOBODY TAKES THIS INTO CONSIDERATION
19:33:31 <pikhq> elliott_: Except when it does.
19:33:33 <elliott_> /opt/pcc-dietlibc MAYBE but that's just weird.
19:33:38 <Vorpal> elliott_, gold produces binaries a few bytes bigger eh, what is the extra data?
19:33:50 <pikhq> elliott_: /opt/pcc-x86_64-pc-linux-dietlibc/
19:33:55 <elliott_> Vorpal: No idea, I didn't check; I just tried gold, noticed an inflation, and put it back :P
19:34:23 <pikhq> elliott_: Sorry, but that's what you get if you want anything more than "lol I only support one ABI".
19:34:41 <Vorpal> elliott_, but pcc is not related to the ABI?
19:34:50 <Vorpal> you could have other compilers installed along side
19:34:53 <elliott_> But I still have to make an /opt directory :P
19:35:06 <elliott_> Vorpal: Yes, but I just want to denote "pcc and dietlibc" in a path name! STANDARDS SHOULD SUPPORT ME IN THIS ENDEAVOUR
19:35:11 <Vorpal> elliott_, so why not /opt/x86_64-pc-linux-dietlibc ?
19:35:24 <Vorpal> elliott_, but what difference does "pcc" there make
19:35:28 <Vorpal> since it doesn't affect ABI
19:36:14 <elliott_> I wonder why I have WANT_SSP enabled in my guide.
19:36:18 <elliott_> I wonder if it fixed something.
19:36:38 <elliott_> Vorpal: I could also call it /opt/linux, 'cuz it's running on linux.
19:36:42 <elliott_> But I'm trying to give it a relevant name :P
19:37:04 <elliott_> * check for valgrind, and if detected, turn off optimized SIMD string
19:37:05 <elliott_> * routines that cause false positives in valgrind. This enlarges and
19:37:05 <elliott_> * slightly slows down your code! */
19:37:12 <elliott_> HEY HEY I CAN TURN OFF VALGRIND SUPPORT AND GET SMALLER BINARIES
19:38:17 <elliott_> /* do you want smaller or faster string routines? */
19:38:28 <elliott_> I should probably go for faster, since it likely actually pays off here.
19:40:26 <Vorpal> elliott_, you know elliotOS, is it still "don't allow low level programming"?
19:40:41 <Vorpal> (outside the kernel parts that need it)
19:40:44 <elliott_> Vorpal: It's never been that exactly.
19:40:52 <elliott_> It's just that giving the low-level permission to anything is STOOPID :P
19:40:57 <oerjan> hm looks like criticism of nasa's arsenic bacteria is starting to roll in http://rrresearch.blogspot.com/2010/12/arsenic-associated-bacteria-nasas.html
19:41:14 <elliott_> Vorpal: (Synthesis-style stuff + specialisation = code that does stuff mapping directly to low-level things ends up doing them directly :P)
19:41:31 <Vorpal> elliott_, there are cases when it is useful (since I have yet to see a perfect compiler)
19:41:37 <Vorpal> number crunching mostly
19:41:58 <elliott_> Vorpal: good thing i'm writing the perfect compiler then
19:42:47 <Vorpal> elliott_, yes sure, but will it automatically use GPGPU calculations when that is beneficial? ;P And when exactly *is* it beneficial?
19:43:07 <Vorpal> same goes for SIMD of course
19:43:19 <elliott_> Vorpal: there's no reason i can't expose an interface to the GPGPU that is checked at compile-time
19:43:27 <Vorpal> elliott_, ah good answer
19:43:52 <elliott_> Vorpal: same way I expose an interface to the CPU that is checked at compile-time :P
19:44:54 <Vorpal> elliott_, and if an algorithm could make use of low level atomic operations with shared memory, would that be possible. That is of course somewhat tricky to check at compile time (shared memory I mean)
19:45:43 <elliott_> Vorpal: Perhaps not, but imagine an interface to shared memory with only safe optimisations, that is coded to manually use the low-level operations.
19:45:59 <elliott_> Then when it's used by user code, calls are just "inlined" down in the assembly so it uses them directly.
19:46:26 <Vorpal> indeed, would probably work for many common situations
19:47:33 <elliott_> pikhq: #define WANT_FASTER_STRING_ROUTINES
19:47:36 <elliott_> pikhq: WHAT DO I DO WHAT DO I DO
19:48:23 <elliott_> * lines from /etc/resolv.conf? Normally not used on boot floppies and
19:48:28 <elliott_> /* do you want the DNS routines to parse and use "domain" and "search"
19:48:28 <elliott_> * lines from /etc/resolv.conf? Normally not used on boot floppies and
19:48:34 <elliott_> no reason not to just use "nameserver"
19:48:44 <elliott_> Vorpal: I know that one will be smaller but slower and the other will be bigger but faster.
19:48:54 <Vorpal> elliott_, so presumably bigger and faster
19:48:56 <elliott_> Vorpal: It's just that while I'm hideously devoted to small binary size, I don't want shit to go slowly :P
19:49:02 <elliott_> Yeah, I'll go bigger and faster for this one.
19:49:03 <Vorpal> elliott_, string routines is after all hot code
19:49:35 <elliott_> Huh. dietlibc's localtime can read /etc/localtime.
19:49:43 <elliott_> But fuck that, because you can just set $TZ.
19:49:49 <Vorpal> elliott_, um why not read that file
19:50:01 <Vorpal> elliott_, since it needs to look up when DST changes anyway
19:50:13 <Vorpal> elliott_, I mean, TZ=Europe/Stockholm
19:50:27 <elliott_> Vorpal: That value violates POSIX.
19:50:32 <Vorpal> elliott_, I'm not going to change TZ two times / year :P
19:50:39 <Vorpal> elliott_, and you agreed that POSIX is stupid
19:50:44 <elliott_> http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
19:50:49 <elliott_> Vorpal: Scroll down to the bottom.
19:50:50 <Vorpal> elliott_, different countries change at different points
19:51:01 <elliott_> Vorpal: IT GOES INTO THE $TZ VARIABLE YOU IDIOT
19:51:13 <elliott_> Indicates when to change to and back from the alternative time. The rule has the form:
19:51:13 <elliott_> where the first date describes when the change from standard to alternative time occurs and the second date describes when the change back happens. Each time field describes when, in current local time, the change to the other time is made.
19:51:13 <elliott_> The format of date is one of the following:
19:51:17 <elliott_> The Julian day n (1 <= n <= 365). Leap days shall not be counted. That is, in all years-including leap years-February 28 is day 59 and March 1 is day 60. It is impossible to refer explicitly to the occasional February 29.
19:51:23 <elliott_> The zero-based Julian day (0 <= n <= 365). Leap days shall be counted, and it is possible to refer to February 29.
19:51:29 <elliott_> The d'th day (0 <= d <= 6) of week n of month m of the year (1 <= n <= 5, 1 <= m <= 12, where week 5 means "the last d day in month m" which may occur in either the fourth or the fifth week). Week 1 is the first week in which the d'th day occurs. Day zero is Sunday.
19:51:30 <Vorpal> elliott_, that varies between years
19:51:32 <elliott_> The time has the same format as offset except that no leading sign ( '-' or '+' ) is allowed. The default, if time is not given, shall be 02:00:00.
19:51:56 <elliott_> DST changes are rare, and call only for a new $TZ.
19:51:59 <Vorpal> elliott_, in some countries it does
19:52:23 <Vorpal> elliott_, Isral iirc used to have it decided on a year by year basis
19:52:59 <Vorpal> elliott_, what about 32-bit then
19:53:02 <Vorpal> elliott_, for multilib
19:53:57 <elliott_> This is just for my Debian machine, duh.
19:54:02 <elliott_> On Kitten it'll be /bin/pcc and /lib/libc.a.
19:54:18 <Vorpal> elliott_, and the -m32 one? does it do that in the same binary?
19:54:28 <elliott_> Vorpal: What are you trying to say?
19:55:14 <Vorpal> elliott_, how will you support multilib on there. Since you need different libc and sometimes different compilers (depending on if the compiler supports -m32 or equiv)
19:55:36 <elliott_> Vorpal: multilib packages go into prefix /arch/archname.
19:55:49 <elliott_> 32-bit dietlibc would go into /arch/x86/lib/libc.a.
19:56:12 <Vorpal> elliott_, shouldn't /bin symlink to /arch/<whatever>/bin ?
19:56:32 <Vorpal> elliott_, it would be kind of neat
19:57:03 <elliott_> pikhq: -rw-r--r-- 1 root root 864K Dec 5 19:55 libc.a
19:57:13 <elliott_> Vorpal: No; I briefly considered that and rejected it on the grounds of cluttering up /.
19:57:25 <elliott_> Vorpal: (If I could symlink / to /arch/<whatever>, that would be insane enough for me to consider it.)
19:57:27 <Vorpal> elliott_, also allow trivial change if you replace the CPU. Just update symlinks and the kernel. Change the disk to the new CPU (and possibly a new mobo), boot
19:57:41 <elliott_> Migrating CPU architecture NOT SUPPORTED :P
19:57:42 <Vorpal> elliott_, alas I believe that would present some problems
19:57:52 <Vorpal> elliott_, it SHOULD be because that would be COOL
19:57:57 <elliott_> There are non-x86 PCs, aren't there?
19:58:08 <elliott_> i.e. obeying the PC standard in every way except that they have a PPC there instead.
19:58:17 <elliott_> Vorpal: What's more fun is non-PC x86s.
19:58:29 <elliott_> Modern Macs aaaalmost manage to be that.
19:58:34 <Vorpal> elliott_, but this would work between 32/64 for the same arch at least
19:58:35 <elliott_> But since they can emulate a BIOS, not really.
19:58:43 <elliott_> Vorpal: Only if you recompiled everything first :P
19:58:47 <Vorpal> and if you made it work between, say, x86-64 and PPC32 then it would be awesome
19:58:54 -!- Mathnerd314 has joined.
19:59:08 <Vorpal> elliott_, nah, just install that other arch, change symlinks and kernel and reboot to new hardware
19:59:14 <Vorpal> elliott_, minimises downtime
19:59:35 <Vorpal> elliott_, also you can use a 64-bit kernel and a 32-bit userlamnd
19:59:42 <Vorpal> elliott_, even common on some arches iirc
19:59:57 <elliott_> Anyone want a precompiled pcc/dietlibc toolchain?
20:00:26 <Vorpal> elliott_, make one targeting h8300-coff
20:00:31 <elliott_> Has to be put in /opt/pcc-dietlibc because dietlibc's diet wrapper knows what prefix it was built with.
20:00:47 <Vorpal> elliott_, but kitten for RCX sounds awesome
20:10:51 <elliott_> Fucking hell, more problems with false and true.
20:11:48 <elliott_> 11K saved just by configuring the libc.
20:15:11 <elliott_> Sun Dec 5 20:14:31 [unknown timezone] 2010
20:18:12 <Vorpal> elliott_, also it breaks if you want to refer to a previous date. Which timezone is in effect then when the time for the switch changed
20:18:41 <elliott_> Vorpal: It's okay, dietlibc doesn't support locales anyway. Oh wait, yes it does.
20:18:48 <elliott_> It supports a whole two of them.
20:19:20 <Vorpal> elliott_, what about locale(1) next?
20:20:16 <Vorpal> elliott_, have you done mount yet?
20:21:22 <elliott_> no(1) doesn't print out the string it's given, forever.
20:21:33 <elliott_> (Or, if you actually wanted to make a reasonable no, it'd be the same as "yes n" :P)
20:21:41 <elliott_> Vorpal: Haven't done mount yet, no.
20:21:51 <elliott_> Vorpal: I'm refactoring this to stop using .h for library functions and stuff.
20:22:05 <Vorpal> elliott_, what would it use instead?
20:22:06 <elliott_> And to use bitmasks for flags when I can, and have a bool type aliased to char, and the like.
20:22:12 <elliott_> Vorpal: What would what use instead?
20:22:21 <elliott_> Vorpal: Right now, I have functions in .h files.
20:22:35 <Vorpal> elliott_, you mean the definitions?
20:22:40 <elliott_> (Making them .c would make my build system think they're utensils.)
20:22:55 <Vorpal> elliott_, your build system needs work
20:23:08 <elliott_> Vorpal: It was a 2 minute hack :P
20:23:15 <elliott_> It also makes the box bigger than it should be, since the library stuff is duplicated.
20:23:42 <elliott_> Woo, my Makefile now isn't hideously specific to my setup and only my setup.
20:23:55 <elliott_> (No, I will never use menuconfig.)
20:24:18 <elliott_> I should move sstrip out of the root with the Makefile...
20:25:31 <elliott_> make: *** No rule to make target `bin/basename', needed by `individual'. Stop.
20:25:52 <elliott_> What it means is that my implicit rule has an unsatisfied dependency :P
20:26:16 <elliott_> Makefile:32: *** Recursive variable `CFLAGS' references itself (eventually). Stop.
20:27:23 <elliott_> oerjan: you never answered my super-awesome question *sniff*
20:31:03 * nooga is patching tinyrb
20:32:48 <Vorpal> elliott_, you need to use := somewhere
20:33:00 <Vorpal> CFLAGS = $(CFLAGS) is what you have sooner or later currently
20:33:05 <Vorpal> you probably intended :=
20:33:07 <elliott_> Vorpal: actually it's more like
20:33:18 <Vorpal> indeed you need := then
20:33:31 <elliott_> (I fixed it another way, just curious)
20:33:53 <Vorpal> elliott_, btw are you sure there are no nicer alternatives to C here?
20:34:12 <Vorpal> elliott_, isn't there that memory safe C
20:34:23 <elliott_> Vorpal: I doubt any of them have a toolchain that produce binaries of similar tininess.
20:35:08 <Vorpal> elliott_, what about tcc
20:35:11 <elliott_> I think I should generate a Makefile with a script... since different utensils will have different dependencies from my library.
20:35:16 <Vorpal> elliott_, does it give larger binaries?
20:35:28 <Vorpal> but how does it compare to pcc
20:35:28 <elliott_> I haven't bothered measuring tcc since it supports so little.
20:36:02 <elliott_> Vorpal: Allow me to just say "Good luck compiling my sleep.c to less than 1791 bytes" :P
20:36:30 <elliott_> Vorpal: If a compiler somehow magically elided entries from the errno strings table that no syscall in the program could produce, that would make a few of my utilities a K or two smaller.
20:36:39 <elliott_> I could probably do it manually, but it's *way* more trouble than it's worth.
20:36:43 -!- p_q has joined.
20:37:09 -!- poiuy_qwert has quit (Ping timeout: 240 seconds).
20:38:47 <Vorpal> elliott_, perfect minimal hash of errno!
20:38:54 <Vorpal> (for only the entries you need)
20:39:12 <oerjan> elliott_: it is generally useless to try and force an opinion out of me if i don't actually have one
20:39:26 <elliott_> fine! i'll force one out of Vorpal
20:39:35 <Vorpal> elliott_, with regards to what?
20:39:43 <elliott_> Vorpal: if the box executable is called cutlery, and the individual programs are utensils, should the project be called cutlery or utensils?
20:39:50 <elliott_> i.e. is it "utensils.h" or "cutlery.h" for the library header
20:39:54 <Vorpal> elliott_, no idea. You decide
20:39:55 <elliott_> where the library is all the auxiliary functions some applets use
20:40:09 <Vorpal> elliott_, I find the names rather confusing as it is. Would certainly fit into ick
20:40:29 <elliott_> Vorpal: I started out with utility... utensils, and it's kind of blossomed from there :P
20:40:40 <Vorpal> elliott_, yes but I think it went too far
20:40:41 <elliott_> Previously the directory was ~/code/tools and the box was called "box", which was rather bland. :p
20:40:56 <elliott_> Vorpal: "busybox" -- the box isn't really BUSY!
20:41:01 <Vorpal> elliott_, kitchen drawer?
20:41:15 <elliott_> I think I'm calling the box cutlery.
20:41:27 <Vorpal> elliott_, whatever, it is up to you
20:41:41 <elliott_> I'll use gets if you don't decide.
20:42:19 <Gregor> cutlerybox, not box cutlery
20:42:29 <Vorpal> elliott_, also I'm kind of surprised that gcc or clang can't produce smaller code. Maybe they produce lots of useless stuff around?
20:42:34 <Vorpal> such as .eh_frame or such
20:42:47 <elliott_> Vorpal: I haven't tried clang, I doubt it will work with dietlibc in any way, shape or form :P
20:42:47 <nooga> it's sooo relaxing
20:42:49 <nooga> https://github.com/nooga/tinyrb
20:43:02 <nooga> impelemnting standard ruby classes in C
20:43:11 <elliott_> Gregor: If the box is cutlery and the individual programs are utensils, is the header file for all the auxiliary functions they use -- and thus the project -- named "utensils" or "cutlery"?
20:43:51 <Vorpal> Gregor, please please give elliott_ a third option :P
20:44:02 <Vorpal> elliott_, also what is with the _ ?
20:44:06 -!- elliott_ has changed nick to elliott.
20:44:09 <elliott> I got disconnected at one point.
20:44:12 -!- elliott has quit (Changing host).
20:44:12 -!- elliott has joined.
20:44:22 <Vorpal> elliott, ah, so you weren't going to justify it like ais
20:45:17 <Vorpal> Gregor, what is a porknife?
20:47:09 <elliott> Gregor: It's more what the project is named than what the header is named :P
20:47:11 <nooga> and then i will write a kernel in ruby
20:47:22 <elliott> nooga: Good luck with that, n00b :P
20:48:08 <Gregor> elliott: IWillCutYou.h
20:48:26 <nooga> elliott: i was completely serious :P
20:48:38 <elliott> Gregor: If you don't name the project either utensils or cutlery, I will use gets.
20:49:38 <elliott> Phantom_Hoover: gets(babise)
20:50:06 <elliott> "The compiler is based on the original Portable C Compiler by S. C. Johnson"
20:52:14 <elliott> Gregor: NOBODY SAYS "CUTLERY BOX"
20:52:35 <Gregor> elliott: Google gets 21K results
20:52:52 <elliott> Gregor: Notice that none of them are people :P
20:53:12 <Gregor> elliott: They're all manufacturers of cutlery boxes!
20:53:17 <Gregor> Phantom_Hoover: But it has to end in "box"
20:53:17 <Vorpal> elliott, indeed. "cuboid unit for storage of tools related to food" is way more common
20:53:36 <elliott> Gregor: { #include "cutlery.h" } or { #include "utensils.h" }, pick ONE :P
20:54:13 <Vorpal> elliott, or utenlery.h
20:54:21 <elliott> Phantom_Hoover: I asked Gregor :P
20:54:28 <Gregor> Mmmmmmmmmmmmmmmmmmmmmmmm
20:54:36 <Gregor> `run echo $(( RANDOM % 2 ))
20:54:37 <Vorpal> Phantom_Hoover, why not interleave the two words
20:54:58 <Phantom_Hoover> Vorpal, because that is just stupid and ruins the joke.
20:55:06 <Vorpal> Phantom_Hoover, exactly
20:55:12 -!- Sasha has joined.
20:55:13 <Gregor> elliott: cutlery it is
20:55:22 <nooga> elliott: why n00b?
20:55:34 <elliott> Gregor: Now pick one without the use of a random number generator!
20:55:42 <elliott> Phantom_Hoover: Nsils can't be cute, anyway.
20:55:46 -!- Sasha2 has quit (Read error: Connection reset by peer).
20:55:49 <elliott> Gregor: Now pick one without the use of a random number generator!
20:56:04 <elliott> I'm going to do this 1000 times and measure the # of each, and if they're equal, well
20:56:18 <Vorpal> elliott, he did. He used a *pseudo-random* number generator
20:56:40 <Vorpal> elliott, what? Use PRNGs?
20:57:25 <elliott> Hmm, I should specify dependencies in the first line of the source.
20:57:40 <elliott> /** parsemode.c foo.c blah.c **/
20:57:58 <elliott> And then I can generate a makefile based on those.
20:58:12 <Vorpal> elliott, does pcc not support generating dependency info
20:58:28 <elliott> Vorpal: You mean -M and the like?
20:58:31 <elliott> To get header dependencies?
20:58:36 <Vorpal> elliott, yeah that might be the switch
20:58:36 <elliott> There's one header for all the library C files.
20:58:39 <elliott> There's one header for all the library C files.
20:59:09 <elliott> Vorpal: Since I'm "statically linking" (actually just passing the C file to the compiler as well as the program) these, I basically need one or two functions per file.
20:59:13 <elliott> And I don't want 45895798347589345 headers :P
20:59:15 <Vorpal> elliott, also if all go into the same binary surely you want to do LTO?
20:59:31 <elliott> Vorpal: IIRC -O1 made stuff go lolbreak when I tried it.
20:59:54 <elliott> What is LTO, then, for binutils ld? :P
20:59:57 <Vorpal> elliott, or do you mean -Wl,-O1? which is completely different
21:00:05 <Vorpal> elliott, you need gold for it iirc
21:00:08 <elliott> Vorpal: Not -Wl, I passed it directly to the linker.
21:00:17 <Vorpal> elliott, anyway -O1 there is just optimising symbol tables or something iirc
21:00:27 <elliott> Well, I don't have any symbol tables :P
21:00:58 <Vorpal> elliott, but you want LTO surely?
21:01:08 <elliott> Vorpal: I doubt it could help me.
21:01:14 <elliott> And I doubt there are any tools that will work with my toolchain that can do that.
21:01:22 <Vorpal> elliott, might when you link all into the same box binary
21:01:30 <Vorpal> or when you have larger ones
21:01:41 <elliott> Vorpal: Go on, then, name a tool.
21:01:49 * Phantom_Hoover laments the absence of any nice spaceflight simulators.
21:01:52 <Vorpal> elliott, I'm no pcc-expert
21:02:05 <elliott> Vorpal: You can't be a pcc expert, it's just a cc :P
21:02:26 <Vorpal> elliott, well, what about writing an llvm backend for pcc
21:02:30 <Phantom_Hoover> But no (portable) ones that actually simulate a spaceship as one might work in real life.
21:02:46 <elliott> I don't think LLVM has much in the way of size optimisation anyway.
21:02:48 <Vorpal> Phantom_Hoover, xplane can do it iirc
21:02:56 <Vorpal> Phantom_Hoover, for the space shuttle
21:03:01 <Phantom_Hoover> Also, EVE is a mumorpeger and I refuse to play it on principle.
21:03:06 <elliott> Vorpal: Anyway LLVM is C++.
21:03:22 <elliott> Vorpal: And I doubt it does static linking. :P
21:03:25 <elliott> 100000000000000000TB clang
21:03:39 <Vorpal> elliott, and not more than a few hundred MB
21:04:25 <Vorpal> Phantom_Hoover, of course xplane is... xplane. More of a flight sim than a space sim. But it can do the space shuttle from ground to landing again iirc
21:04:26 <elliott> static void barfx(char *who)
21:04:45 <Vorpal> Phantom_Hoover, and there is xplane for linux. Still not free or such
21:05:10 <Vorpal> Phantom_Hoover, aka, getting it through a bay or similar
21:05:32 <Vorpal> elliott, there is a macro in there
21:05:46 <elliott> char *errstr = strerror(errno); \
21:05:46 <elliott> write(2, who, strlen(who)); \
21:05:48 <elliott> write(2, errstr, strlen(errstr)); \
21:05:55 <elliott> Look ma, I'm avoiding code duplication :P
21:06:01 <Vorpal> elliott, why the macro
21:06:18 <Vorpal> Phantom_Hoover, such as a pirate one yes. Off the coast of Somalia iirc
21:06:23 <elliott> Vorpal: Because if you only call it once it's smaller than a function according to my measurements.
21:07:01 <Vorpal> elliott, wait what, doesn't pcc elide a static non-called function if it inlined it for all calls?
21:07:10 <Phantom_Hoover> Vorpal, wait, a piece of commercial software that hasn't been pirated?
21:07:19 <Vorpal> Phantom_Hoover, what. Where did I say that
21:07:23 <elliott> Vorpal: I have no idea. The different was the matter of a few bytes.
21:07:25 -!- kar8nga has joined.
21:07:34 <Vorpal> elliott, sounds like pcc fails at inlining :P
21:07:58 <elliott> Vorpal: Perhaps, but it wins at turning carefully-written sources into smaller binaries than gcc.
21:08:10 <elliott> int parsemode(char *str, mode_t old)
21:08:13 <Vorpal> elliott, specialcased for pcc no doubt
21:08:16 <elliott> Modes could fit into a short!
21:08:29 <elliott> Vorpal: I don't have anything "silly" in here.
21:08:41 <Vorpal> elliott, that will only slow you down. In general 16 bit wide registers are slower to access on modern x86-64 iirc
21:08:48 <Vorpal> I seem to remember that in intel's docs
21:09:01 <elliott> Vorpal: But it *will* make the binary smaller.
21:09:14 <Vorpal> elliott, not if it isn't a variable that wide
21:09:24 <Vorpal> elliott, or you save on a shorter instruction
21:09:38 <Vorpal> (since x86 is mad and uses variable width instructions)
21:09:56 * elliott goes through and s/int/unsigned/ everywhere he can
21:10:05 <elliott> (Quicker to divide on some CPUs!)
21:11:11 <Vorpal> elliott, slower on other ones
21:11:34 <Vorpal> elliott, iirc AMD and Intel gave contradictory recommendations for that when it came to the core2/k8 generations
21:11:43 <Vorpal> I don't know about current suggestions
21:12:20 <Deewiant> On x86-64 the 16-bit instructions have longer encodings
21:12:54 <Vorpal> Deewiant, you need a prefix-byte right?
21:13:26 <Vorpal> elliott, written sort(1) yet?
21:13:45 <elliott> Vorpal: No, I'm busy making my build system not suck.
21:13:57 <Vorpal> elliott, if it uses int where it should use size_t it would possibly crash on data files larger than 4 GB. But the binary would be smaller
21:14:13 <Vorpal> elliott, which do you think is most important: size or correctness?
21:14:17 <elliott> Vorpal: I don't use size_t :P
21:14:22 <Vorpal> elliott, which do you think is most important: size or correctness?
21:14:36 <Vorpal> elliott, can you elaborate on that?
21:14:42 <Vorpal> elliott, what about the example I gave
21:14:54 <elliott> Correctness if a plausible scenario exists in which incorrectness would break something. So for files that could be quite big reasonably, yes, use a bigger type.
21:15:05 <elliott> If it's, say, /etc/localtime, no, that is not going to be 4 gigs.
21:15:24 <Vorpal> elliott, will you do that for stuff like sort(1)?
21:16:09 <elliott> If I was REALLY size-obsessed, I would write in asm. :P
21:16:20 <Vorpal> elliott, also: which sorting algorithm. heapsort?
21:16:32 <elliott> Vorpal: Probably qsort, because it's in libc.
21:16:46 <Vorpal> elliott, but is that quicksort or something else?
21:16:58 <elliott> It's MEANT to be qsort, I believe :P
21:17:18 <Vorpal> elliott, but that has worst case O(n²) complexity
21:17:31 <elliott> Indeed. Nobody cares unless it's a network service.
21:17:51 <Vorpal> elliott, but what about my shell CGI script!?
21:18:05 <elliott> Vorpal: Why do you let people input 4 gigs?
21:18:13 <elliott> (Or any size big enough that n^2 matters :P)
21:18:59 <Vorpal> elliott, next you will say you will use backtracking regexps instead of a DFA
21:19:06 <elliott> Vorpal: Now that I won't do.
21:19:33 <Vorpal> elliott, but nobody cares unless it is a network service ;P
21:19:50 <elliott> Vorpal: Backtracking regexps are also more code. :P
21:22:48 <Vorpal> elliott, will you use the standard fsck or write your own?
21:23:31 <elliott> Vorpal: Standard, probably; after all, they're usually in separate filesystem packages.
21:23:54 <Vorpal> elliott, but fsck is just a thin wrapper that calls fsck.foo
21:24:06 <elliott> Vorpal: Yes, but it figures out what filesystem type it is, doesn't it?
21:24:09 <Vorpal> elliott, same as mount calls mount.<foo> for many <foo>
21:24:36 <elliott> Vorpal: Although I might unify all mounts if I can get away with it.
21:24:40 <Vorpal> elliott, but there is mount.fuse, mount.nfs, mount.nfs4, mount.ecryptfs an a few more here
21:25:05 <elliott> Hmm, the /*@ prefix is splint, isn't it?
21:25:11 <elliott> So I should probably use /*$ instead for my metadata lines.
21:25:17 <Vorpal> elliott, it is a lot of things. Could be doxygen too
21:25:59 <Vorpal> elliott, probably not an issue for you
21:26:00 <elliott> Vorpal: If it's a lot of things, then no issue adding another!
21:26:27 <Vorpal> elliott, mot of those tools will throw errors when encountering those kind of strings for the other tools
21:26:36 <Vorpal> elliott, why not /*% ?
21:27:15 <Vorpal> wait, doxygen is /*@{*/ for blocks. But otherwise it is /** */
21:27:17 -!- zzo38 has joined.
21:27:30 <Vorpal> splint is @, frama-c is @
21:27:36 -!- Wamanuz3 has joined.
21:27:36 <Vorpal> elliott, thus, yeah avoid those two
21:27:37 <elliott> Vorpal: I'm just going to use @ :P
21:27:44 <elliott> I don't intend to use splint since it sucks.
21:27:49 <elliott> I don't intend to use frama-c since... I just don't.
21:27:56 <Vorpal> elliott, why not. It is awesome
21:28:01 <elliott> Vorpal: Formally verified coreutils! Awesome! And useless. :P
21:28:21 <Vorpal> elliott, not useless. NUCLEAR REACTORS
21:29:05 <Vorpal> elliott, also remember formally verified standard card game, in case they get bored
21:29:13 <elliott> please do not let any nuclear reactors be built whose software runs on Unix.
21:29:25 <elliott> Hmm, can you say "all but first and last fields" in cut?
21:29:44 <Vorpal> elliott, not sure. I use awk
21:29:52 <elliott> Vorpal: awk doesn't make that easy either :p
21:30:00 <Vorpal> elliott, it was a joke
21:30:15 <Vorpal> elliott, first AND last is easy
21:30:23 <zzo38> I just do not like the input format of Frama-C. I think it should instead involve some automatic and some commands inserted inline in the C code, such as assert() and assume() and so on.
21:30:40 <Vorpal> zzo38, that would mess up compiling it
21:30:42 <zzo38> And then be able to convert a data flow diagram into a new chapter for the program.
21:30:45 -!- Wamanuz2 has quit (Ping timeout: 240 seconds).
21:30:47 <Vorpal> which is *why* it goes into comments
21:31:04 <Vorpal> (this discussion is pointless probably)
21:31:35 <fizzie> For "short foo1(short a) { return a + 1; }" and "int foo2(int a) { return a + 1; }", gcc -Os generates absolutely identical code ("leal 1(%rdi), %eax; ret"); in any case switching from int to short in general doesn't sound like it's likely to save in binary size (except maybe for initialized constants); run-time memory use, maybe.
21:31:47 <zzo38> Vorpal: It will not mess up compiling it if you do something like this: #ifndef __FRAMA_C__ #define assert(x) #define assume(x) #endif
21:32:05 <elliott> Why the heck is this invalid sed...
21:32:11 <elliott> It says that the s command is unterminated.
21:32:53 <zzo38> Probably (I think)
21:32:58 <Vorpal> elliott, also perhaps you need to hide the ! from the shell
21:33:08 <Sgeo> Weird dream just now
21:33:22 <Sgeo> Was in a fire, mamahed to put it out and survive
21:33:25 <Sgeo> elliott, napped
21:33:50 <Sgeo> Fire burned my foot, leaving a ... window like injury
21:33:58 <Sgeo> As though my foot was hollow
21:34:01 <nooga> Sgeo: take your computer and run, maybe your home is on fire
21:34:52 <nooga> 22:28 < elliott> please do not let any nuclear reactors be built whose software runs on Unix.
21:34:56 <nooga> 22:28 < elliott> Thanks,
21:34:59 <nooga> 22:28 < elliott> -a unix developer
21:34:59 <Vorpal> Phantom_Hoover, I doubt activeworlds does anything that interesting
21:35:15 <Vorpal> or even custom from the bottom
21:35:17 <nooga> ah right, one of those RTOSes
21:35:18 <zzo38> No, it needs to be a specially designed operating system
21:35:26 <Vorpal> nooga, formally verified probably
21:35:33 <Phantom_Hoover> zzo38, you think all problems should be solved with that!
21:36:02 <Vorpal> Phantom_Hoover, that makes sense in this case
21:36:18 <nooga> automatics usually run on special controllers
21:36:25 <nooga> without advanced OSes
21:36:49 <Sgeo> Except for centrifuges in Iran
21:37:12 <Vorpal> what, I missed that? what did they do?
21:37:18 <nooga> i've studied automatics and robotics but it was extremely boring
21:37:22 <zzo38> Phantom_Hoover: What do you mean, I think all problems need to be solved, with what?
21:37:24 <nooga> so i switched to computer science
21:38:11 <Sgeo> Vorpal, got hit with a nation-state piece of malware designed specifically to hit those centrifuges. It used Windows exploits
21:38:17 <nooga> i wonder who programs NASA's spaceships
21:38:21 <Sgeo> nation-state authored
21:38:26 <Sgeo> Vorpal, look up Stuxnet
21:38:28 <nooga> this must be the coolest job ever
21:38:41 <Vorpal> nooga, you mean, the core memory
21:38:59 <Vorpal> nooga, the space shuttle flight computers uses core memory
21:39:21 <nooga> primitive and failsafe
21:39:33 <elliott> Nuclear reactor == you do NOT ever have your monitor software NOT active.
21:40:07 <nooga> well explored and not that vulnerable
21:40:29 <fizzie> The "nation-state authored" bit of Stuxnet is pure speculation, basically based on Kaspersky Labs saying "oh, it's so clever, it must've been built by a country".
21:40:52 <nooga> nuclear reactor is not very special from automatics point of view
21:40:57 <fizzie> While Symantec on the other hand "estimates that the group developing Stuxnet would have been well-funded, consisting of five to ten people, and would have taken six months to prepare".
21:41:11 <nooga> it may be dangerous if ill-treated
21:42:01 <Vorpal> fizzie, also they must have known exactly what hardware was used there
21:42:04 <elliott> echo "$needs" | sed 's!^/\*@needs: !!g; s! \*/$!!g; s!^\| !\0lib/!g'
21:42:23 <nooga> elliott: i like how esoteric it looks at first glance
21:42:29 <fizzie> Vorpal: Well, it's basically a heuristic.
21:43:00 <Vorpal> fizzie, but they had to know it was Siemens not some other manufacture
21:43:26 <fizzie> Also only two models of frequency converters it attacks, so yes.
21:44:08 <fizzie> And I'm not sure it'd be a good idea to put NASA programmers to build nuclear reactor automation; we'll get another Ariane 5.
21:45:29 <Vorpal> only if we use nasa managers I suspect
21:46:01 <nooga> avionics is harder to handle than a stupid tank of water with radioactive poles inside and few steam turbines
21:46:19 <nooga> bunch of pumps and sensors, nothing special imho :D
21:48:16 <Sgeo> What's wrong with Ariane 5?
21:51:50 <Vorpal> it was as self-destruct sequence
21:52:28 <Vorpal> http://en.wikipedia.org/wiki/Ariane_5#Notable_launches <--- lots and lots of issues
21:53:02 <nooga> because they f^&^& up the deadline
21:53:10 <elliott> bin/%: bin/%.c | lib/cutlery.h tools/sstrip
21:53:11 <elliott> @if [ "$(strip)" = 1 ]; then tools/sstrip $@; fi
21:53:14 <elliott> annoyingly this doesn't work
21:53:19 <elliott> because it treats bin/cal as a separate rule to bin/%
21:54:01 <Vorpal> elliott, I seem to remember that
21:54:21 <Vorpal> elliott, might be GNU ONLY
21:54:26 <elliott> Vorpal: So is everything else I'm doing.
21:54:39 <Vorpal> elliott, also not sure it does what I think
21:54:47 <elliott> What I'm doing here proves that you can use make for a configurable, portable, clean build system without any Makefile generators -- just as long as you're willing to go insane.
21:55:05 <elliott> Vorpal: No, deosn't work. What :: is for is adding new commands to existing rules.
21:55:15 <Vorpal> elliott, ah, not new deps
21:55:24 <elliott> The problem is just that bin/% != bin/cal, even though the former matches :P
21:55:53 <Vorpal> elliott, maybe make bin/% depend on obj/%.o then add it in there?
21:56:15 <elliott> Vorpal: I'd rather not call the compiler twice.
21:56:37 <elliott> Vorpal: Anyway, it still wouldn't help because obj/%.o still isn't the same as obj/foo.o for any foo :P
21:57:04 <Vorpal> elliott, what is the | for in that line?
21:57:22 <Vorpal> I don't remember what that does
21:57:25 <elliott> Vorpal: Dependency-only dependencies. :P
21:57:29 <elliott> Vorpal: It doesn't appear in $^.
21:57:38 <elliott> Obviously I don't want to send sstrip and the header to cc.
21:57:51 <elliott> ifeq ($(shell [ -e deps.make ]; echo $?),0)
21:58:12 <elliott> Otherwise I get a nasty error when including deps.make when it doesn't exist.
21:58:19 <elliott> makes sure it's generated.
21:58:20 <Vorpal> elliott, but isn't there some other way to do it?
21:58:26 <Vorpal> I seem to remember there is
21:58:27 <elliott> Vorpal: Probably, but I don't know what it is :P
21:58:50 <elliott> Hmm, I could add dependency-tracking to the actual CC line.
21:59:00 <Vorpal> elliott, that would break make -j2
21:59:14 <elliott> $(CC) $(CFLAGS) $< `tools/depsfor $<` -o $@
21:59:21 <Vorpal> elliott, would break make -j2
21:59:21 <elliott> Vorpal: No, because I never build the lib/foo.c files.
21:59:26 <elliott> Only as part of the programs.
21:59:33 <Vorpal> elliott, what about if you change those files
21:59:40 <Vorpal> elliott, would it rebuild properly
21:59:43 <Vorpal> without make clean all
21:59:55 <elliott> Vorpal: bin/%: bin/%.c $(shell tools/depsfor $<)?
21:59:57 <Vorpal> elliott, if not you might just as well use ant
22:00:06 <Vorpal> elliott, I have no clue if that would work
22:00:32 <elliott> Because $< isn't in scope at that point and I can't say "tools/depfor bin/%.c" obviously.
22:00:52 <Vorpal> elliott, hm. so what does other build systems do?
22:01:22 <Vorpal> elliott, why not a makefile generator?
22:01:26 <elliott> Vorpal: Not encode dependencies inside the source file? (BusyBox actually does this, and encodes Kconfig options (!) in there too, but then it uses Kconfig. It is a rather big build system.)
22:01:30 <elliott> Vorpal: I DO have a Makefile generator!
22:01:34 <elliott> It just generates deps.make.
22:01:38 <elliott> Vorpal: Or do you mean I should have
22:01:48 <Vorpal> elliott, I mean it might be time to consider one
22:01:54 <elliott> If so: dude, that Makefile would be massively redundant and huge.
22:01:58 <elliott> Vorpal: I. am. using. one.
22:02:15 <Vorpal> elliott, okay so go read the manual then
22:02:21 <Vorpal> to find out if it is possible
22:02:22 <elliott> Vorpal: The Make manual? I have.
22:02:29 <Vorpal> elliott, the info page yes
22:02:58 <elliott> Vorpal: Um, the make manual is not maintained as an info page.
22:03:03 <elliott> It is a texinfo manual. http://www.gnu.org/software/make/manual/make.html
22:03:13 <Vorpal> but the info page is one form of it
22:03:16 <elliott> Anyway, that really doesn't help me.
22:03:49 -!- TLUL has joined.
22:03:57 <Vorpal> elliott, http://www.gnu.org/software/make/manual/make.html#Multiple-Rules ?
22:04:28 <elliott> Vorpal: Doesn't help when one rule is implicit.
22:04:56 <elliott> "If none of the explicit rules for a target has a recipe, then make searches for an applicable implicit rule to find one see Using Implicit Rules)."
22:05:22 <Vorpal> elliott, that made more sense when you saw the hyperlink :P
22:05:47 <elliott> And no ; after "find one".
22:05:58 <Vorpal> elliott, you mean missing ( before see
22:06:05 <Vorpal> that seems more likely
22:06:27 <Vorpal> elliott, is this any use? http://www.gnu.org/software/make/manual/make.html#Static-Pattern
22:07:33 <Sgeo> Maybe I'll watch some DS9
22:09:00 <Sgeo> Phantom_Hoover, I have no intentions to start deadblogging, if it's all right with you
22:09:21 <Vorpal> Sgeo, irc is not twitter
22:09:31 <Vorpal> ("<Sgeo> Maybe I'll watch some DS9" seemed to fit that)
22:10:15 * oerjan drinks some orange juice
22:10:38 <Sgeo> Whatever it was that it was supposed to be
22:14:07 <Phantom_Hoover> The things SEXPs were meant to implement but ended up replacing?
22:14:47 <elliott> Dear make: if a file does not exist, it is *NOT* up to date.
22:15:02 <elliott> Especially if the target is not phony.
22:15:09 <elliott> You are not Holden Caulfield.
22:15:13 <elliott> You do not consider every target phony.
22:17:22 -!- kar8nga has quit (Remote host closed the connection).
22:18:40 <Sgeo> Phantom_Hoover, yes
22:19:56 <elliott> WHAT THE FUCK ARE YOU DOING MAKE
22:20:05 <elliott> Considering target file `bin/basename'.
22:20:05 <elliott> File `bin/basename' does not exist.
22:20:05 <elliott> Pruning file `bin/basename.c'.
22:20:05 <elliott> Finished prerequisites of target file `bin/basename'.
22:20:05 <elliott> Must remake target `bin/basename'.
22:20:05 <elliott> Successfully remade target file `bin/basename'.
22:22:45 <Vorpal> elliott, I like how rsync --stats writes stuff like: "123M bytes"
22:23:56 <Vorpal> elliott, Mi bytes would be even funnier.
22:24:11 <Vorpal> so you have Do bytes, Re bytes and Mi bytes
22:25:39 <elliott> Do, a deer, a female deer.
22:26:01 <Vorpal> elliott, must be male. First name is John after all
22:26:58 <Vorpal> oerjan, oh did I steal your joke?
22:26:59 <elliott> Vorpal: Ray, a drop of golden sun. So cubic time, then, is solar.
22:27:05 <elliott> <Vorpal> oerjan, oh did I steal your joke?
22:27:19 <elliott> Vorpal: btw, I got it working.
22:27:22 <elliott> bin/basename: bin/basename.c ; $(utensil)
22:27:25 <elliott> Bunch of lines like that now.
22:27:34 <elliott> Vorpal: Did you get the Ray -> Gene Ray reference that makes that make any sense at all? :P
22:27:37 <Vorpal> elliott, the ; $() stuff I mean
22:27:45 <Vorpal> elliott, yes it was obvious
22:27:49 <elliott> Vorpal: ; lets you start the commands for a rule. It's like \n\t.
22:27:53 <elliott> Except without the newline or tab.
22:27:59 <Vorpal> elliott, once I hit "cubic time" it was obvious
22:28:02 <elliott> @if [ "$(strip)" = 1 ]; then tools/sstrip $@; fi
22:28:04 <oerjan> Vorpal: well i'm apparently supposed to punish _other_ people's bad puns. i have no idea why...
22:28:08 <elliott> That should answer the $() bit.
22:28:21 <elliott> oerjan: state-sanctioned monopoly, duh
22:28:29 <elliott> Vorpal: It's like = except multi-line.
22:28:35 <elliott> Vorpal: Did I mention you can make macros that take parameters?
22:28:39 <elliott> $(call func,arg1,arg2,arg3).
22:29:01 <Vorpal> what. this OCR-ed selection and copy text fails
22:29:07 <Vorpal> "¥qC :4roär̆L W ̆4r;x̆rVC̆̈ C qKCr;̈C : ̆4r ̆r» r ¤r"
22:29:28 <Vorpal> really: "Using, for example, the Sierpinski trangle"
22:29:29 <oerjan> the sun is actually a cube. it just looks round because the light is bent by gravity.
22:29:51 <Vorpal> elliott, this is annoying, I wanted to copy this stuff here
22:29:56 <Vorpal> elliott, it was from SIGBOVIK
22:30:03 <elliott> for src in $(make --no-print-directory _print_sources); do
22:30:29 <Vorpal> elliott, RECURSIVE MAKE?
22:31:09 <elliott> Vorpal: Well. Yes. Make calls tools/genrules, which calls make again to do _print_sources.
22:31:14 <elliott> However, that is the only way it is recursive :P
22:31:25 <elliott> _print_sources just... prints $(sources), as you can see in the rule definition above.
22:31:35 <Vorpal> elliott, this paper discusses fractal footnotes
22:31:52 <Vorpal> elliott, well, what did you expect with SIGBOVIK
22:32:03 <elliott> Oh yeah, Vorpal is a SIGBOVIK expert.
22:32:16 <elliott> It totally isn't oerjan's linking yesterday that gives him this expertise, no no :P
22:32:32 <Vorpal> elliott, oh I wondered why the tab was open in my browser
22:32:42 <elliott> What... what kind of error is that.
22:32:44 <Vorpal> (seriously, I had no clue)
22:32:49 <Vorpal> (and read it and found it interesting)
22:32:54 <elliott> "Hey you! Something went wrong in this file! What went wrong is ."
22:33:15 <oerjan> Vorpal: the 2007 conference was apparently where wikiplia was announced
22:33:27 <elliott> $ /opt/pcc-dietlibc/bin/diet -Os /opt/pcc-dietlibc/bin/pcc -Wall -Ilib -Wl --gc-sections bin/cal.c lib/ultostr.c -o bin/cal
22:33:43 <Vorpal> oerjan, this is "Level-of-Detail Typesetting of Academic Publications"
22:35:07 <elliott> how do i have an array declared in a header file that is statically initialised in a .c file including that header
22:35:11 <elliott> i've never been able to figure that one out
22:35:24 <zzo38> Do you like to join help with 'Charities for poor people and monsters with names starting with "A"'?
22:35:34 <Vorpal> elliott, also wonderful idea to fit infinite amount of text into a page based on halving the typeface (same way as one of Zeno's paradoxes iirc)
22:35:45 <oerjan> Vorpal: that rings a bell, i think that was one of tom7's other contributions the same year?
22:35:58 <elliott> Vorpal: oh, just doing extern makes it work?
22:36:05 <Vorpal> elliott, then int foo[] whatever
22:36:12 <Vorpal> elliott, extern in the header yes
22:36:22 <elliott> Somehow doing "cc foo.c bar.c" is bigger than "cc foo.c" where foo.c includes bar.c.
22:36:27 <elliott> Of course I did have to remove a lot of "static"s...
22:36:31 <oerjan> elliott: no but i read that blog post i also linked yesterday (i haven't actually read the SIGBOVIK site)
22:36:37 <Vorpal> elliott, well obviously due to poor compiler
22:36:42 <Vorpal> elliott, you want gcc --combine
22:36:51 <Vorpal> elliott, pcc probably can't do it
22:38:55 <elliott> Vorpal: Or I could compile stdin, and use cat.
22:39:26 <elliott> Actually, I can probably have a LIBRARY define that's done like
22:40:05 <elliott> that way, I can still get stuff combined in box builds
22:40:10 <elliott> but use static in individual builds
22:40:47 -!- MigoMipo has quit (Read error: Connection reset by peer).
22:41:01 <Vorpal> hah the sigbovik proceedings pdf has a disclaimed about LaTeX allergies
22:41:10 <Vorpal> mixing up latex and LaTeX
22:41:11 <elliott> lib/cutlery.h, line 22: syntax error
22:41:21 <elliott> I'm going to add a DEBUG=1 that uses gcc :P
22:41:26 <Phantom_Hoover> [[This is what our species is capable of at our highest form of endeavor. Even if all of us can’t create and compose like this, thank God our humanity links every human being to it.]]
22:41:30 <Vorpal> elliott, clang gives better errors
22:41:41 <elliott> Phantom_Hoover: LazyTown: The Ukulele Cover
22:41:46 <elliott> Vorpal: gcc gives acceptable errors.
22:41:51 <elliott> Phantom_Hoover: What then?
22:41:54 <Sgeo> Never Gonna Give You Up
22:42:22 <Vorpal> elliott, "gcc: line 22: expected } " "clang: line 12: you maybe forgot a ; here. Look here is the line and an arrow to where I think it should be"
22:42:44 <Vorpal> elliott, the different line numbers were intentional
22:42:55 <Vorpal> elliott, yes but it sucks when it comes to syntax errors
22:42:57 -!- Phantom_Hoover has quit (Remote host closed the connection).
22:43:15 <Sgeo> This assignment is not worth the two seconds needed to type it
22:43:16 <elliott> Vorpal: Better than "syntax error".
22:43:24 <Sgeo> Maybe the two seconds Googling for the main idea
22:43:36 <elliott> I don't think you're meant to google
22:43:38 <Sgeo> But still, I really, really don't want to open a text editor, type some code, etc.
22:43:42 <Vorpal> elliott, okay that is true
22:43:56 <Sgeo> She only taught us the existence of XOR swapping, not how to do it
22:44:03 <Sgeo> Although now that I saw it, it seems obvious
22:44:15 <oerjan> what is the sound of one XOR swapping
22:44:15 <Sgeo> The assignment is to do XOR swapping
22:44:26 <elliott> Sgeo: Any specification on what to do if x==y? ;)
22:44:34 <elliott> Also, congrats for not being able to figure out xor swapping yourself X_X
22:45:32 -!- poiuy_qwert has joined.
22:45:36 <elliott> Vorpal: Quick! What do you do if a header mentions mode_t, but not every including source file will have included a header that defines mode_t?
22:45:50 -!- p_q has quit (Read error: Connection reset by peer).
22:46:04 <Vorpal> elliott, include the relevant header in the header using it
22:46:16 <Vorpal> elliott, that should always be done
22:46:21 <elliott> Vorpal: BZZT! You never include headers from inside headers.
22:46:36 <Vorpal> elliott, so stddef.h might not be included if you need NULL?
22:46:37 <elliott> Including headers inside headers is the sole reason include guards exist.
22:46:40 <elliott> And include guards are evil.
22:46:42 <Vorpal> they why does stdio do it
22:46:45 -!- poiuy_qwert has quit (Client Quit).
22:46:53 <elliott> Vorpal: "Gee, how can this be bad? Modern Unix does it!"
22:47:14 <Vorpal> elliott, guards are good because the alternative: having to figure out what headers you need, is worse. Especially if that header is updated and now needs more stuff
22:47:23 <Vorpal> then everything you wrote is broken
22:47:26 <elliott> Vorpal: The correct thing (as done in Plan 9, which just so happens to have the inventors of C on board) is to make people including the header also include its dependencies.
22:47:27 <Vorpal> elliott, sure guards are suboptimal
22:47:38 <Vorpal> elliott, and what if you want to add more
22:47:51 <Vorpal> elliott, actually you should just do #use module stdio
22:47:55 <elliott> Vorpal: Then you break compatibility, duh. Adding dependencies always breaks compatibility.
22:48:20 <elliott> Anyway it's not so clear in my case because not every program wants to include <sys/stat.h>.
22:48:41 <Vorpal> elliott, not necessarily for headers. And just recompiling it is better than having to change code and then recompile it
22:49:03 <Vorpal> elliott, you could always split it in 10 different header files
22:49:09 <zzo38> Why don't you do it in the way that Enhanced CWEB does it? It does differently including header file and other things.
22:49:11 <Vorpal> like: "foo_that_needs_sys_stat.h
22:49:17 <elliott> Vorpal: Did I mention that Plan 9 source code compiles much faster, not just because of the better-designed C compiler, but because there are no include guards?
22:49:42 <Vorpal> elliott, I'm not sure I see that benefit as that much more important
22:49:44 <zzo38> And in Enhanced CWEB, you can use change files to make system dependent changes.
22:49:51 <Vorpal> elliott, also include guards is a tiny bit of it
22:50:04 <Vorpal> elliott, seriously check the clang stats on what is cpp and what is cc
22:50:05 <elliott> Vorpal: Actually, no, it was a significant amount of time.
22:50:16 <Vorpal> elliott, then your cpp is weird
22:50:16 <elliott> Vorpal: OK, so clang have a super-optimised cpp :P
22:50:30 <elliott> Vorpal: Can the inventors of C really be said to implement C in a weird way?
22:50:36 <Vorpal> elliott, point is, with C you should use include guards. A module system would be better
22:50:49 <Vorpal> elliott, yes. No one is perfect.
22:50:54 <elliott> You are wrong. Enjoy being wrong!
22:50:59 <zzo38> It is possible to do the C preprocessor and C compiler all together in one pass.
22:51:15 <elliott> Ugh, busybox just includes every header ever in libbb.h.
22:51:17 <Vorpal> elliott, but then why did you ask me
22:51:25 <elliott> Vorpal: Perverse curiosity?
22:51:51 <Vorpal> elliott, include guards are suboptimal. But yes I suggest they should be used. Actually I will force you to use #pragma once
22:52:10 <zzo38> Vorpal: In Enhanced CWEB, you should use a metamacro or PicoC code to tell it not to require adding include guards.
22:52:17 <Sgeo> elliott, XOR swapping seems to work just fine when the values are the asme
22:52:39 <Vorpal> zzo38, I do. not. care. about enhanced cweb
22:52:42 <elliott> Sgeo: By the same I mean X has-same-storage-location-as Y.
22:53:07 <Vorpal> also why xor swap. That is kind of pointless on modern systems.
22:53:17 <zzo38> Vorpal: Why? Surely it will do these things you are trying to do.
22:53:24 <Vorpal> a more traditional swap will probably be compiled into xchg
22:53:42 <Vorpal> zzo38, it is not a plain C compiler. Also it is C.
22:54:13 <elliott> Vorpal: Some day I will pull out everything you have ever said about Linux being awesome and C being awesome and garbage collectors being for people who can't manage their own memory from the logs.
22:54:16 <elliott> And I will paste them all.
22:54:27 <Vorpal> elliott, there is this thing called "change opinion over time"
22:54:34 <Vorpal> elliott, you surely done that yourself
22:54:37 <elliott> Hmm, maybe one day I'll talk only in old AnMaster log quotes and see if I can get Vorpal arguing with his past self >:)
22:54:42 <elliott> Vorpal: NO MY OPINIONS ARE IMMUTABLE BECAUSE I AM HASKELL
22:54:45 <zzo38> Vorpal: Enhanced CWEB is not a C compiler at all, actually. You still need a C compiler. And it can work with C++ as well, in case you prefer to use C++.
22:54:57 <Vorpal> elliott, I'm the State monad :P
22:55:11 <elliott> I have no gonads. I mean monads.
22:55:16 <Vorpal> elliott, or why not STT
22:55:23 <elliott> Vorpal: No no no no no no.
22:55:25 <Sgeo> Am I an opinion slut?
22:55:28 <elliott> Vorpal: There is a very good reason that does not exist :P
22:55:33 <elliott> Vorpal: Specifically, time travel.
22:55:42 <Vorpal> elliott, we invented a time machine!
22:56:06 <Vorpal> elliott, hm is there a StateT?
22:56:14 * Sgeo decides he'd rather do the assignment right before class begins
22:56:24 <Vorpal> <Sgeo> Am I an opinion slut?
22:56:37 <elliott> do c <- savePoint; takeOverGovernmentComputers; readLine; restorePoint c
22:56:39 <Vorpal> elliott, I think Sgeo got self-uh... self-something
22:56:45 <elliott> SWAT team outside your door?
22:57:13 <oerjan> Yes Vorpal, there is a StateT
22:57:21 <Vorpal> oerjan, right, that works of course
22:57:56 <Vorpal> elliott, hm? doesn't it? I though StateT would not involve time travel
22:59:02 <Vorpal> elliott, you confuse me
22:59:18 <Vorpal> elliott, it does exist. Just because it can exist doesn't mean someone coded it.
22:59:18 <elliott> oerjan: the man confuses himself
22:59:32 <elliott> Vorpal: whoooooooooooooooooooooooooooooooooooooooosh
22:59:49 <Vorpal> elliott, you make no sense
23:00:15 <oerjan> elliott: He has been affected by the skepticism of a skeptical age.
23:00:55 <Vorpal> it is midnight. I will have to wake up in 6 hours.
23:01:01 <elliott> Vorpal: you are a mere insect, an ant, in his intellect.
23:02:23 <Ilari> Looking at amount of of allocations at or above /14 from APNIC in last 30 days: 4x/14s, 2x/13s, 3x/12s and 1x/11...
23:03:31 <Ilari> That's equivalent to 7Mi addresses (~44% of block).
23:04:32 -!- Sasha2 has joined.
23:05:18 <oerjan> Ilari: i saw something on reddit about ICANN projecting to run out in january
23:05:43 <Ilari> If they burn half of a block per month and they have 3.52 blocks unallocated, the present allocation would suffice only for 7 months, which would allow immediate allocation.
23:05:47 -!- Sasha has quit (Read error: Connection reset by peer).
23:06:03 <Sgeo> oerjan, linky?
23:06:19 <Ilari> Oh, and I saw some RIPE executive predicting exhaustion this month.
23:06:35 <oerjan> Sgeo: it was actually a horribly translated blogspam link, i'd try to find something better
23:07:44 <Ilari> Even at 0.44 blocks / month, it would be 8 months (immediate request would be within policy).
23:10:47 <Ilari> Some say that regardless that APNIC could request blocks (triggering X day) immediately, they won't do it before year is over.
23:29:01 -!- zzo38 has quit (Remote host closed the connection).
23:36:46 -!- TLUL has changed nick to TLUL|afk.
23:37:31 <mycroftiv> every computer is a theorem proving machine and every program output is a proved theorem; do godel's theorems place any practical limits on the functionality application writers can deliver?
23:37:54 <mycroftiv> (outside of the specific domain of mathematicians who want computers to prove their theorems for them, of course)
23:39:40 <mycroftiv> speculation triggered by this: http://richardelwes.co.uk/2010/10/21/concrete-incompleteness-1/
23:40:34 <oerjan> you might want to look at the halting problem, which is very similar to godel's theorem but more directly for computation.
23:40:51 <mycroftiv> of course im aware of the halting problem :|
23:41:34 <oerjan> they're both diagonalization proofs. you can probably also prove each in terms of the other.
23:42:21 <elliott> are you talking because we mentioned you
23:42:43 <mycroftiv> sure, nowadays godel's proofs are often presented mostly in programming terms because they can be stated more easily and intuitively that way
23:42:54 <mycroftiv> theres actually been a long standing conflict on wikipedia over that issue
23:44:05 <mycroftiv> elliott: the fact that my nick was used in this channel reminded me that I ought to be participating because this channel is pretty great
23:44:19 <elliott> mycroftiv: it is the best of channels. also the blurst
23:44:32 <elliott> mycroftiv: in case you are blind to the exceedingly obvious i'm ehird
23:44:41 <oerjan> mycroftiv: well in any case there are lots of undecidable programming problems which reduce to the halting problem
23:44:44 <elliott> and i'm very disappointed that my box has reached 30K
23:44:56 <mycroftiv> elliott: i actually figured that out 'awhile ago' when just passively reading the log
23:46:03 <elliott> mycroftiv: so with my troll hat firmly on, how big is plan 9's dirname executable, on x86-64? (i forget, they have x86-64 support, right? :P)
23:46:39 <mycroftiv> oerjan: the thing that has me interested in this is the claim that incompleteness-related issues are becoming more relevant to 'practical questions', loosely defined
23:46:57 <mycroftiv> elliott: the amd64 port i believe is still unreleased, much to many people's irritation
23:47:51 <oerjan> mycroftiv: as for practical questions you'd also want to look at complexity. there are many problems which are "decidable" yet infeasible to solve in practice
23:48:06 <elliott> mycroftiv: 'cuz you see i'm on linux... and my dirname is 1831 bytes
23:48:18 <elliott> what about false and true, i bet they're more than... say... 248 bytes even on i386 right?
23:48:24 <elliott> i may have gone slightly crazy space-optimising these utilities
23:48:58 <mycroftiv> elliott: well plan 9 executables arent usually very small because everything is statically linked, not dynamically
23:49:27 <oerjan> and EXPTIME and other higher that are _known_ to be infeasible, not just conjectured to be so
23:52:15 <oerjan> *higher complexity classes
23:53:24 <mycroftiv> elliott: well the plan 9 basename is 37919 but that is pretty close to the minimal size for a plan 9 binary built with just the libc