00:00:04 Aside from the absurd error checking... 00:00:15 (mmm, correctness) 00:00:45 I feel weird. I found a practical use for BF 00:00:55 coppro, oh what is it? 00:01:15 "I want to learn C#" "Go to this site, it's how I learned" "But you already had some programming experience" 00:01:15 I just suggested Python or C 00:01:22 -!- aliseiphone has quit (Remote host closed the connection). 00:01:32 For "encrypting" a file - not to actually protect the data, but just discourage casual observers. Run the following program, which interestingly enough has each symbol exactly once: +[>,-.<] 00:01:48 run it again with s/-/+/ to un"encrypt" it 00:02:19 and the BF program is shorter than the equivalent in nearly every other language 00:02:30 -!- aliseiphone has joined. 00:02:32 The current code is short but doesn't clearly express the fundamental idea "compute a CRC32 checksum". Remember, commands are the functions of the Unix OS. 00:02:35 actually, waitaminute 00:02:37 that won't work 00:02:47 pikhq: did you get "Look at your..."? 00:02:49 I forgot how BF behaves when it runs out of input 00:02:59 +[,-.+] will do it 00:03:05 coppro: sets cell to 0 mostly 00:03:14 sometimes unchangef 00:03:15 hmm... off-by-one error 00:03:20 *unchangef 00:03:24 *unchanged 00:03:34 ,[-.,] 00:03:38 aliseiphone: No. 00:03:38 which my phone autocorrects to unchangef 00:03:46 pikhq: Yes. 00:03:51 aliseiphone: what a fantastic phone i must buy one now 00:03:52 pikhq: Oh, I see. 00:03:58 "Look at your..." ? 00:04:34 pikhq: Look at your original code. That expressed your intent incredibly clearly. Strip useless options. Get rid of the, yes, absurd error checking. 00:04:37 The current code is short but doesn't clearly express the fundamental idea "compute a CRC32 checksum". Remember, commands are the functions of the Unix OS. 00:04:38 Y 00:04:52 *That's what I said. 00:05:10 aliseiphone: Okay, so screw the error checking that I added on a bizarre whim. 00:05:29 aliseiphone tends to be anti-feature though (j/k) 00:05:37 I think I can keep the fopen error checking. 00:05:38 And functions shouldn't have unneccessary cruft. When writing functions, how many flags do they have? 00:05:43 Otherwise? Pffft. 00:05:46 Usually, very few. 00:06:07 You nest (pipe) functions (commands) instead. 00:06:20 aliseiphone: POSIX requires the argument. 00:06:28 So, do try and remove all flags that significantly complicate your code. 00:06:44 pikhq: POSIX compliance is an amusing fiction. 00:06:55 And almost all UNIXes implement that. 00:06:58 Nothing actually *uses* cksum(1). 00:07:01 Even Heirloom. 00:07:09 pikhq: Fine, fine. 00:07:28 Separate the code common to the arguments. Say into a function. 00:07:36 * pikhq does so 00:07:56 "if(flag)" in actually-computing code is lame. :P 00:08:17 pikhq: Look at your original code. That expressed your intent incredibly clearly. Strip useless options. Get rid of the, yes, absurd error checking. 00:08:18 so 00:08:36 correctness is less important than simplicity? 00:08:40 aliseiphone, yes or no? 00:08:55 pikhq: Also, I do wonder if the octets blab might better belong in the BUGS section of cksum.1. 00:09:00 aliseiphone, yes or no? 00:09:02 AnMaster: For Unix? Yes. 00:09:13 aliseiphone, no 00:09:14 IMO 00:09:19 aliseiphone: It probably does. 00:09:34 AnMaster: Go fuck Multics. 00:09:42 aliseiphone, lovely system 00:09:51 AnMaster: Point made. 00:10:08 It didn't work properly, was one minor flaw. 00:10:45 I like the idea of a truly correct C program. Ha! 00:10:45 aliseiphone, which one? 00:11:01 aliseiphone, that would be awesome. But I suggest using haskell or such for that 00:11:23 pikhq: Also, I suggest removing the libc dependency and rewriting it in PDP-11 assembly. 00:11:36 AnMaster: a truly correct haskell program??? 00:11:39 Hahaha 00:11:46 aliseiphone: :P 00:11:53 Clearly you know nothing of haskell :) 00:12:10 Also, this is coming out much more nicely. 00:12:18 Thanks for the sanity check, aliseiphone. 00:12:41 pikhq: Just call me "Ultimate Genius, Lord Over Everything". 00:12:46 That's all I ask for. 00:13:17 http://sprunge.us/ZWTV 00:13:24 Mmm. 00:14:11 Doesn't compile though XD 00:14:30 s/else {/} else {/ 00:14:42 s/name/argv[1]/ 00:15:06 aliseiphone, yes, hello world in haskell, ought to be truly correct quite easily 00:15:18 if you meant non-trivial then say so 00:16:07 pikhq: Additional, nitpicking suggestions: Put the CRC function first; the UI is cruft, not the important bit; try and reduce the nesting of the UI logic; and use "!strcmp" rather than "strcmp(...) == 0". But these are minutiae; the code is great. 00:16:21 *argh* 00:16:26 MORE BUGS 00:16:37 aliseiphone: Other than the bugs 00:16:38 :P 00:16:44 AnMaster: Have you ever considered being less of a pedant in informal conversation? It's a nice social lubricant. 00:16:56 pikhq: As long as it *looks* elegant! 00:17:01 aliseiphone: Hah. 00:18:33 One day I must figure out how to write a truly elegant ls(1). It has so many interacting flags, but separating these into programs seems near-impossible! 00:18:57 aliseiphone, you are officially being an idiot or a troll now 00:19:00 which one I wonder 00:19:59 -!- tombom_ has quit (Quit: Leaving). 00:20:44 AnMaster: Oh? And which line made you decide this? 00:20:51 One day I must figure out how to write a truly elegant ls(1). It has so many interacting flags, but separating these into programs seems near-impossible! 00:20:56 aliseiphone, that one :P 00:21:29 aliseiphone, and ls without colour I won't use. I find the coloured output very very useful 00:21:32 just FYI 00:21:59 aliseiphone: Oh, how I wish that I could return a tuple in C. 00:22:00 You are free to note that I can write ls(1) perfectly well, that a version with limited flags is very easy to make truly elegant, and that I have a very stringent definition of "trule elegant". 00:22:16 trule :) 00:22:34 pikhq, return struct on stack 00:22:38 Sorry, return one *and pattern match*. 00:22:43 ah 00:22:50 Furthermore, I don't, never have, and never will give a damn about whether you will use my coreutils or not. Especially as I know you won't from the get-go. 00:22:51 try haskell or erlang 00:23:05 patterns are no match for C 00:23:11 oerjan, -_- 00:23:17 http://sprunge.us/ZVMh 00:23:18 Bam. 00:23:18 that was truly awful 00:23:37 gotta keep you on your toes 00:23:38 pikhq, that's the original one aliseiphone hated? 00:23:52 pikhq: Thats the old one :P 00:23:53 AnMaster: ... ? 00:23:57 *That's 00:23:58 aliseiphone: OH 00:24:06 XD 00:24:16 Lemme get the right thing in the pastebuffer. 00:24:17 AnMaster speaks in a foreign language :P 00:24:20 http://sprunge.us/GGWP 00:24:33 aliseiphone: inte omöjligt 00:24:49 oerjan, instämmer med föregående Norske talare 00:24:51 i'm in a pub :F 00:24:56 pikhq: You have crc's prototype right before its definition. 00:25:02 yeargh 00:25:06 This is... interestingly superfluous. 00:25:08 aliseiphone: ... Yearghright. 00:25:19 oerjan: my bro is in norway and he's a f*#* genius if it comes to natural langs 00:25:24 Kill that line. 00:25:35 * oerjan aims and shoots 00:25:41 pikhq, and put static on the next one 00:25:42 pikhq: it's dead 00:26:21 I need an ipad and 00:26:33 a keyboard here 00:26:33 eww ipad 00:26:37 he spent 3 weeks there and he actually speaks simple norwegian 00:26:40 and a compiler 00:26:50 AnMaster: try hiding a laptop 00:27:00 aliseiphone, an ipad would be equally hard 00:27:06 aliseiphone, also put a compiler on n900 00:27:09 consider it done 00:27:10 wrong 00:27:34 knock on door, press button on ipad, rest on floor, hidden 00:27:36 aliseiphone, _proper_ smartphones can run compilers 00:27:41 laptop... Not so quick. 00:27:42 Bartosz Michał Gasperowicz FFFFFFFFFFFFAAAAAAAAAAAAAAAAAAAAAAEEEEEEEEEEEEEEEEEENNNNNNNNNNNNNNNNNNN!! Lurt igjen! :D 00:27:50 AnMaster: so can the iphone 00:28:00 aliseiphone, so do that then? 00:28:19 oerjan: what does this mean? 00:28:20 AnMaster: Keyboard. Screen real estate. Processing power. 00:28:39 500mhz arm + small screen + touchscreen keyboard = no 00:28:48 thus the ipad wish 00:28:55 nooga: Bartosz Micha? Gasperowicz DAAAAAAAAAAAAAAAAAAAAAAAAAMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNNNNNNNNNN!! Fooled again! :D 00:29:13 -!- poiuy_qwert has joined. 00:29:23 because he works for a guy that can't express feelings, he just passes information 00:29:30 oerjan: l- not ? 00:29:39 and says somethin and then does something different 00:29:41 polish l :P 00:29:42 aliseiphone: what? 00:29:47 he's in a village 'near' Floro 00:29:57 oerjan: Nooga said 00:30:12 "Micha[l-]" 00:30:19 Not "Micha?". 00:30:21 there was unicode? oh well. 00:30:24 it's not Polish l 00:30:33 its* 00:30:36 So is. 00:30:37 its ł 00:30:49 shiiiit no 00:30:51 Polish l. 00:30:51 it's* 00:31:01 l != ł 00:31:05 nooga, oerjan fail at unicode 00:31:13 Polish fuck you! 02:41:30 -!- clog has joined. 02:41:30 -!- clog has joined. 03:06:53 -!- Gregor has quit (Quit: Leaving). 03:14:08 wait 03:14:13 how long has clog been missing 03:14:33 argh several hours 03:16:59 -!- coppro has quit (Remote host closed the connection). 03:17:45 -!- coppro has joined. 04:16:16 -!- Oranjer has left (?). 04:30:09 -!- Mathnerd314 has quit (Ping timeout: 240 seconds). 04:34:00 * pikhq would like to demonstrate how you do a Makefile, for everyone that makes it too complex. 04:34:02 http://sprunge.us/IEXi 04:44:49 http://failblog.org/2010/07/05/epic-fail-photos-makeup-fail/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+failblog+(The+FAIL+Blog+-+Fail+Pictures+%26+Videos+at+Failblog.ORG)&utm_content=FaceBook 04:59:24 * pikhq is a-doing a coreutils 04:59:25 FTW 05:08:56 http://sprunge.us/IEXi <-- I would add the .PHONY line, but otherwise I agree 05:09:53 pikhq, also I would, if I had more programs, add PROGRAMS = foo bar quux 05:09:59 then all: $(PROGRAMS) 05:10:03 clean: 05:10:03 AnMaster: Yeah. 05:10:11 rm -f $(PROGRAMS) *.o 05:10:24 that way there is less duplication 05:10:35 pikhq, but yes I agree with the general idea 05:11:24 -!- DavidCaruso has joined. 05:11:54 pikhq, also how would you make one target link -lm there 05:12:00 pikhq, I never figured out a clean way 05:12:06 that is, with just implicit targets 05:18:56 AnMaster: Uh, GNU make only, but there's a way to do per-target variables. 05:19:30 target: LDFLAGS += -lm 05:21:35 pikhq, ah, well that puts it BEFORE the files iirc 05:21:45 which break with -Wl,--as-needed 05:21:48 in the environment 05:22:01 pikhq, which might be an issue 05:23:13 AnMaster: Argh. 05:23:21 LDLIBS is what you want. 05:23:23 pikhq, ? 05:23:25 That goes after. 05:23:30 LDLIBS? or LIBS? 05:23:36 LDLIBS. 05:25:29 -!- CakeProphet has joined. 05:25:33 :o 05:25:39 -!- DavidCaruso has quit (Quit: Page closed). 05:25:40 hey folks. 05:26:01 http://sprunge.us/BgXe It's 100% POSIX compliant cat! 05:26:17 (thank God they removed all the other options!) 05:27:50 pikhq, fread! 05:27:55 It worries me greatly that most implementations of cat are actually complex. 05:27:58 AnMaster: NO 05:28:04 pikhq, ought to be faster 05:28:12 AnMaster: It's fucking CAT 05:28:46 pikhq, yes I want to concatenate a dual-side dual-layer dvd image split on 1.44 MB floppies! ;P 05:28:50 that needs a fast cat 05:29:09 ... "1.44 MB floppies". 05:29:22 No, that needs a cat that operates faster than the floppy drive. 05:29:23 pikhq, yes? 05:29:34 I can guarantee that this is orders of magnitude faster. 05:29:42 pikhq, ah but already copied the floppies to disk with dd 05:30:03 Still fast enough. 05:30:08 pikhq, that is to a RAM disk 05:30:11 * Sgeo learns a lesson 05:30:15 Shaddup. 05:30:18 NEVER code just for the happy case 05:30:28 Sgeo: oh of course. 05:30:30 Even if, in production, the happy case will always be true 05:30:47 Because in development, it isn't necessarily the case 05:31:24 Sgeo: well, it's a balancing act. It is helpful to consider worse-case scenarios in an algirthm, but if you do it too much you waste a lot of time with boilerplate code. Sometimes you should just let it crash. 05:32:56 * pikhq tries to find a list of utils that POSIX requires 05:33:09 pikhq, it is in the POSIX standard 05:33:16 pikhq, which is free 05:33:16 Yeah, found it 05:33:32 I still haven't seen error-handling in Haskell in action. 05:36:01 AnMaster: It doesn't have a single handy list, but it's possible to see if something's required. Which works for me. 05:36:25 pikhq, it has a list on the side in the pdf bookmarks 05:36:39 Mmm. 05:37:42 Gash darnit, awk is mandatory. 05:38:55 * pikhq says no 05:39:06 I don't care what it says, that's seperate from coreutils. 05:40:42 pikhq, sed it mandatory too 05:41:20 pikhq, as is sh and vi 05:42:02 cya 05:42:11 LALALACANTHEARYOU 05:42:35 pikhq, hey you are not ehird :P 05:42:37 stop doing that 05:43:44 :P 05:43:54 pikhq, iirc getline() is in POSIX 2008 and suc 05:43:56 such* 05:44:08 the glibc people managed to get a few things in 05:44:20 things that are actually quite useful in general 05:44:24 a few useless ones too iirc 05:44:36 bbl 06:06:58 so... 06:07:30 I have this piss cheap vodka that I do not want to finish off straight. But I don't want to throw it into a shitty mixed drink either if it isn't going to waste good 06:07:36 How does coke and vodka sound? 06:11:59 you know what 06:12:01 I don't even care 06:12:04 coke and vodka it is. 06:20:47 ...okay 06:20:52 so for future reference 06:20:55 coke, vodka, chocolate syrup 06:34:05 -!- coppro has quit (Remote host closed the connection). 06:35:31 -!- coppro has joined. 06:38:32 /bin/cat is 52k. That frightens me. 06:39:24 I think you can do it in like 50 bytes 06:40:05 Yeah. 06:40:27 Mine's 8k with dietlibc, but then, that does include a full stdio implementation. 06:40:48 asmutils' is 684 bytes. 06:41:21 -!- Gregor has joined. 06:41:50 Tomorrow: bc! 06:45:58 coppro: The ELF header is longer than 50 bytes :-P 06:46:16 Deewiant: oh, well 06:46:19 It was something really silly 06:46:22 definitely under 1kB 06:46:31 (it wasn't compliant though; just straight no-option cat 06:46:56 Something like 250-300 bytes is probably doable 06:47:01 coppro: asmutils' is *GNU* compliants. 06:47:06 Erm. 06:47:08 nice 06:47:08 Compliant. 06:50:00 pikhq: MICROCOSM 06:50:24 Gregor: ADD 06:50:27 :P 06:50:37 pikhq: SUBTRACT 07:28:15 !haskell sequence $ [[1,2,3],[4,5,6],[7,8,9]] 07:28:19 [[1,4,7],[1,4,8],[1,4,9],[1,5,7],[1,5,8],[1,5,9],[1,6,7],[1,6,8],[1,6,9],[2,4,7],[2,4,8],[2,4,9],[2,5,7],[2,5,8],[2,5,9],[2,6,7],[2,6,8],[2,6,9],[3,4,7],[3,4,8],[3,4,9],[3,5,7],[3,5,8],[3,5,9],[3,6,7],[3,6,8],[3,6,9]] 07:28:36 so... superset? 07:28:48 what operation am I looking at. 07:29:33 !haskell sequence $ [[1,2,3],[4,5,6],[7,8,9,10]] 07:29:35 [[1,4,7],[1,4,8],[1,4,9],[1,4,10],[1,5,7],[1,5,8],[1,5,9],[1,5,10],[1,6,7],[1,6,8],[1,6,9],[1,6,10],[2,4,7],[2,4,8],[2,4,9],[2,4,10],[2,5,7],[2,5,8],[2,5,9],[2,5,10],[2,6,7],[2,6,8],[2,6,9],[2,6,10],[3,4,7],[3,4,8],[3,4,9],[3,4,10],[3,5,7],[3,5,8],[3,5,9],[3,5,10],[3,6,7],[3,6,8],[3,6,9],[3,6,10]] 07:29:41 oh my 07:30:07 so the size of each sub-list is the minimum size of the input sub-lists 07:33:28 for some reason it reminds me of powerset, but it's not the same. 07:34:16 oh, and there's one size-4 list.... so now I have no fucking clue what sequence does on [[a]] 07:34:36 other than a bunch of permutation-like lists 07:39:33 !haskell sequence $ [[1],[2]] 07:39:34 [[1,2]] 07:39:44 !haskell sequence $ [[1,2],[3,4]] 07:39:45 [[1,3],[1,4],[2,3],[2,4]] 07:40:08 ...oooooh 07:40:18 !haskell sequence $ [[1,2,3],[4,5,6]] 07:40:20 [[1,4],[1,5],[1,6],[2,4],[2,5],[2,6],[3,4],[3,5],[3,6]] 07:40:28 Deewiant: Speaking of small executables, I have a 253-byte stub (inc. ELF headers + code) for x86-32 which does (with direct syscalls) fork+exec /bin/bzcat, feeds it a blob, reads it to rwx segment and jumps into it. 07:41:42 Deewiant: (I use it for compressed executables, since UPX's compression ratio isn't so awesome and its decompression stub is larger; while the "traditional" trick of making a shellscript that decompresses into /tmp/x and runs it is so ugly.) 07:43:14 Deewiant: (Anyhow, I'm sure you can get a "doesn't look at argv, just read+write loop" cat into the 100-150 byte range. My headers are 72 bytes, and you can stick 9 bytes of code into the padding in the middle anyway.) 07:45:46 so basically 07:46:05 sequence is non-deterministic for [[a]] 07:46:24 uh, what? 07:46:30 every Haskell function is deterministic 07:47:13 each sublist in the output becomes a non-deterministic value of a new non-deterministic sequence... represented determinnistically as a [[a]] 07:47:22 coppro: simulated, of course. I use non-deterministic loosely. 07:47:38 s/output/input 07:47:47 how is this non-deterministic at all? 07:47:56 okay... here's what I'm saying 07:48:26 let's say the input to the sequencefunction is a sequence x(n) 07:48:31 and the output is y(n) 07:49:01 y(n) = [x(1), x(2), x(3), x(4) ...] 07:49:37 !haskell sequence $ [[1,2],[3,4],[5,6]] 07:49:39 [[1,3,5],[1,3,6],[1,4,5],[1,4,6],[2,3,5],[2,3,6],[2,4,5],[2,4,6]] 07:50:04 should start at zero, acutally. So that's 07:50:14 [x(0), x(1), x(2)] 07:51:22 x(0) = 1 or 2; x(1) = 3 or 4; x(2) = 5 or 6 07:52:24 it's a simulation of a non-determinstic sequence that constructs every possible deterministic sequence that it represents. 07:52:35 I don't think I'm making any sense. 07:55:44 !haskell do {nd_list <- sequence [[1,2,3],[4,5,6]]; nd_list} 07:55:46 [1,4,1,5,1,6,2,4,2,5,2,6,3,4,3,5,3,6] 07:55:59 that flattens it. 07:56:18 join $ sequence [[1,2,3],[4,5,6]] 07:56:26 !haskell join $ sequence [[1,2,3],[4,5,6]] 07:56:33 !haskell :t join 07:56:41 ... :o 07:56:47 it broke. 07:57:04 !haskell :t join 07:57:15 [00:52:11]I don't think I'm making any sense. <-- this 07:57:25 ha. 07:57:50 it's basically how the monadic operations of [] a represent non-determinism 07:58:09 sequence takes one representation and flips it around in a way. 07:59:47 so instead of having a list where each sub-list is a non-deterministic value 07:59:59 -!- clog has quit (ended). 08:00:00 -!- clog has joined. 08:00:17 you now have a list where each sub-list is a possible determinized list. 08:00:49 of the original non-deterministic sequence 08:00:58 ... 08:01:05 fucking English 08:01:22 natural language makes technical things hard to explain. 08:01:31 fizzie: I was thinking of "completely ordinary" executables, not using parts of the ELF header for code. :-) 08:01:46 But everyone's doing that! 08:01:46 fizzie: But I did misremember that the headers were around 120 bytes or so. 08:04:32 !haskell do {x <- [1..9]; return $ [x, x+1, x+2]} 08:04:33 [[1,2,3],[2,3,4],[3,4,5],[4,5,6],[5,6,7],[6,7,8],[7,8,9],[8,9,10],[9,10,11]] 08:05:01 Deewiant: They're about that size if you have more than one segment, which you will in a "completely ordinary" executable (one read-write for data, one read-executable for code). 08:05:15 !haskell do {x <- [1..9]; [x, x+1, x+2]} 08:05:16 [1,2,3,2,3,4,3,4,5,4,5,6,5,6,7,6,7,8,7,8,9,8,9,10,9,10,11] 08:05:35 Deewiant: (Also mine would be 80 bytes already, I just interlaced the last 8 bytes of the file header with the first 8 of the segment header.) 08:05:35 Well, you probably don't need a non-code segment for cat 08:05:38 hmmmm.... 08:05:44 just got an idea 08:06:02 if you newtype'd list 08:06:15 you could implement a monad for digital signal processing that makes things like delay-lines easy to do. 08:06:40 hmmm, well not newtype actually 08:07:07 Deewiant: Well: 08:07:08 htkallas@pc112:/users/htkallas/tmp$ nasm -Ox -o cat -f bin cat.asm ; chmod u+x cat 08:07:08 htkallas@pc112:/users/htkallas/tmp$ echo 'foo, bar, baz' | ./cat 08:07:08 foo, bar, baz 08:07:08 htkallas@pc112:/users/htkallas/tmp$ ls -l cat 08:07:08 -rwxrw-r-- 1 htkallas htkallas 110 2010-07-06 10:06 cat* 08:07:49 do { (dval, x) <- signalWithDelay 3 [1..]; return $ dval+x} 08:08:14 fizzie: Doesn't take arguments, I take it :-) 08:08:16 psh, wtf am I saying. You don't even need to define a new type. 08:08:37 Deewiant: Right. Haven't tested it much either, might have bugs. Might also be a bit overly pessimistic as to whether a syscall's argument registers stay intact; I think they might, which would save some bytes. 08:08:43 I was thinking POSIX-compatible 08:08:47 signalWithDelay :: [a] -> [(Maybe a,a)] 08:08:52 signalWithDelay :: Int -> [a] -> [(Maybe a,a)] 08:09:14 fizzie: I don't think that's guaranteed anywhere, but I'm not sure. 08:09:43 signalWithDelay :: Int -> Int -> [a] -> [([Maybe a],a)] 08:10:04 Deewiant: Somebody claimed it was, and the syscall handling seemed to suggest they were, but I didn't see it exactly spelled out in the docs anywhere. The syscall number is lost, at least, since that's the return value register. 08:10:08 first int is distance back, second int is size of the delay line. 08:11:45 Some architectures clobber the syscall argument registers, according to some glibc bug report I found when googling for whether x86-32 does. 08:12:21 delayedSignalWithDefault :: Int -> Int -> Int -> [([a],a)] 08:12:29 to get rid of the Maybe. 08:12:55 delayedSignalWithDefault :: a -> Int -> Int -> [([a],a)] 08:12:56 actually 08:17:06 hmmm 08:17:57 do you think there would be any real harm in making tuple types a superset of all algebraic data types with a single constructor that fits the tuple? 08:18:29 data List = Cons a [a] | Empty 08:19:04 list = Cons 0 $ Cons 1 $ Cons 2 $ Cons 3 08:19:22 (x, xs) = list 08:19:44 congratulations, you just described Haskell lists 08:19:54 well, what I'm saying 08:20:08 is there any reason to make tuples distinct from named algebraic constructors. 08:20:20 yes 08:20:37 why couldn't tuples simply represent /any/ constructor for pattern matching? 08:20:50 any constructor that matches, that is. 08:20:58 Deewiant: 101 bytes if I assume the regs are saved, and it seems to work. 08:21:05 so for example 08:21:27 fizzie: Of course it may work, but that doesn't mean it's ABI-guaranteed :-) 08:21:35 a value of type (a, [a]) would contain the set of [a] values constructed via (:) 08:22:06 Deewiant: There were some .pdf slidesets that seemed to suggest it was. :p 08:22:33 but a value of type (a, [a]) would not include values of type [a] constructed from [] 08:22:40 because it does not match. 08:23:23 [a] values constructed from [] could be type () 08:24:10 Deewiant: http://sprunge.us/LhDM if you want to see them codes. 08:24:36 so... 08:25:02 instead of writing functions that operate on specific named types of specific typeclasses 08:25:24 you could instead write functions that operate on any algebraic data structure constructed with a certain signature 08:25:47 *named types /or/ specific typeclasses 08:27:26 it would almost be a sort of weak typing 08:27:38 fizzie: I note no error checking 08:27:48 fizzie: Where's your buffer size? 08:28:11 under that typing system, (1,(2,(3,()))) would be equivalent to [1,2,3] as well as any other algebraic value constructed the same way. 08:28:39 Deewiant: It's the same as the buffer's address. You know, to save bytes. 08:28:50 Deewiant: (That's why I loaded the program to a reasonably low address.) 08:28:54 >_< 08:29:07 fizzie: ha. 08:29:20 And there *is* error checking of sorts; if the read fails, it'll exit. 08:29:28 If the write fails, though, then it won't bother. 08:29:28 imagine if the address was 1 billion base 10. :) 08:29:51 But with the correct error code? 08:30:13 Well, no, of course not. That would mean I'd have to distinguish between errors and end-of-file. 08:30:34 Exactly :-) 08:30:48 Your cat is but a poor approximation of a cat 08:31:09 Deewiant: You can possibly add a "sets bl" into some proper spot to get return code 0 of the program when it hits EOF, and 1 when an error occurs. 08:31:32 The worst part of the cat is that it won't read files specified as arguments, admittedly. 08:32:29 Also, write may write less than it's given; you need to loop it until it's done 08:32:38 "Nah." 08:33:01 I'll stick to GNU cat; it may be bloated but at least it works! 08:33:25 [] :: (), EOF :: (), () :: () 08:34:10 [] :: [a], EOF :: ExampleStreamType a, () :: () 08:34:47 Deewiant: The decompression stub I have now writes the whole compressed code into a FIFO before starting to read from bzcat; it works because Linux's pipe buffers are 64k nowadays. I used to have three processes (one child to exec bzcat, one child to loop-write bytes into its stdin, the parent to read until EOF and then run the code) but that took far too many bytes; to get it under 256 bytes I had to cut some corners. 08:35:36 Hackety-hack 08:36:12 Another "nice" trick: I put bzcat's argv list at the very end of the program, because that way I don't need to explicitly put the terminating NULL pointer in the file, since what's after the program is zero-initialized data already. 08:37:55 (Lunchtime.) 08:38:08 More like breakfast time 08:49:14 bah... sockets in Haskell are not very well documented 08:50:46 http://yourfreedom.hmg.gov.uk/repealing-unnecessary-laws/repeal-the-2nd-law-of-thermodynamics-1 09:04:35 Deewiant: I almost never manage to do any breakfast at home, so I have to do a 10:30 lunch here. 09:05:03 Breakfast is the most important meal of the day etc 09:08:37 Let's call what I just ate a "breakfast", then. 09:08:48 -!- yiyus has quit (Ping timeout: 248 seconds). 09:09:49 -!- MigoMipo has joined. 09:20:29 -!- tombom has joined. 09:22:01 -!- Gracenotes has quit (Ping timeout: 264 seconds). 09:26:36 -!- yiyus has joined. 09:27:27 -!- Ilari_antrcomp has joined. 09:47:19 -!- augur has quit (Remote host closed the connection). 09:47:32 -!- augur has joined. 09:53:27 -!- wareya has quit (Ping timeout: 260 seconds). 09:55:06 -!- wareya has joined. 10:01:39 -!- wareya has quit (Ping timeout: 240 seconds). 10:03:53 -!- wareya has joined. 10:35:24 -!- oerjan has joined. 10:49:25 -!- augur has quit (Remote host closed the connection). 10:49:35 -!- augur has joined. 10:57:02 -!- Gracenotes has joined. 11:12:12 -!- oerjan has quit (Quit: leaving). 11:12:14 -!- augur has quit (Remote host closed the connection). 11:12:24 -!- augur has joined. 11:21:52 -!- DH____ has joined. 11:24:38 I think I program a little better after being drunk 11:24:42 not while drunk 11:24:46 but after I have sobered up 11:35:54 -!- FireFly has joined. 11:43:59 where are o(klopol|erian) 11:50:58 -!- ais523 has joined. 11:55:00 -!- MizardX has joined. 11:59:27 -!- augur has quit (*.net *.split). 11:59:29 -!- cheater99 has quit (*.net *.split). 12:02:41 -!- augur has joined. 12:02:41 -!- cheater99 has joined. 12:05:53 -!- augur has quit (*.net *.split). 12:05:54 -!- cheater99 has quit (*.net *.split). 12:14:40 -!- augur has joined. 12:15:35 -!- cheater99 has joined. 13:10:36 -!- maxman has joined. 13:11:41 -!- elliottcable has changed nick to Paws. 13:11:51 -!- Paws has changed nick to elliottcable. 13:12:01 -!- maxman has left (?). 13:36:52 -!- MigoMipo has quit (Read error: Connection reset by peer). 14:11:30 -!- nooga has joined. 14:22:00 AnMaster: sorry for disappearing, my battery was depleted 14:24:42 nooga, hm lets see 14:25:03 nooga, wtf is http://plfoto.com/zdjecie,inne,wkrotce-bal-sie-tutaj-rozpocznie,1549252.html ? Some sort of post-apocalypse world? 14:25:07 nooga, and tell your dad I think your images are awesome. And I love HDR. 14:25:11 nooga, ^ 14:36:32 -!- BeholdMyGlory has joined. 14:41:32 -!- lifthrasiir has quit (Ping timeout: 276 seconds). 14:41:41 -!- lifthrasiir has joined. 14:42:03 not post-apocalypse but post-soviet :D 14:44:21 http://keygenjukebox.com 14:44:23 http://keygenjukebox.com 14:44:23 http://keygenjukebox.com 14:44:31 nooga: hahah 14:44:34 nooga: it's the same. 14:45:10 yeah :f 14:46:32 Hm wow. Any of you have a classical PC keyboard nearby. Not low profile that is. And a rubber band. 14:46:32 Put the rubber band around ESC-F12, wait while it slides up the keys... Try to predict which way it flies. 14:46:49 it was like soviets took polish manors and turned them into big farms & stuff and then left 14:47:06 so there are some ruined places like this 14:50:01 AnMaster: no. 14:50:01 -!- wareya has quit (Read error: Connection reset by peer). 14:50:25 nooga: it's not like they weren't pigstalls before the russians came 14:50:56 -!- wareya has joined. 14:51:19 pardon? 14:52:23 the royals getting drunk and high all the time for the money they got from traders for selling off their influence 14:52:49 you can only have so many drunken parties in a nice place before it turns into a crackhouse 14:53:16 http://cutr.pl/5ec68700f0 14:54:16 uhm 14:55:56 do you truly think if the polish gave a shit about their country this stuff would like that *today*? 14:56:14 25 years after overthrowing the soviet regime? 14:56:53 AnMaster: no. <-- ? 14:57:20 AnMaster: i refuse to be a slave executing your rubberband schemes. 14:57:34 cheater99, XD 14:58:08 > sure 15:19:25 -!- Deewiant has quit (Ping timeout: 276 seconds). 15:22:44 -!- Deewiant has joined. 15:25:56 -!- MigoMipo has joined. 15:36:08 wow, someone found an XSS bug in Youtube comments (now fixed) 15:36:24 the string that broke them was