00:00:11 also, random libraries dotted around the Internet (Java scores well on that metric) 00:00:36 ais523: Python probably measures up well in comparison 00:00:45 I think so 00:00:58 ais523: bear in mind that I think most CPAN hype is due to it basically being the first of its kind 00:01:02 I think it's probably still behind because Perl had quite the head start in terms of people making lots of libraries for it 00:01:04 elliott: indeed 00:01:16 being first of its kind definitely gives a relatively major boost, though 00:01:20 And I bet that if you investigated all the things you can supposedly get on CPAN, a large number of them will be completely broken 00:01:28 hmm, interesting 00:01:31 truth. 00:01:34 CPAN has automated testing, etc 00:01:40 I do find partially broken stuff quite often 00:01:43 but completely broken is rare 00:02:23 71145 Uploads, 23245 Distributions 00:02:23 98470 Modules, 9170 Uploaders 00:02:41 I find it very hard to believe that there are anywhere near 23245 useful packages on CPAN 00:02:50 although I suppose with the ridiculous kind of splitting they do it might be possible 00:06:28 I don't know much about rubygems but I believe it has a fairly large set of packages as well. 00:06:49 (Seven!) 00:10:18 perl -e "use List::Util 'sum'; print sum(split /\D+/, <>)" catlist.txt 00:10:19 6331 00:10:31 catlist.txt is a copypasta from the category list on hackage 00:11:26 Hackage's are all good, though. 00:11:33 all of them. 00:11:43 elliott, POORLY DOCUMENTED RSYNC LOGS 00:12:22 mention rsync logs on http://codu.org/logs/_esoteric/ or in topic? best keep it a secret? help 00:12:33 * pikhq is friggin' doing this. 00:12:56 monqy: !logs 00:13:01 yes I know 00:13:03 pikhq: THEN FRIGGIN' DO IT 00:13:09 Come on, Firefox on DOS. 00:13:20 monqy: It's a lot of bandwidth so I'm not trying to make it super-duper-well-known :P 00:14:39 just found this little morsel on the web: perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"' 00:15:03 converts the number to unary and then determines if it's prime 00:15:06 with a regex. 00:15:07 It's surprisingly easy to do this in qemu, BTW. 00:15:40 I think the only "hard" bit is that I need to tell it to use an ne2k_isa network card instead. 00:16:03 -!- iamcal has joined. 00:16:40 CakeProphet, eeew. 00:17:03 Gregor: Do you have a machine with a terabyte of space just lying around? I hear you're rich, so let me tell you about these DVDs... 00:17:26 So the ^1?$ presumably tests if it can be divided into m repetitions of n? 00:17:48 Phantom_Hoover: actually I'm not sure how it works because to me it looks like it's just determines if it's even or odd... 00:17:59 ^1?$ just matches epsilon and "1", Phantom_Hoover. 00:17:59 the ^1?$ just matches the case of 1 00:18:04 yes. 00:18:22 also it's !~ which means "does not match" 00:18:43 Oh, wait, that's a |, not a /. 00:19:38 but to me (11+?)\1 says "match an even number of 1's" unless I'm misunderstanding the nongreedy semantics 00:20:14 s'(11+?)\1'(11+?)\1+' 00:20:31 Are you sure it's not just an odd-or-even tester? :p 00:21:58 using 9 as input yielded nothing 00:22:10 7 yields "7 is prime" 00:22:39 it must be something to do with +? 00:23:29 ooooooh 00:23:31 wow. 00:23:35 yeah okay 00:23:43 I see how it works. 00:24:14 So was my rough outline accurate? 00:24:54 i.e. that the regex matches any m repetitions of a sequence of n 1s? 00:24:59 yes. 00:25:35 that's some clever backreferencing. 00:27:11 this is all kind-of obvious, btw, you people 00:27:27 I think I wrote a regex like that myself as a proof of concept 00:28:15 ais523, it's regexes; they're write-only. 00:28:30 no they aren't 00:28:49 regexes are pretty easy to read; they're more or less equivalent to subroutines containing many lines, and take similar effort to read 00:29:03 what you're doing wrong is trying to read them a line at a time rather than character at a time 00:30:05 That was a joke, ais. 00:31:58 * Phantom_Hoover → sleep 00:31:59 -!- Phantom_Hoover has quit (Quit: Leaving). 00:32:43 yeah I agree that they're easy to read for the most part. What happened was the +? semantics threw me off 00:33:02 as you no longer read it character-by-character at that point, but have to refer to the rest of the pattern to figure out what it does. 00:34:04 `run echo "234346234346134983746987234987239587239847235" | perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"' 00:34:06 No output. 00:34:19 does +? do matching differently than * then? 00:34:29 or am i confused 00:34:33 +? is like *? 00:34:38 but with a required first match 00:34:52 I know the relationship between + and * 00:34:52 *? is like * in formal regular expressions. 00:35:01 * in perl regex is not. 00:35:04 but I might not be getting ? 00:35:06 oh 00:35:23 *? matches the minimum number of repetitions, * matches maximum. 00:35:34 regex :( 00:35:52 so is ? just a greediness thing then? 00:35:59 yes. 00:36:25 though actually I guess formal regular expressions have no notion of greediness. 00:36:51 I'm used to (whatever)? === (whatever|epsilon) or maybe I only think I'm used to that and really I'm just 100% confused 00:37:10 that's what ? normally means, *? and +? are special forms 00:37:15 ewwww 00:37:19 because you would never put a ? after * and + 00:37:26 otherwise. 00:37:28 still, ewwwww 00:37:41 there's also ?? which I'm not quite so clear on. 00:38:27 it's a nongreedy ?, so I guess it'll match epsilon if the preceeding pattern matches in that case. 00:38:46 whereas ? would match the non-epsilon case in situation. 00:38:57 *that situation 00:39:02 it's not commonly used. 00:40:14 but anyways in ^(11+?)\1+$ the group in parens will continue to match 1s until any number of repetitions of that group matches the entire string of 1's 00:40:33 in other words, it consumes 1's until the number of 1's divides the total number. 00:40:40 or fails otherwise. 00:46:29 > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in sieve [2..] 00:46:30 [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101... 00:46:44 > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 1000 $ sieve [2..] 00:46:45 [7927,7933,7937,7949,7951,7963,7993,8009,8011,8017,8039,8053,8059,8069,8081... 00:46:49 > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 10000 $ sieve [2..] 00:46:52 mueval-core: Time limit exceeded 00:46:57 > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 9999 $ sieve [2..] 00:47:00 mueval-core: Time limit exceeded 00:47:07 > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 3333 $ sieve [2..] 00:47:11 mueval-core: Time limit exceeded 00:47:14 > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 2222 $ sieve [2..] 00:47:17 [19597,19603,19609,19661,19681,19687,19697,19699,19709,19717,19727,19739,19... 00:47:45 let sieve (p:xs) = p : sieve {filter (\ x -> x 'mod' p /= 0) xs) 00:47:47 er... 00:48:16 echo "19739" | perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"' 00:48:21 `run echo "19739" | perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"' 00:48:24 19739 is prime 00:48:52 > nubBy(((>1).).gcd)[2..] 00:48:53 [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101... 00:49:05 (obligatory) 00:49:12 oh that one is nice I forgot about that. 00:49:59 > drop 5555$nubBy(((>1).).gcd)[2..] 00:50:03 mueval-core: Time limit exceeded 00:50:07 > drop 4444$nubBy(((>1).).gcd)[2..] 00:50:11 mueval-core: Time limit exceeded 00:50:12 > drop 3333$nubBy(((>1).).gcd)[2..] 00:50:16 mueval-core: Time limit exceeded 00:50:21 about the same in efficiency I guess? 00:50:32 well gcd is more expensive than mod 00:50:36 ah 00:51:00 I'll just run it on my machine to get insanely large primes. 00:51:29 good luck 00:52:26 what's the big O on that one? 00:52:36 and it's not a true erathosthenes's sieve if it doesn't skip over non-multiples efficiently rather than dividing, i think 00:52:51 nubBy is pretty inefficient as well iirc 00:53:18 well yes but i think nubBy is pretty equivalent to what CakeProphet wrote 00:53:34 ?src nubBy 00:53:34 nubBy eq [] = [] 00:53:35 nubBy eq (x:xs) = x : nubBy eq (filter (\ y -> not (eq x y)) xs) 00:54:04 yeah that's very similar. 00:54:14 -!- copumpkin has quit (Ping timeout: 260 seconds). 00:54:31 -!- copumpkin has joined. 00:55:30 so could you use nubBy with mod? 00:55:35 sure 00:56:15 ah but you can't access the x 00:56:24 from eq 00:56:24 > nubBy(((<1).).flip mod)[2..] 00:56:26 [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2... 00:56:29 oops 00:56:34 > nubBy(((<1).).mod)[2..] 00:56:35 [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101... 00:56:56 ah it's actually the same length when written with <1 00:57:01 * CakeProphet is still waiting for the 9999th prime number to appear in ghci.... 00:58:31 I know the Perl prime number tester is not very memory efficient, but perhaps it's computationally efficient. 00:59:01 probably not though.. 01:00:07 `run echo "104729" | perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"' 01:00:14 104729 is prime 01:00:47 -!- Vorpal has quit (Ping timeout: 245 seconds). 01:04:57 -!- Nisstyre has quit (Ping timeout: 245 seconds). 01:05:00 That's pretty comedic. You can give the installer an invalid serial number. 01:05:26 It politely informs you that you can't get tech support without a valid one, and asks if you'd like to continue the install, or try again. 01:06:51 -!- Nisstyre has joined. 01:09:25 cute 01:09:37 * CakeProphet pipes a Haskell programming that generates primes to the perl one-liner. a wonderful thing is happening. 01:09:45 all my CPU usage is pretty close to 100 01:09:51 s/all/also/ 01:10:33 it's gradually starting to output slower as the numbers increase. 01:11:37 that happens 01:11:43 .... >_> yes it does. 01:11:59 I'm just wondering at what point it will start to slow to a crawl. 01:12:05 currently in the 21k range 01:12:09 eventually 01:13:10 mmmm it's a beautiful thing. 01:13:19 what is it 01:13:54 I just told you.... 01:14:06 Haskell program generating primes, Perl one-liner thing testing that they're primes. 01:14:11 oh 01:14:21 and how is that beautiful 01:15:00 because they're happily communicating on my processor, which is computing mad amounts of instructions. 01:15:12 I dunno, WHAT IS BEAUTY? monqy? help? 01:15:33 help 01:17:39 wat.... 01:17:54 sorted by CPU usage, the two two processes on my machine are currently "perl" and "java" 01:18:01 IS HASKELL JAVA? 01:18:17 rarely, i believe 01:18:57 oh okay, primes is at 0 01:19:15 what is java doing 01:19:17 probably because it is working much faster than perl. 01:19:34 uh, I think it's the java applet for my online class. 01:19:39 I have no idea what it's doing. 01:36:39 lol, I just tried to define a main function in Python 01:36:44 I'M GETTING MY LANGUAGES CONFUSED AAAAH 01:36:58 earlier I tried to use "using" instead of "import" in a Haskell program 01:47:58 -!- hagb4rd has joined. 01:55:37 i got mentioned? 01:56:36 technically 02:02:43 super(self.__class__, self).__init__(source) 02:02:49 Python: a beautiful programming language 02:03:31 I love writing that line. all the time. it's fun. every underscore is like unadultered joy. 02:04:07 -!- pikhq has quit (Ping timeout: 240 seconds). 02:05:06 -!- sllide has quit (Quit: Leaving). 02:06:41 CakeProphet: super is a waste of time 02:07:00 also I'm pretty sure you're meant to put the actual class there, not self.__class__ 02:07:09 that's sort of the whole idea what with subclasses, I gather 02:07:23 ah, I finally remembered what combo I'd bound to turn windows black and white 02:07:34 now I'm trying to remember /why/ I bound a complicated combination to do that 02:07:40 (super-shift-mousewheeldown, fwiw) 02:07:45 CakeProphet: but seriously, just do Foo.__init__(self, ...) and avoid multiple inheritance forever 02:07:52 ais523: /mousewheeldown/? 02:08:01 elliott: yep, and mousewheelup to turn them back again 02:08:06 hey, it's not like I'm going to press it by accident 02:08:14 that's awful :P 02:08:15 there are various amounts of desaturation in between 02:08:36 I knew it was modifiers + mousewheel, but forgot which modifiers 02:10:43 elliott: if I recall correctly, the super(self.__class__, self).__init__ stuff is "more pythonic" 02:11:35 maybe I should go ask #python even though they suck dicks. 02:11:45 CakeProphet: It is literally identical to super unless you have multiple inheritance. 02:11:53 If you have multiple inheritance, you have two or more problems. 02:12:13 CakeProphet: But seriously, I'm pretty sure you _have_ to use it like super(ClassName, self) for it to work properly. 02:12:19 Or later inheritance will mess it up. 02:12:21 multiple inheritance suxx 02:12:26 nope it's the same. 02:12:37 super(self.__class__, self) is the same as super(ClassName, self) 02:12:37 CakeProphet: No, it patently does not have the same semantics. 02:12:48 self.__class_ =/= ClassName if self is an instance of a subclass of ClassName. 02:12:50 self.__class__ == ClassName 02:12:56 oh 02:12:58 right. 02:13:05 CakeProphet: You may also enjoy this fun fun fun article: http://fuhm.net/super-harmful/ 02:13:17 OH HEY I BET THIS EXPLAINS THIS BUG. 02:13:26 tl;dr you have no hope of getting super right, multiple inheritance is shit, just say SuperClass.__init__(self, ...) and be happy. 02:13:54 HELLO KITTY 02:13:56 time to rewrite those lines in 6 or so classes. 02:14:19 < Dulak> CakeProphet: super() or call it as ParentClass.method() are the two options, I typically avoid super myself 02:14:24 Dulak of #python has spoken. 02:14:38 Sounds like a Cardassian name. 02:14:52 Make sure he doesn't hit you with a rock. 02:15:00 Or several rocks. 02:15:21 man I hate #python 02:15:40 avoid super? this is so unesoteric 02:15:54 Are we sure hagb4rd isn't actually a bot? 02:16:02 HERE AT ESOTERIC WE VALUE CLEAN, ELEGANT CODE. 02:16:21 * hagb4rd passes the turing test 02:16:42 hagb4rd: not from here you don't 02:16:54 Wasn't there some program mentioned on the wiki meant to take the input/output of esolangs that only have ASCII I/O and use some protocol on them to do tihngs like access files and stuff? 02:17:35 There have been various, IIRC PSOX is the most recent. 02:17:40 MDude: Not ASCII, but eight-bit, yes. You might be thinking of PESOIX or EsoAPI or PSOX. 02:17:45 But you don't want to. 02:18:36 weeeee OOP 02:19:33 hagb4rd: well as a small turing test, you might explain zygohistomorphic prepromorphisms as applied to the INTERCAL threading model. 02:19:34 elliott: okay so I've got a huge class tree of AST node types 02:19:51 oerjan: I'm not even sure /I/ can do that 02:20:01 ais523: shhh 02:20:03 CakeProphet: that might be one of your problems. 02:20:05 CakeProphet: but go on. 02:20:08 would you consider it bad practice to implement the interpreter by calling an evaluate() method on the top level node? 02:20:22 which then calls subnodes evaluate methods, etc... 02:20:42 oerjan: syntax error 02:20:55 CakeProphet: itt: visitor pattern 02:21:09 basically yes it's fine. 02:21:19 awesome because that will actually be more pleasant than the alternative. 02:21:21 CakeProphet: but you may also want to do it visitor style instead. 02:21:25 http://en.wikipedia.org/wiki/Visitor_pattern#Source 02:21:28 which is uh 02:21:33 basically just syb: the verbose oop edition 02:22:01 I think that is the same thing as what I was talking about 02:22:07 it isn't 02:22:14 oh I see the difference. 02:22:17 it's more generic 02:22:21 but you probably don't care 02:22:41 -!- oerjan has quit (Quit: Good night). 02:22:44 oerjan: would you like to explain it to me? i'd be glad to learn 02:22:45 I only care if my employer cares. I'm not sure he'll notice all the lengths I'm going through to me everything easy to extend later. 02:22:56 CakeProphet: a method is better imo 02:23:11 elliott: so basically the difference here is that the visitor object has a method as well? 02:23:16 or? 02:23:19 ...no. 02:23:21 just do it as a method 02:24:29 instead of the "visitor" object I'll just be passing around an environment object. 02:24:38 yeah, you don't understand the visitor pattern, but it doesn't matter 02:24:41 with symbol table, stack info, etc. 02:24:45 if you want extensibility it's easier to have a method 02:24:54 oerjan: i really do not know much, but it took me 30 years of my life to find this channel ;) 02:25:02 isn't visitor pattern kidna like monads? 02:25:06 Patashu: no 02:25:13 hagb4rd: you spent thirty years of your life wanting an irc channel about esolangs? 02:25:38 elliott: plz explain visitor pattern. 02:25:53 I was tihnking of making a 2D language that requires miltithreading, but it looks like Flip already does that. 02:26:01 isn't visitor pattern where you expose an iterator over all your children? 02:26:06 elliot: no not really.. to find a channel i really do not understand anything 02:26:36 hagb4rd: any channel where people spoke nonsense all day would fit that bill, so i recommend you try #vjn 02:26:37 elliott: oh wait I see 02:26:43 it's like... double what I'm doing. 02:26:47 Patashu: yes, which is unrelated to monads. 02:27:00 monads are where you can apply a function over a container of values regardless of what the container is, right? 02:27:01 that's monadish 02:27:04 Patashu: no. 02:27:09 elliot: and not to forget.. find guys as charming as you are 02:27:12 ;) 02:27:19 as charming as elliott? 02:27:19 Patashu: that's functors, and the description is misleading 02:27:20 that'll be tough 02:27:28 ("computation" is better than "container" but still not quite accurate) 02:27:36 hagb4rd: If you had said that a week ago, we'd call the cops on you X-D 02:27:47 rofl 02:27:55 Gregor: Dude, augur used to talk a lot in here. 02:27:58 WHERE WERE THE COPS THEN 02:28:02 elliott: yeah visitor pattern looks really annoying I'm not going to do that. 02:28:09 elliott: Having sex with augur, where else? 02:28:21 gregor: is your game making progress? 02:28:29 finished it? 02:28:45 Gregor: IS ZEE DONE YET 02:28:47 hagb4rd: It's implemented, but my attempts at making bots for it thusfar have had limited success. 02:28:50 elliott: *sobblecopter* 02:29:11 tried genetically making bots yet? 02:29:15 * Sgeo suddenly envisions writing tax processing code using Haskell's List monad 02:29:15 limited.. i see 02:29:21 Patashu: NO U 02:29:24 Genetic programming is really really shitty. 02:29:31 But it's still my first thought when I think of rezzo :P 02:29:36 I mean, see how badly it does for BF Joust 02:29:39 rezzo is about ten times more complicated 02:29:44 -!- azaq23 has joined. 02:29:56 You can't just generate a program to do any task that involves some kind of tolerated imperfection :P 02:29:59 it's not shitty for -everything- 02:35:06 wow that did not take long enough to debug, obviously something is wrong. 02:37:56 elliott: also I'm curious as to how you would do an AST in Python 02:38:08 single tree class? 02:38:57 first i'd use tuples with the first element being a tag, then i'd kill myself and promise myself i'd do haskell in the next life 02:39:42 yea the solution is clean, safe, fast and absolutely wrong 02:39:42 ...I think using a class is actually a better approach in Python. 02:39:53 YOU CAN'T CODE HASKELL IN OTHER LANGUAGES, ELLIOTT. 02:40:00 IT IS MORE ANNOYING. 02:40:16 the first thing is... not the haskell solution. 02:40:27 hagb4rd: seriously, you are literally just parroting things from a qdb, right? 02:40:31 well right, but haskell-esque 02:40:37 or like a trite geek phrase database 02:40:47 CakeProphet: more erlang-esque tbh 02:40:53 -!- GreaseMonkey has joined. 02:40:53 -!- GreaseMonkey has quit (Changing host). 02:40:53 -!- GreaseMonkey has joined. 02:41:24 elliott: but OO is so elegant! I've got like 77 lines of boilerplate AST code. 02:43:09 elliott: y should i do such miserable things? nope.. i read this on a sticker or sth 02:43:20 hagb4rd: ok 02:44:22 hagb4rd: do you know how to write computer programs? 02:44:23 YES YES YES HASKELL LAZINESS HELPS SOLVE MY PROBLEMS 02:44:34 At least one of them, anyway 02:44:42 cakeprophet.. yes.. 02:45:01 I still feel like I'd... wait, State monad would break that, wouldn't it? 02:45:01 i've come here to change this 02:45:04 Or not 02:45:38 Or yes 02:45:46 I should actually try it at some point 02:45:52 Wonder if the ST monad has these problems 02:45:58 cakeprophet: but i'm not working at this lowlevel usually 02:46:13 but it's fun 02:46:14 Sgeo 02:46:15 low level? 02:46:22 * Patashu ponders low level haskell... iota? 02:46:24 what did you do to my client why can i see your messages again :( 02:46:42 elliott, nothing deliberately 02:47:34 Patashu: http://hpaste.org/50517 02:47:42 or that 02:56:22 hagb4rd: what languages do you know? 02:56:31 also what we've been talking about recently hasn't bee "low level" 02:56:40 *been 02:59:35 is hagb4rd a programmer i thought he wasn't 02:59:38 he's been here a while 03:03:14 okay.. let me put it this way. my humble job is consulting business parnters in it-issues.. very boring indeed..so nevermind 03:04:01 the opposite of operation mindfuck, you know 03:06:12 -!- pikhq has joined. 03:07:43 hi is bad things happening 03:07:50 I need a new company cell phone. Random lackey, go buy a Motorola. Aye aye! (later) Which model did you buy? ... model? 03:09:48 Gregor: That was just as funny as the first time I heard it, except instead of Larry Page it was Intel and instead of Motorola it was McAfee! 03:10:01 *badum* 03:12:56 the opposite of operation mindfuck, you knowu practice here 03:13:11 sorry 03:13:31 i killed my poem 03:13:37 *sigh 03:13:44 Stepdad types router admin password in plaintext, gets pissed that I noticed. Hooray, dealing with stupid! 03:14:17 Family: Literally the worst thing? (Since stealing elliott's phrases, anyway) 03:14:50 I am fairly sure I did not invent any of the mannerisms I use. 03:14:57 But by all means attribute them to me :P 03:14:59 -!- azaq23 has quit (Ping timeout: 252 seconds). 03:15:23 I probably invented at least a good few of my mannerisms 03:16:17 cakeprophet.. what you do here is the sophisticated, erisian, esoteric scientific approach.. in everyday-life the opposite of what i'm used too 03:16:47 hagb4rd: have we told you that you've got the wrong definition of esoteric yet 03:16:54 because you might have 03:17:17 Anyways. I've got DESQview X working, but I can't get the friggin' network stack to work 03:18:32 elliott: u don't miss any chance to do so, yes 03:18:44 ok 03:18:49 what is esoteric than? 03:19:50 my english seems infantile but i'm a fucking intelligent bot 03:19:57 so explain 03:20:01 http://esolangs.org/wiki/Main_Page, http://en.wikipedia.org/wiki/Esoteric_programming_language might help :) 03:20:43 ok... thank you 03:23:01 hagb4rd: so you can't program? we should fix that 03:23:18 CakeProphet: right 03:23:19 are you sure this is a good idea.... 03:23:30 teaching someone how to program is always a good idea. 03:23:31 always. 03:23:34 always? 03:23:36 yep. 03:23:50 so uh 03:23:52 how are you going to 03:23:53 uh 03:23:53 do 03:23:54 this 03:24:03 I'm not. IT WILL SIMPLY HAPPEN. 03:24:06 oh 03:24:06 okay 03:24:09 well 03:24:10 good luck 03:24:11 with 03:24:11 that 03:24:15 let me just listen for a while and ignore my stupid comments 03:24:17 and I will wait, and continue working on my project. 03:24:23 well you certainly won't learn that way. 03:24:35 you'll just listen to us and not know what we're talking about at all. 03:24:49 elliott: teach him Haskell. go 03:24:58 YES 03:24:59 hagb4rd: you know histomorphism morphisms? 03:25:02 CAN HAS NETWORKING 03:25:09 well what prepromorphisms are to morphisms 03:25:15 and zygohistomorphisms are to histomorphisms 03:25:22 help 03:25:25 are to zygohistomorphic prepromorphisms 03:25:33 what histomorphic morphisms are 03:25:37 hope this helps 03:25:44 no, but i have a hairdresser callled dominique 03:26:03 elliott: I'm hoping you just made those words up 03:26:06 and they have no formal meaning. 03:26:17 (aside from morphism) 03:26:34 morphism! 03:26:42 CakeProphet: zygohistomorphic prepromorphisms are real. 03:26:48 see http://www.haskell.org/haskellwiki/Zygohistomorphic_prepromorphisms, http://stackoverflow.com/questions/5057136/real-world-applications-of-zygohistomorphic-prepromorphisms 03:27:08 CakeProphet: oh, http://www.reddit.com/r/programming/comments/6ml1y/a_pretty_useful_haskell_snippet/c04ako5 before the stackoverflow link 03:27:08 no thanks I'm currently working on making 2 grand. 03:27:14 but maybe later. 03:27:19 okay.. that should be enough to confuse me in lesson1..thx 03:27:36 hagb4rd: no you definitely need to read an introductory text on how to program in some language. 03:27:41 or have a good teacher. 03:27:56 if you seriously want to learn. 03:28:03 and not just read confusing things you don't understand. 03:28:15 okay.. i'm used to c, java, pearl and stuff you're really not interested it 03:28:27 CakeProphet: well, that's what the other kind of esoteric is all about. 03:28:34 so it must do something for a lot of people 03:28:38 i recommend the a gentle introduction to haskell 03:28:46 i know elliott 03:28:49 monqy: its very gentle 03:28:51 so far 03:29:07 but i will read this articles..i promise 03:29:27 these 03:29:53 don't, they're jokes. 03:29:54 my favorite part about writing a parser by hand has been: the myriad of error messages 03:29:57 so much fun. 03:30:10 CakeProphet: you should write it in haskell instead. and then also use trifecta or something 03:30:21 lolwat 03:30:26 trifecta implies 3 of something. 03:30:39 NO SENSE IS MADE HELP 03:30:48 it's a sweet parser library edwardk has been writing 03:30:53 it's awesome 03:30:53 -!- azaq23 has joined. 03:30:56 CakeProphet: http://hackage.haskell.org/package/trifecta 03:30:59 s/$/[(]C[)]/ 03:31:03 i haven't used it but apparently it is like parsec but nicer?? 03:31:10 and i hear it gives fancy syntax-highlighted automatic errors like clang does 03:31:16 oh, no too late for that. and this guy wants it in Python. 03:31:20 as opposed to parsec's errors which are.... not good......... 03:31:28 neat. 03:31:29 CakeProphet: that's ok, just write a python bytecode backend for ghc 03:31:33 heh 03:31:35 yeah okay. 03:31:41 that is totally possible. 03:31:46 it also gives you syntax highlighting in html or other outputs if you want 03:31:47 of course it is 03:31:50 and will also support completion 03:31:50 because python bytecode is so non-language specific. 03:31:51 not even that hard, I would guess 03:31:53 stg isn't that complicated is it? 03:32:03 CakeProphet: um python bytecode is actually really easy to target 03:32:04 okay..let's start with haskell then 03:32:08 it's just a really simple stack machine 03:32:11 with a few object things 03:32:27 yes I know. but would that be easy to translate to from a functional language? 03:32:33 Let's see how hella-slow this is. 03:32:43 It segfaulted! 03:32:44 CakeProphet: ghc doesn't go straight from haskell to assembly dude 03:32:49 I am aware. 03:32:56 -!- MDude has changed nick to MSleep. 03:33:05 so you're saying translate either Core or C to Python bytecode yes? 03:33:09 or is there another step inbetween? 03:33:11 CakeProphet: no, either STG or Cmm 03:33:20 oh, those are new to me... 03:33:31 it goes Haskell → Core → STG → Cmm → backend, I believe 03:33:46 Cmm is just GHC's internal dialect of C-- (http://www.cminusminus.org/) 03:33:52 so it's basically C but with fewer assumptions and no high-level features. 03:34:01 what about STG? 03:34:07 I dunno how nice stg would be to compile, ask copumpkin :-D 03:34:15 what kind of language is it though. 03:34:19 but I'm pretty sure it's more functional-ish than Cmm 03:34:25 so probably you want to turn Cmm into Python bytecode 03:34:31 hmm, now I want to implement this :/ 03:34:35 it's not really a visible language 03:34:41 Okay. 03:34:49 what's your opinio on ms' f# 03:34:51 This message sent from DOS. 03:34:52 copumpkin: tell me writing a Cmm → Python bytecode compiler is a bad idea 03:35:02 it wouldn't be impossible, but I wouldn't do it 03:35:06 hagb4rd: it's like OCaml except proprietary and not nice 03:35:08 hagb4rd: I don't really have one. Kind of neutralish. 03:35:15 copumpkin: btw, "it's not really a visible language" - about STG or Cmm? 03:35:21 stg la 03:35:30 I mean obviously none of it is "visible" but backends have to process something :P 03:35:35 STG 03:35:41 cmm I write a decent amount of 03:35:46 I'm almost convinced there's no clean way to write a parser via imperative style. 03:35:57 copumpkin: well, right, a bunch of the rts is cmm isn't it 03:36:05 some of it 03:36:07 most is in plain C 03:36:09 CakeProphet: imperative programs compose terrible, q.e.d.? 03:36:17 copumpkin: close enough to a bunch for me 03:36:40 * elliott takes a look at http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/CmmType 03:37:26 i like how most of this is "exactly like C-- EXCEPT ..." 03:38:19 elliott: though at least python has a partition method which makes things somewhat cleaner. 03:38:29 still I find myself resorting to character-by-character loops more than I would like. 03:38:36 CakeProphet: you could just use a parser combinator library 03:39:03 ...I'm already almost done with this though, so.. I'll just use this. 03:39:14 * CakeProphet has about a week to implement the interpreter and the frontend stuff. 03:39:17 why didn't you use a parser combinator library to start with 03:39:23 CakeProphet: what are you actually coding 03:39:23 and test, and document everything. 03:39:41 it sounds like someone is paying you a small amount of money to implement a language but that scares me because why........... 03:39:57 cakeprophets language "its totally cool and good okay" 03:39:58 please tell me it's at least a dsl 03:41:01 My goodness this is amazing. 03:41:15 pikhq, hm? 03:41:35 This xterm is running in a DOS X server. 03:42:05 Cool. Why would anyone make a DOS X server though? 03:42:09 Except for fun 03:42:13 Or if it's old 03:42:22 It's fucking ancient. 03:42:39 This features the ability to run Win 3.1 alongside X. 03:42:41 * Sgeo repeats to self "X is not new. X is not new" 03:42:48 x is not new 03:44:09 DOS is more ancient than you would like to think. 03:44:46 It's not DOS that I'm failing to think of as ancient (although I guess that too), but X. 03:45:36 Yeah. Still, it's utterly insane. 03:46:23 * CakeProphet has got mad language writing skills dawg. 03:46:28 don't even try to diss my shit. 03:46:35 dissing 03:46:43 monqy: dude wait till I write my regex-inspired language. 03:46:46 bricks will be shat. 03:46:48 you will be in awe. 03:46:51 CakeProphet: perl? 03:46:53 of how bad it is 03:46:55 and awful 03:46:56 and ugly 03:46:57 and gross 03:46:57 Patashu: harr harr har 03:47:42 yeah because it makes complete sense for Perl to be inspired by a subset of itself. 03:48:08 I could go deeper. 03:48:22 I could start qemu. 03:49:11 actually regex is a superset of Perl due to (?{...}) and friends 03:49:29 and Perl is a superset of Perl regex. 03:49:41 oh shi- 03:49:43 PARADOX 03:49:55 Wall's Paradox. 03:51:00 monqy: essentially it's like regex except patterns have return values and there's basically a large set of "patterns" that are zero-width 03:51:16 so it's actually not like regex at all. 03:51:45 and more like a programming language with regular expression operations as first-class citizens. 03:52:41 also there's multiple contexts that an expression can be evaluated in, like Perl. 03:52:56 IT'S THE BEST THING EVER YOU WILL SEE. 03:53:06 ew contexts (puke) 03:53:12 multiple contexts is basically implicit casting right? 03:53:39 -!- variable has quit (Remote host closed the connection). 03:54:27 Patashu: sort of. 03:54:47 it's a runtime occurence. 03:55:12 also in Perl subroutines can routine two completely different things based on their context. 03:55:29 the builtin operators do this often, and user-defined subroutines can do it with the wantarray operator 03:55:45 s/routine/return/ 03:55:50 ah, that's interesting 03:55:54 that's something overloaded functions don't do 03:56:01 indeed. 03:56:26 (puke)(puke)(puke) 03:56:45 puk 03:56:55 *ponders object contexts plus polymorphism* 03:57:08 !perl $_='test'; print /test/ 03:57:09 1 03:57:32 !perl $_='test'; print /(.)(.)(.)(.)/ 03:57:32 test 03:57:49 !perl $_='test'; print scalar /(.)(.)(.)(.)/ 03:57:50 Warning: Use of "scalar" without parentheses is ambiguous at /tmp/input.29688 line 1. 03:57:58 !perl $_='test'; print (scalar /(.)(.)(.)(.)/) 03:57:58 Warning: Use of "scalar" without parentheses is ambiguous at /tmp/input.29772 line 1. 03:58:04 !perl $_='test'; print scalar (/(.)(.)(.)(.)/) 03:58:04 1 03:58:06 lolwat 03:58:12 I don't really see how it was ambiguous but OKAY. 03:58:25 so yeah in list context regex match returns a list of its captures 03:58:35 CakeProphet ~ "maybe not as well-versed in perls grammar as perl" 03:58:37 the eulogy 03:58:43 in scalar context it returns 1 or undef 04:00:13 Patashu: also because Perl subroutines take a list as their single argument that means passing as argument = list context 04:00:32 Patashu: unless you use scalar, which forces scalar context, as I did. 04:00:36 !perl $_=':P'; print /(.)(.)/ 04:00:37 ​:P 04:00:41 was 04:00:48 esoteric 04:00:54 rifg 04:01:37 last but not least it was kind of erotic 04:01:57 that's not really esoteric at all. 04:02:21 not erotic 04:02:32 but it was a joke 04:02:50 i try 04:02:55 harder next time 04:03:42 ok 04:04:37 I actually do find Perl code to be beautiful. 04:04:43 lol 04:04:52 CakeProphet: ack 04:05:04 I find vb code to be beautiful 04:06:00 $x=0;map{/i/&&$x++;/d/&&$x!=0&&$x--;/o/&&print"$x\n";$x*=$x!=16&&$x if/s/}<> 04:06:01 | 04:06:01 >\ 04:06:10 beautiful. 04:07:16 myndzi is the best part 04:12:51 -!- variable has joined. 04:14:48 I kinda wonder why this thing seem to miss key presses intermittently. 04:22:44 -!- pikhq_ has joined. 04:23:59 -!- pikhq has quit (Ping timeout: 258 seconds). 04:25:04 -!- Nisstyre has changed nick to luig1. 04:25:14 -!- luig1 has changed nick to nisstyre. 04:28:16 this is an awesone piece of js code http://deanm.github.com/pre3d/monster.html 04:28:48 "awesome piece of js" -- that statement cancels itself out and becomes nothingness 04:28:54 +code 04:30:27 maths can create such beauty.. and remains the most powerful tool of all 04:30:37 * CakeProphet stares at the tentacle ball for a few moments. 04:30:47 look at the code 04:30:58 I'm afraid to. 04:31:27 http://deanm.github.com/pre3d/monster.js 04:33:10 yeah I found it. it's pretty much not very possible to read. 04:33:21 but from what I can tell it manipulates a canvas object. 04:35:09 that looks obfuscated :P 04:35:13 as in mechanically 04:35:31 for compression purposes, presumably 04:35:32 use beautify.js 04:35:44 https://github.com/deanm/pre3d/tree/master/demos dunno if that demo is here though 04:40:50 i try to get it formatted.. but even that seems not be trivial 04:41:10 what the hell happens there 04:43:48 I find it funny that pastebin.com lists "Rails" but not "Ruby" 04:51:34 -!- elliott has quit (Ping timeout: 264 seconds). 04:54:05 http://www.youtube.com/watch?v=O2rGTXHvPCQ -- How IRC works, according to American television 04:56:06 -!- evincar has joined. 05:00:56 old stuff 05:01:14 but good 05:01:21 monqy -- resident cool kid 05:01:27 sure 05:01:36 thank you. 05:04:49 There are no good functional languages with web libraries that I like that I can also use on a shared hosting provider. 05:05:19 I guess this is the part where I say "I might have to make one!" 05:05:22 Haskell. 05:06:04 s/(functional languages)/$1 that I like/ 05:06:45 Haskell isn't so bad. 05:06:54 Lately I've seen type systems as more of a gimmick than anything. 05:06:58 ... 05:07:08 you don't know anything about type systems. 05:07:13 or Haskells 05:07:24 I don't know much about Haskell. 05:07:39 -!- azaq231 has joined. 05:07:56 Never written anything non-trivial in it. 05:08:07 do you know how the type system works? 05:08:34 -!- azaq23 has quit (Ping timeout: 260 seconds). 05:08:58 CakeProphet: Aaah, how hackers talk when they don't want to be overheard. XD 05:09:04 Generally speaking, yes. I don't know what you're getting at. 05:09:10 how is it a gimmick. 05:09:36 Also, |)\34|_ #4><><0|)\5 |_|53 1337. 05:09:41 pikhq_: yeah that's totally how it works. thanks smart math show. 05:10:28 A type system is gimmicky in that it serves only to enforce contracts that probably wouldn't have been violated anyway. 05:10:36 ..uh 05:10:40 Static typing requires type annotation at some point, even with type inference. 05:10:58 So you do have up-front work to do. 05:11:13 I just don't think it's necessary for all programs. 05:11:16 you do know that programs are not written perfectly the first time, right? and that type errors are a common result of this? 05:11:39 The notion of type error is tied to a type system, though. 05:11:49 and also, that Haskell will most of the time infer type unless you are using advanced features or need to resolve an ambiguity. 05:12:10 No, a type error can happen otherwise. It's just nowhere near as *clear* that's what happening. 05:12:51 So a type error in an untyped language is just a logic error. 05:12:58 Or dynamically typed or what have you. 05:13:01 Particular form thereof. 05:13:04 evincar: also, a well-made type system helps to /guarantee/ that when your program compiles it will be well-formed, to a degree that the strictness of the type system allows. 05:13:18 One where you're using the wrong *sort* of value in a place. 05:13:47 I'm not saying type systems in general are bad, nor static type systems explicitly. 05:14:01 You're saying it's "gimmicky". 05:14:03 I just don't think the majority of software needs to be typed. 05:14:25 You are one insane optimist. 05:14:28 And that use of typing in software that *doesn't* need it is merely a gimmick. 05:14:41 The majority of software needs as absolute much help as it can *get*. 05:14:42 Can you give an example of needing typing then? 05:15:03 Most software is not merely poor, it is *terrible* and *fundamentally broken*. 05:15:22 Give me a choice, though. 05:15:33 evincar: when my Haskell program compiles, I know I have finished most of the debugging process. The only thing that remains are logic errors (and no, runtime type errors are not logic errors, like you said) 05:15:33 A strong type system can make this less prevalent. 05:15:36 Type annotations are great as an optimisation. 05:15:57 evincar: Haskell requires almost no type annotations. that's not an argument against a well-made type system. 05:16:18 I just don't think that there's significant value to be gained by *omitting* features from a language, namely unrestricted typing. 05:16:28 "features" 05:16:33 s/unrestricted typing/unrestricted memory access/ 05:16:37 Any further questions? 05:16:46 That's not what I mean at all and you know it. 05:16:57 It's quite analogous. 05:17:09 you mean weak typing or the ability to use the wrong type in the wrong place? 05:17:28 More or less. I like being able to be wrong. 05:17:32 !python print 2+"2" 05:17:32 Traceback (most recent call last): 05:17:34 Unrestricted memory access, as per common implementations of C, gives you a *lot* of power. It also gives you the ability to summon nasal demons. 05:17:52 Most programmers, given power, will manage to summon nasal demons. 05:17:54 Just in case I need to be "wrong" in that particular way at some point. 05:18:05 but.....unsafecoerce 05:18:22 Also, yes, you can do *really* nasty things to Haskell's type system if you want. 05:18:39 This, for good reason, is neither the default nor encouraged. 05:19:29 evincar: the fact of the matter is that Haskell's type system is in no way obstructive to your ability to be wrong. 05:19:48 CakeProphet: Maybe he wants the ability to be unintentionally wrong? 05:20:27 -!- kwertii has quit (Quit: bye). 05:20:50 evincar: perhaps you should learn it because it will completely change the way you look at type systems. 05:21:02 * CakeProphet had a sort-of similar viewpoint before he had learned Haskll. 05:21:07 +e 05:21:08 I dunno, I just think it should be all-or-nothing. 05:21:20 You stay out of my way or you give me powerful tools. 05:21:21 what do you mean. 05:21:25 intermezzo: http://www.youtube.com/watch?v=3417VhdGScc 05:21:27 And I've no doubt Haskell's tools are powerful. 05:21:30 So I'm not knocking it. 05:21:39 It's just not my cup of tea. 05:21:43 At the moment. 05:21:57 evincar: because it tells you at compile time when there's a type error? I don't understand. 05:22:05 type errors are like... inevitable. 05:22:12 unless it's a weakly typed language. 05:22:33 I mean, in a dependently-typed language, with enough type information, you can consider any error a type error. 05:23:20 That's cool, and in systems that have an approximate analogue to dependent typing, you get at least some of that power. 05:24:12 >_> why are we talking about dependent typing now. 05:24:16 It should be that either every error is a type error, or none is. 05:24:33 wat. 05:24:33 Or so it seems to me at the moment. 05:24:50 there should just be segfaults. 05:24:53 only segfaults 05:25:01 there should be no errors 05:25:03 absolutely none! 05:25:10 if you run it it runs no matter what you put in 05:25:12 Heh. 05:25:12 (iota anyone?) 05:25:15 I'm not an idealist. 05:25:58 Anyway, I'll look into getting Haskell to run on Bluehost. 05:27:33 :t read 05:27:34 forall a. (Read a) => String -> a 05:27:39 > read "3" :: Int 05:27:40 3 05:29:36 parser is finsihed. time to move on the interpreter. 05:37:34 ...the parser is so ugly though. Really I should have tokenized the input first. 05:41:15 -!- augur has quit (Remote host closed the connection). 05:41:52 -!- augur has joined. 05:46:25 -!- augur has quit (Ping timeout: 252 seconds). 05:50:17 -!- Guest21058 has joined. 05:51:30 -!- Guest21058 has quit (Quit: Ex-Chat). 05:51:48 -!- Guest21058 has joined. 05:53:17 -!- Guest21058 has quit (Client Quit). 05:57:14 I think it is entirely stupid that Python has no sensible way to hide methods from an interface. 05:58:24 I understand the designer wants you to be able to poke around in the internals, but at least a way to hide things from documentation would be nice. 06:13:44 monqy: help how do I use lambdabot to send messages to people. 06:14:29 @help tell 06:14:29 tell . When shows activity, tell them . 06:21:16 @src words 06:21:16 words s = case dropWhile isSpace s of 06:21:16 "" -> [] 06:21:16 s' -> w : words s'' where (w, s'') = break isSpace s' 06:21:24 @tell CakeProphet You tell me? 06:21:24 Consider it noted. 06:22:08 :t break 06:22:08 CakeProphet: You have 2 new messages. '/msg lambdabot @messages' to read them. 06:22:09 forall a. (a -> Bool) -> [a] -> ([a], [a]) 06:22:20 CakeProphet probabley telled privately......... 06:22:25 was it a secret 06:22:37 uh, no, but no one elses business :P 06:39:08 @messages 06:39:09 quicksilver said 1y 2m 18d 19h 54m 29s ago: you use @tell 06:39:09 pikhq_ said 17m 44s ago: You tell me? 06:39:35 lol, I apparently asked this question a year ago. 06:39:42 :D 06:39:48 Beautiful. 06:42:31 -!- azaq231 has quit (Quit: Leaving.). 06:50:55 -!- GreaseMonkey has quit (Quit: The Other Game). 06:55:35 `addquote monqy: help how do I use lambdabot to send messages to people. [...around half an hour later...] @messages quicksilver said 1y 2m 18d 19h 54m 29s ago: you use @tell 06:55:37 629) monqy: help how do I use lambdabot to send messages to people. [...around half an hour later...] @messages quicksilver said 1y 2m 18d 19h 54m 29s ago: you use @tell 06:55:46 truly awesome 06:58:18 the unnecessary accuracy on the date just makes it better 07:00:35 interesting that lambdabot doesn't remind of messages if you miss the first "you have messages" message 07:00:41 until another message is sent 07:02:55 -!- ais523 has quit (Remote host closed the connection). 07:09:36 mmm hookah. 07:10:35 all smoke should taste like gingerbread. 07:10:50 even when it's smoke from a housefire. 07:32:54 * evincar is jealous. 07:33:16 Although the last (and first) time I smoked a hookah was a bit extreme. 07:39:01 extreme? 07:39:11 * CakeProphet smokes three bowls in a row, sometimes. 07:39:19 perhaps I just have ridiculous tolerance 07:39:57 okay so now my parser REALLY works, after some thorough debugging. I now know the proper way to write a really shitty parser, and will avoid doing so in the future 07:40:08 by properly tokenizing the input before I begin constructing the AST. 07:40:25 how about using a parser combinator library 07:40:34 monqy: that too 07:41:15 but I would also like to be able to construct an elegant parser from scratch. 07:41:59 hint it won't be elegant give up now 07:42:10 before its 07:42:11 too late 07:42:15 I'm doing an experiment with an ugly parser at the moment. 07:42:21 it's already too late. This is not my elegant parser. 07:42:35 This is my first attempt to write a non-trivial parser, really. 07:42:49 I thought "what's the most painful way to model parsing?" 07:42:51 non-trivial? 07:42:58 And to myself replied "iterators!" 07:43:04 evincar: lulz 07:43:08 if it's nontrivial you shouldn't be writing it by hand 07:43:14 evincar: eh? c++? 07:43:17 It's simple. 07:43:20 Yeah, C++. 07:44:01 monqy: nonsense. 07:44:22 one time I had to write a parser in c++. it was LL(1) and there were helpers and everything for doing tokenizeng and building the AST though so whatever 07:44:23 do most programming languages use parsing libraries for their parsers? 07:44:37 "most programming languages"? 07:44:41 do you mean most implementations? 07:44:47 and how should I know 07:44:50 monqy: what do you think? 07:44:53 though probably most of them use parser generators 07:45:00 do I really need to be explicit at every moment in every conversation? 07:45:02 yacc/bison and its ilk 07:45:04 yes 07:45:06 you do 07:45:09 I can't just say "programming language" and get away with what I really mean? 07:45:15 no 07:45:18 I mean yes 07:45:19 you can't 07:45:23 also no you can't 07:46:26 or wait was the lexer by hand too 07:46:29 I think it may have been 07:46:37 my favorite question to receive from someone who knows nothing about programming: "why are there so many programming languages? why not just have one." 07:46:48 do people really ask that? 07:46:49 really? 07:46:53 a few times 07:47:08 Paul Graham says the same thing occasionally. 07:47:09 why are there so many natural languages why not just have one 07:47:15 Because he has such a hard-on for Lisp. 07:47:46 does he really say that in the same sense? 07:47:49 if so: wow 07:48:05 also is there any kind of lexer that adds structure to the output tokens? 07:48:05 where the same sense is "i am genuinely puzzled by the existence of multiple programming languages" 07:48:11 like for brackets and such? 07:48:32 mmh? 07:48:50 monqy: No, obviously not. He's just saying "Why doesn't everyone just use Lisp?" 07:48:54 seems like you could go ahead and get that step out of the way and simplify the parser 07:49:00 Although he goes on to give very good reasons why not. 07:49:06 evincar: yes that is a different sense 07:49:10 evincar: a very different sense 07:49:19 evincar: it's not even saying the same thing at all 07:49:33 CakeProphet: what step 07:49:46 Superficially it is. "Why so many? Why not just (this) one?" 07:49:58 That was the joke. 07:49:59 evincar: if superficially means using the same words 07:50:00 :P 07:50:02 it was a bad joke 07:50:13 Fine, I'll keep working on my bad parser. 07:50:15 monqy: the step of structuring the program by brackets, string literals, and so forth. 07:50:21 I am why we can't have nice things. 07:50:23 without fully generating the AST 07:50:56 CakeProphet: You want a concrete syntax tree? 07:51:42 That is, reflecting only the syntactic structure of the program, with any static meaning attached. 07:52:04 Unless you mean not that. 07:52:34 I'm not really sure if it would help, but I think it would be easier if you went ahead and generated a semi-abstract syntax tree of some sort. 07:52:46 what?? 07:52:47 only structuring by brackets 07:53:44 in the lexer step, so that when you parse the full AST you already an idea of where things stop and end. 07:53:51 *already have 07:53:59 that would complicate the lexer a lot, unless it's already really complicated 07:54:05 So just a tree of tokens. 07:54:10 yes. 07:54:13 Nah, it wouldn't be terribly complicated. 07:54:24 See a "(", go down a level. 07:54:25 and I'm not entirely sure what you mean by structing by brackets 07:54:26 monqy: but it would simplify the parser to a degree. 07:54:41 See a "]" that doesn't match the "(" above you, error. 07:54:52 It automagically takes care of nesting. 07:54:55 monqy: ....how does that not make sense. (stuff (goes here) ) is your input string 07:55:04 bam, now it is the token list ("stuff" ("goes" "here")) 07:55:12 *token tree 07:56:14 I wasn't sure what you meant by brackets 07:56:29 so now when the parser scans the tokens, it doesn't have to deal with parentheses. 07:56:30 still not 07:56:59 monqy: [()[\]{}<>] 07:57:08 that isn't language-universal i hope you know 07:57:13 yes I know. 07:57:15 I am explaining 07:57:16 what I mean 07:57:17 by brackets. 07:57:21 anyway that's not the lexer's job; add another step if you want it 07:57:22 for fucks sake. 07:58:41 also 07:59:18 while the added complexity to the parser of having to traverse the tree is pretty minimal, you have considered it, right 07:59:21 ? 07:59:26 yes 07:59:37 anyway just use a parser combinator library 08:00:11 and I believe it would be simpler to traverse the tree of tokens that it would be to construct it from a flat list of tokens, while also worrying about everything else that needs to be parsed correctly. 08:00:19 s/that/than/ 08:00:28 in the same pass. 08:01:19 but when you aren't writing it all by hand, you ~don't have to worry~ 08:01:25 yes I know. 08:01:35 so what's your point 08:02:23 sometimes it's just nice to have experience with something. Also, there are situations where you might not have such a library or it would be beneficial to not have an extra dependency. 08:02:33 ????? 08:02:43 oh 08:02:50 the virtues of hand-writing parsers? 08:03:03 Consider it a learning experience. 08:03:05 in such a case I'd hand write a parser combinator library, or at least a parser generator 08:03:10 yes, I like to learn things. 08:03:18 Consider it a research experience. 08:03:39 I've had all the parser-handwriting experience I feel I need 08:04:25 perhaps I need more experience with "using appropriate libraries" 08:04:29 this is a skill I am lacking in. :P 08:05:23 also what if I ever want to write a Perl implementation? 08:05:36 what's so special about perl 08:06:04 I believe the parser must be Turing complete in order to be correct. 08:06:31 or at least perl's (the only implementation I know of) is. 08:06:31 ??? 08:06:54 ???? 08:06:55 what do you mean by the parser being turing complee 08:08:16 I don't believe it can be statically parsed 08:09:03 http://www.perlmonks.org/?node_id=663393 08:09:36 -!- Patashu has quit (Ping timeout: 264 seconds). 08:10:53 this is probably why most Perl syntax highlighters are horrible. 08:12:39 oh I've just never heard "turing complete" used in that sense 08:12:45 and: http://www.jeffreykegler.com/Home/perl-and-undecidability 08:12:47 I don't think it's the right term. 08:12:51 probably not. 08:12:52 yeah that's probably why 08:14:29 parsing Perl can require running Perl. 08:16:36 I recall reading that the perl parser uses a number of hueristics to basically guess what the source code means. 08:17:32 Those are largely unrelated. 08:17:39 I mean, they both take place in the parser. 08:18:06 right, what I mean is that a parser library probably is not going to allow me to do that. 08:18:12 But one is related to the fact that later code is subject to interpretation in the context of earlier code. 08:18:21 While the other is just DWIM. 08:18:34 Assuming an otherwise ambiguous situation. 08:18:58 Which isn't so much "heuristics" as it is just the Principle of Least Surprise. 08:19:35 heuristics of least surprise 08:19:49 http://perl5.git.perl.org/perl.git/tree 08:19:52 weeee time to browse perl source. 08:20:37 ..and then immediately run away in fear. 08:21:05 what did you find 08:21:50 large numbers of files and directories that I cannot navigate very well. 08:22:28 perl.c is a good start. 08:23:01 4918 lines eh 08:23:56 PerlInterpreter *my_perl; 08:24:01 do you see that? it's mine. :3 08:24:25 this is a mess 08:25:13 yeah I have no idea where to actually find the parser. 08:25:42 oh hey parser.h 08:25:56 but where is parser.c... 08:26:21 what all #includes parser.h 08:27:07 /ceci n'est pas une parser 08:27:22 oops 08:27:26 //ceci n'est pas une parser 08:27:35 U8expect;/* how to interpret ambiguous tokens */ 08:27:43 this looks like a fun struct field. 08:27:53 that's U8 expect; 08:28:02 I wonder what they were thinking when they wrote perl 08:28:04 I wonder 08:28:55 NEXTTOKE nexttoke[5]; /* value of next token, if any */ 08:29:02 this is obviously a weed reference 08:31:22 obviously.. 08:38:04 monqy: I bet they were thinking "man I want a practical extraction and report language" 08:38:31 okay so perly.c is where the actual parser is. 08:38:33 toke.c is the lexer. 08:38:36 perly.c 08:38:44 vs normal perl.c 08:38:56 also: because it has to be a godawful mess to be practical 08:39:07 http://perl5.git.perl.org/perl.git/blob_plain/HEAD:/perly.y 08:39:10 perl grammar 08:39:22 %token LOOPEX DOTDOT YADAYADA 08:39:25 yadayada 08:39:33 %token COLONATTR 08:39:38 colon attribute? 08:39:54 uh my guess is :: 08:40:04 yadayada? 08:40:11 or colonattr 08:40:19 i like this names 08:40:23 dordor, bitorop 08:40:40 dordor is defined or. 08:40:45 // 08:41:13 bitorop is | 08:41:38 anyway yadayada is best 08:42:19 I believe yada yada is a no op 08:42:37 poor yadayada :( 08:43:07 !perl sub test {...} 08:43:09 syntax error at /tmp/input.19173 line 1, near "{..." 08:43:19 THE PERL DOCS LIE. 08:43:47 were you trying to see how that would lex? 08:44:05 no just seeing if it worked. 08:44:11 !perl ...; 08:44:12 syntax error at /tmp/input.19287 line 1, near "..." 08:44:19 perldocs = lies 08:44:45 presumably the ellipsis is metasyntax not literal perl??? 08:44:57 or are you joke 08:45:25 no it says in perldoc that ... can stand-in for a statement and does nothing. 08:45:31 oh 08:45:51 maybe they are just lying. 08:46:08 if lying is joking then I guess perldoc is pretty good joke 08:46:32 good joke regardless. because perl. ha ha. 08:53:06 monqy: you laugh, but perl is the cutting edge in perl-oriented design. 08:53:26 laughing 08:53:45 crying 08:54:32 http://perl5.git.perl.org/perl.git/blob_plain/HEAD:/regcomp.c 08:54:34 regex compiler 08:55:18 I32 naughty; /* How bad is this pattern? */ 08:56:02 i like the parts where it increments naughty 08:56:13 what is naughty's purpose 08:58:03 in this file it just sets a naughty flag if it goes over 10 08:58:14 and says "probably an expensive pattern" 08:58:45 naughty 08:59:03 if (!(prog->intflags & PREGf_NAUGHTY)/* XXXX If strpos moved? */ 08:59:06 in regexec.c 08:59:52 -!- Phantom_Hoover has joined. 09:04:44 http://perl5.git.perl.org/perl.git/blob_plain/HEAD:/Configure 09:04:46 wow, just wow. 09:05:38 that is 23585 lines of sh 09:06:24 "ARGGGHHHH!!!!!" - that file 09:07:55 -!- FireFly has joined. 09:08:08 if grep blurfldyick grimble >/dev/null 2>&1 ; then 09:08:09 also me on that file 09:08:10 ...... 09:08:21 blurfldyick 09:08:24 grimble 09:08:29 if grep blurfldyick grimble >/dev/null 2>&1 ; then contains=contains 09:08:37 what 09:08:38 i 09:08:43 :( 09:09:01 elif grep grimblepritz grimble >/dev/null 2>&1 ; then contains=grep 09:09:09 is this for real 09:09:11 yes 09:09:13 CakeProphet, configures are automatically generated, aren't they? 09:09:18 yes. 09:09:50 grimble 09:09:57 monqy, that's a test of grep's behaviour, so they presumably just used the first word they could think of. 09:10:24 they are bad at good words 09:10:48 Perhaps you should suggest a patch. 09:11:05 bug: grimble? really? 09:14:32 Dear Perl user, system administrator or package 09:14:33 maintainer, the Perl community sends greetings to 09:14:34 you. Do you (emblematical) greet back [Y/n]? n 09:14:52 # This question was auctioned at YAPC::Europe-2007 in Vienna 09:14:53 # I never promised you could answer it. I only auctioned the question. 09:21:23 Yet another thing that's surprisingly difficult to do right in C++: making an iterator to adapt an input iterator to a bidirectional one. 09:21:35 (To allow backtracking.) 09:21:46 I don't know why I'm putting myself through this pain. 09:21:59 Configure is actually generating a config.sh 09:22:12 and Configure is generated from something called metaconfig. 09:32:30 Yo dawg I heard you like configuring... 09:35:29 Joined #freenode for the hell of it, and somebody is trying to convince them that #archlinux-ru shouldn't be allowed to have a message saying they switched network. 09:36:11 exciting 09:43:38 Alright, I've finally written enough boilerplate crap to safely write the useful(?) bit of this monstrosity. 09:44:18 This is what I get for wanting lazy parsing in a language that is really, really not designed for it. 09:45:32 why would you want anything in c++, except maybe a good language 09:47:06 I don't knooow. 09:47:26 It's to kill time. 09:47:32 monqy, have you not heard of elliott's ventures into C++. 09:47:38 They are hilarious. 09:48:01 I;ve heard of c++ sudoku, but I forget quite what it was 09:48:04 nothing else I can remember 09:48:40 Phantom_Hoover: This sounds entertaining. 09:48:58 He was programming in the template system IIRC, although I wasn't really paying attention at the time. 09:54:42 -!- GuestIceKovu has joined. 09:55:56 -!- Slereah has quit (Ping timeout: 258 seconds). 10:27:53 -!- Vorpal has joined. 10:38:45 -!- Vorpal has quit (Ping timeout: 260 seconds). 10:38:52 -!- Vorpal_ has joined. 11:07:08 Well, after all that, parsing with iterators. 11:07:26 Reduced the main method to: print(to_tokens(to_utf32(to_buffered(to_raw(stream))))); 11:07:48 Could be worse. 11:08:18 And now, sleep. 11:08:21 -!- evincar has quit (Quit: leaving). 11:12:31 -!- monqy has quit (Quit: hello). 11:14:19 -!- copumpkin has quit (Ping timeout: 260 seconds). 11:14:45 -!- copumpkin has joined. 11:26:41 -!- Patashu has joined. 11:56:20 -!- oerjan has joined. 12:25:18 http://28.media.tumblr.com/tumblr_lgt3723bWm1qgcsjxo1_500.jpg 12:25:21 whaaaaaaaaaat 12:26:22 I really, really hope that was deliberate. 12:27:53 I don't get it 12:28:05 * oerjan has no idea either 12:28:22 is it one those darn dang cultural references 12:29:17 *of 12:41:34 Patashu, the guys in the car look an awful lot like SBaHJ. 12:42:36 Oh, that's the joke 12:43:19 so, yes. 13:30:44 -!- MSleep has changed nick to MDude. 14:04:09 -!- MDude has quit (Read error: Connection reset by peer). 14:30:32 -!- sliddy has joined. 14:38:01 -!- augur has joined. 14:46:13 -!- oerjan has quit (Quit: leaving). 16:00:59 -!- derrik has joined. 16:32:24 -!- Patashu has quit (Quit: MSN: Patashu@hotmail.com , Gmail: Patashu0@gmail.com , AIM: Patashu0 , YIM: patashu2 .). 16:36:52 -!- derrik has left. 16:45:28 -!- zzo38 has joined. 17:09:44 http://en.wikipedia.org/wiki/RP_FLIP 17:09:49 Oh my god I want one. 17:24:53 -!- wetneb has joined. 17:52:36 Phantom_Hoover: There only is one :P 17:52:50 Gregor, WHO CARES 18:03:38 -!- quintopia has quit (Ping timeout: 264 seconds). 18:05:47 -!- Phantom_Hoover has quit (Ping timeout: 245 seconds). 18:13:20 hi friendships. 18:14:06 Well, that's utterly surprising. 18:14:16 Fun fact: Bochs does real mode faster than qemu. 18:14:19 -!- quintopia has joined. 18:14:38 that's because Boch knows how to keep it real. 18:14:43 +s 18:18:00 !perl sub min($$){ my ($a,$b) = @_; [$a => $b]-> [$b <= $a] } print min(4,10) 18:18:00 4 18:18:22 !perl sub min($$){my($a,$b)=@_;[$a => $b]->[$b <= $a]} print min(4,10) 18:18:23 4 18:29:32 -!- sliddy has quit (Ping timeout: 245 seconds). 18:31:57 !perl sub min($$){my($a,$b)=@_ if @_;[$a => $b]->[$b <= $a]} print sort min, 5,4,3,2,1 18:31:57 12345min 18:32:06 lol 18:32:17 !perl sub min($$){my($a,$b)=@_ if @_;[$a => $b]->[$b <= $a]} print sort {min} 5,4,3,2,1 18:32:17 Not enough arguments for main::min at /tmp/input.28958 line 1, near "min}" 18:32:23 !perl sub min(;$$){my($a,$b)=@_ if @_;[$a => $b]->[$b <= $a]} print sort {min} 5,4,3,2,1 18:32:23 Sort subroutine didn't return a numeric value at /tmp/input.29016 line 1. 18:32:49 hmmm, I thought $a and $b were special dynamically scoped variables. Ah, I guess not when I redeclare them with my 18:33:54 !perl print sort d,v,c,s 18:33:54 No comma allowed after subroutine name at /tmp/input.29149 line 1. 18:34:13 !perl print sort d,1,2,3 18:34:14 No comma allowed after subroutine name at /tmp/input.29207 line 1. 18:34:16 wat 18:34:19 why did it work with min 18:35:40 son I am disappoint. 18:38:42 -!- Phantom_Hoover has joined. 18:38:47 -!- Phantom_Hoover has quit (Changing host). 18:38:47 -!- Phantom_Hoover has joined. 18:43:13 Should I write proposal of more-notation of Haskell in any wiki? 18:47:23 -!- elliott has joined. 18:48:34 -!- quintopia has quit (Ping timeout: 260 seconds). 18:48:46 zzo38: if you want, but I don't think people will buy it. 18:50:56 I could see it being somewhat useful if it allowed you to more a function definition as well as a data type definition. 18:51:22 allowing you to add more cases to a function to accomodate the new constructors. 18:51:51 -!- quintopia has joined. 18:51:51 -!- quintopia has quit (Changing host). 18:51:51 -!- quintopia has joined. 18:52:07 but that's not guaranteed to be an option in every situation like that. 18:53:02 f x = f' (g x) where f'(C1 a) = ...; f'(C2 b) = ... 18:53:20 more wouldn't allow you to add new patterns to f' because it's not in scope outside of f 18:54:03 It is my idea that you would be able to use more-notation with many things, including case-block as well as data types constructors, these two things go together. 18:54:28 So you would add patterns by using more-notation with case-blocks. 18:54:55 what about in my example. how would it work there? 18:55:11 how do you specify which case expression you are modifying? 18:55:15 -!- Taneb|Kindle has joined. 18:56:23 I have just made a discovery that could revolutionize the face of computing! 18:56:28 Windows teands to crash 18:56:29 also I think you can do something similar to this with type families 18:56:39 Taneb|Kindle: here is your Nobel prize. 18:56:40 You would have to change it to a case-block and then it would work. You specify which case expression in a way such as this: f x = case x of { C1 a -> ...; C2 b -> ...; more Cases; } 18:57:19 Cases = C3 c -> c + 1; Cases = _ -> 42; 18:57:34 -!- pikhq has joined. 18:58:05 -!- pikhq_ has quit (Ping timeout: 260 seconds). 18:58:13 Basically, my laptop is temprarily unusable 18:59:23 CakeProphet: Did you notice anything else wrong? If so, I can try to describe those things too. 19:01:01 So, what's up? 19:01:04 no, but I think type families is possibly a better solution to the kind of data type extension you want 19:03:13 Well, for one thing more-notation can be used in other places too, including: field lists (both for defining and for using), lists of values, do-blocks, case-blocks, data constructors, and it does such things as reordering and removing duplicates depending on how it is used. In addition, more-notation can take parameters. 19:04:27 I think the world needs a brainfuck-I hate your bf derivative I really do-MIBBLLII polyglot 19:05:20 Possibly with perl in there too 19:06:46 All the polyglots have perl in them 19:06:50 All of them 19:07:28 Somebody managed to write a Piet-Piet polyglot 19:08:19 Perl is easy to polyglot 19:08:38 In Piet, it printed "Piet", and in Piet it printed "Hello, World!" I think 19:09:26 wat 19:09:26 elliott: You have 3 new messages. '/msg lambdabot @messages' to read them. 19:09:54 Different Codel size 19:10:34 It is near the bottom of the example Piet programs on dangermouse.net 19:11:10 between pod, __END__ markers, heredocs, arbitrary quote delimiters, and regular comments 19:11:20 there are a lot of ways to ignore text in a perl program. 19:13:04 -!- pikhq has quit (Ping timeout: 246 seconds). 19:13:09 -!- pikhq has joined. 19:13:30 I think perl is in many ways more esoteric than, eg, brainfuck 19:15:09 Brainfuck isn't really that esoteric,come to think of it 19:15:30 You can tell what it does just by looking at it 19:16:06 That is morethan ca be said for languages such as Haskell or XSLT 19:16:43 Unlss you are really good 19:19:45 More people have heard of brainfuck than Mondrian or Visual J# 19:20:06 I can tell what Haskell code does just by looking at it. 19:20:10 That's called knowing Haskell. :p 19:20:44 Haskell and XSLT may have been bad examples 19:21:23 perl and... no, stick with XSLT 19:21:59 At least for programs XSLT isn' designed for 19:24:09 Haskexesseltee 19:25:42 Has anyone ever used Visual J#? 19:27:07 -!- oerjan has joined. 19:27:22 It seems to be everything this channe is against 19:27:49 Except it is neither Python nor a brainfuc derivative 19:28:09 this channel is against python? 19:28:26 IOnly alittle 19:28:32 -!- derrik has joined. 19:28:43 We need more cpressey and olsner so we can get the anti-Python flames brighter. 19:28:52 Actually we need more cpressey full stop so we can have more cpressey. 19:29:06 a cpressing issue 19:29:08 It is a hybrid of Java and C++ 19:29:29 J# is dead. 19:29:31 ...Microsft style 19:29:35 And also, that's a poor description of it. 19:29:37 I can tell what Perl code does just by looking at it. 19:29:40 It was basically just Java. 19:30:01 CakeProphet: perl -wlne'END{print$n}eof&&$n++;/([^<]+)/i&&$n--' * 19:30:01 <Taneb|Kindle> With .NET bindings 19:30:28 <oerjan> CakeProphet: must be all your weed use 19:31:07 <elliott> Gregor: 19:31:11 <elliott> -wlne' The world is near its end. 19:31:11 <elliott> END{print$n} At the end the sum of all our sins and virtues will be reckoned and the judgement revealed. 19:31:11 <elliott> eof&&$n++; As the evil of mankind ends, perhaps the end itself is a positive thing. 19:31:11 <elliott> i And insensitive to the suffering of others. 19:31:12 <elliott> &&$n-- All this is for nought, and only hastens our demise. 19:31:14 <elliott> ' * For in the end, we are but stardust. 19:31:16 <elliott> hth 19:31:25 * oerjan bows 19:31:31 <oerjan> and i did it _without_ weed, even 19:32:09 <CakeProphet> ... 19:32:32 <CakeProphet> why would you even use that program... 19:32:46 <Taneb|Kindle> Does that program actually do anything? 19:32:48 <CakeProphet> yes. 19:33:08 <Taneb|Kindle> Good to know 19:33:14 <oerjan> it counts certain lines 19:33:24 <CakeProphet> it anti-counts them... 19:33:30 <CakeProphet> and then counts eofs 19:33:46 <oerjan> hm good point 19:34:09 <CakeProphet> which is why I am wondering 19:34:11 <CakeProphet> why you would ever do that. 19:34:32 <Taneb|Kindle> To confuse Taneb 19:35:47 <CakeProphet> Taneb|Kindle: read && as if-then, if something looks like it should have an argument but doesn't it's probably working on $_, which with -n $_ = current line 19:35:59 <CakeProphet> END{...} does stuff at the end of execution. QED 19:36:03 <Taneb|Kindle> How dosone anti-count? Is that like counting backwards? 19:36:12 <CakeProphet> by decrementing instead of incrementing. 19:36:22 <CakeProphet> it's a ... term I made up. 19:36:28 <CakeProphet> it is not an actual thing. 19:36:34 <Gregor> I prefer the interpretation on the wiki. 19:38:45 <elliott> It's counting lines that aren't <title> lines, I think :P 19:38:54 <elliott> Plus one, maybe. 19:38:55 <elliott> Hmm, wait. 19:38:58 <elliott> <Gregor> CakeProphet: perl -wlne'END{print$n}eof&&$n++;/<title>([^<]+)/i&&$n--' * 19:39:03 <elliott> It only ever increments on EOF. 19:39:07 <CakeProphet> right 19:39:11 <Taneb|Kindle> Anticounting 19:39:13 <CakeProphet> and decrements when there IS a title loine 19:39:14 <CakeProphet> *line 19:39:16 <CakeProphet> a non-empty one 19:39:19 <elliott> http://linuxgazette.net/84/okopnik.html 19:39:27 <elliott> This explains it, apparently. 19:39:31 <elliott> In an irritating Perlish manner. 19:40:32 <CakeProphet> - "Heavens, Woomert!" Frink's shock was evident in his features. "You must be as brave as a lion, to face something like that." 19:40:58 <CakeProphet> by the way all of this actually happened. 19:41:03 <CakeProphet> non-fiction account. 19:41:06 <Taneb|Kindle> In brainfuck it would make the tape -1, 2 19:41:53 <Taneb|Kindle> Assuming the tape is left unbounded 19:48:37 -!- Taneb|Kindle has quit (Ping timeout: 252 seconds). 19:52:33 <CakeProphet> Gregor: let me know when you find some Perl I can't read. 19:52:37 <CakeProphet> I WILL ACCEPT THE CHALLENGE. 19:53:36 <CakeProphet> \N Any character but \n (experimental). 19:53:44 <CakeProphet> I don't really understand what is so experimental about \N 19:55:13 <Phantom_Hoover> We just don't know if it matches \n sometimes. 20:00:14 <CakeProphet> !perl "this is a test" =~ /.*?(?{pos})test/; print "this is a test" =~ /.{$^R}test/ 20:00:15 <EgoBot> 1 20:00:21 <CakeProphet> weeeeee 20:01:03 -!- ais523 has joined. 20:01:29 <elliott> How Much of R is Written in R... (r-bloggers.com) 20:01:31 <elliott> cpressey...... 20:12:30 <Phantom_Hoover> Where hast thou gone, cpressey? 20:15:26 <CakeProphet> !perl @matches = "test" =~ /test/; print @matches 20:15:27 <EgoBot> 1 20:15:33 <CakeProphet> !perl @matches = "(test)" =~ /test/; print @matches 20:15:33 <EgoBot> 1 20:15:44 <CakeProphet> !perl @matches = "test" =~ /(test)/; print @matches 20:15:45 <EgoBot> test 20:16:44 <CakeProphet> okay so one thing that's pretty stupid about 20:16:56 <CakeProphet> perl is that [] and {} are both considered true 20:17:50 <elliott> Phantom_Hoover: He quit us. :p 20:18:37 <ais523> CakeProphet: that's not stupid, that's pretty useufl 20:18:38 <Phantom_Hoover> ;_; 20:18:39 <ais523> *useful 20:18:47 <ais523> I use that all the time to see if a reference variable has been initialised or not 20:19:01 <ais523> do you really think the truth value of a pointer should depend on what it points to? 20:19:06 <CakeProphet> ais523: it's inconsistent with () being false. 20:19:08 <CakeProphet> though. 20:19:14 <ais523> no it isn't 20:19:29 <ais523> () is a value, [] and {} are references 20:19:39 <CakeProphet> yes I understand. 20:19:44 <ais523> you might as well say "it's inconsistent with sub {} being true" 20:20:14 <CakeProphet> that is different. usually when I am dealing with lists and hashes I want to quickly test the empty case as being distinct from every other case 20:20:17 <ais523> the false scalar values are undef, 0 and "" 20:20:19 <oerjan> :t \sub -> sub {} 20:20:19 <lambdabot> Empty record update 20:20:21 <ais523> the false list value is () 20:20:26 <ais523> [] and {} are scalars, not lists 20:20:30 <CakeProphet> with arrayrefs and hashrefs this is not the case. 20:20:34 <CakeProphet> ais523: you don't need to explain this to me. 20:20:36 <ais523> and those are the only two contexts in Perl but void, which has no values at all 20:20:57 <ais523> why would the empty case be distinct, particularly wrt a hash? 20:21:08 <ais523> for an array, I can understand 20:21:22 <ais523> but why should a hash be different just because it has no entries? unless you're using it as a replacement for a set or something? 20:21:29 <CakeProphet> because it is. I am mostly concerned with the arrayref case anyways, but it makes sense with hashes too though I cannot provide an example. 20:21:57 <ais523> besides, if you /dereference/ it, you get the truth value you want 20:22:03 <CakeProphet> yes I know. 20:22:11 <ais523> print "the array contains elements" if @$array; 20:22:32 <ais523> why would you want $array to be false if it was a reference to an empty array, when saying what you actually mean is so simple? 20:22:45 <CakeProphet> this is what I will have to do. I am saying I should not have to do this extra step. No, I do not care how pointers work because Perl is not a low-level language. 20:23:13 -!- monqy has joined. 20:23:14 <elliott> then why are you using references? 20:23:20 <ais523> you should care how references work even in high-level languages 20:23:27 <CakeProphet> elliott: because you have to use them in Perl to get multi-dimensional structures. 20:23:28 <ais523> pointers are a low-level concept, but references are a high-level concept 20:23:33 <ais523> even, say, Idealized Algol has references 20:23:39 <CakeProphet> yes, and references to null things in Perl should be false. :P 20:23:55 <elliott> ais523: I would question how high-level references actually are, but they're certainly higher-level than pointers 20:23:57 <CakeProphet> because it is consistent with the logic you use with non-referenced things. 20:24:00 <ais523> CakeProphet: is a reference to itself true? 20:24:14 <CakeProphet> uh, show me how to do that in Perl. 20:24:19 <ais523> elliott: in a high-level imperative language, they should definitely exist 20:24:26 <ais523> in a functional language, you can get by without them 20:24:37 <elliott> ais523: imperative, definitely 20:24:37 <ais523> (because then you can conflate a reference to a value with the value itself) 20:24:56 <elliott> It isn't really a conflation, since a reference becomes an implementation detail 20:25:03 <ais523> CakeProphet: I can't think of a method offhand (it'd probably involve XS), but it's definitely possible 20:25:17 -!- coppro_ has changed nick to coppro. 20:25:20 <oerjan> :t when 20:25:20 <lambdabot> forall (m :: * -> *). (Monad m) => Bool -> m () -> m () 20:25:20 <ais523> wait, no 20:25:24 <ais523> my $a; $a = \$a 20:25:33 <CakeProphet> ais523: if the reference is not pointing to an empty list then it should be true. 20:25:33 <ais523> that's surprisingly simple and straightforward 20:25:46 <ais523> CakeProphet: so if it's pointing to a reference to an empty list, it should be true 20:25:52 <ais523> even though the reference to an empty list is itself false? 20:25:54 <elliott> I like how CakeProphet's argument is "it should be true because I keep saying it should be" 20:26:06 <elliott> oerjan: are you WRITING HASKELA 20:26:26 <ais523> elliott: I'm trying to convince CakeProphet that his point of view is internally inconsistent and makes no sense 20:26:44 <oerjan> what is haskela 20:26:46 <CakeProphet> yes my argument is purely based on the way I think it should work. I think it simplifies the most common situation. When do you need an empty reference to be true? 20:27:03 <elliott> oerjan: hakskel 20:27:06 <ais523> CakeProphet: OK, what about this one: you have a scalar that might be undefined, or contain an object 20:27:14 <monqy> references are not boolesn??? help 20:27:16 <oerjan> koay 20:27:19 <monqy> what shappen 20:27:32 <ais523> it'd obviously be useful if undefined was false, and object was true, so you wouldn't have to specifically add "defined" there 20:28:01 <CakeProphet> but if EVERY reference is true 20:28:06 <ais523> now, why should that depend on the implementation details of the object? (say the object happens to be a blessed empty list; that's something that your code shouldn't care about) 20:28:07 <CakeProphet> when are you ever going to use a conditional with a reference? 20:28:15 <ais523> CakeProphet: when it has a chance of being undefined, of course 20:28:18 <CakeProphet> what would be the purpose of this hypothetical conditional statement we're talking about. 20:28:24 <CakeProphet> ah. 20:28:24 <ais523> reference-or-undef is a very very common thing to store in a variable 20:29:13 <ais523> I must have done conditions on reference-or-undef well over 100 times in TAEB 20:29:31 <oerjan> :t when <$> ?b 20:29:31 <lambdabot> forall (m :: * -> *) (f :: * -> *). (Monad m, ?b::f Bool, Functor f) => f (m () -> m ()) 20:29:40 <zzo38> Is this good sofar? http://www.haskell.org/haskellwiki/User:Zzo38/Proposal_for_more-notation 20:29:51 <CakeProphet> ais523: okay fine. 20:30:24 <ais523> I even did /this/: https://gitorious.org/taeb/ais523/commit/fea807c048e759520c8c617775f7f07e718c0892 20:30:38 <CakeProphet> ais523: but still all of that could remain unchanged, and [] and {} could still be false. 20:30:41 <ais523> because someone had accidentally made the cast-to-boolean of most of the objects in TAEB very slow 20:30:47 <ais523> and I had to speed it up again by returning constant 1 20:31:07 <elliott> CakeProphet: except that then, you can't test for undef or reference 20:31:11 <ais523> (they'd defined stringification for debug purposes, and accidentally stated "boolean value depends on the stringification", so it was stringifying objects every time to see if they were "") 20:31:17 <elliott> because it tests for undef or reference to something that isn't empty, for some reason 20:31:24 <ais523> elliott: you can, using an explicit "defined", but it's messy 20:31:28 <elliott> CakeProphet: thank god it saved one character in your conditionals, eh? 20:31:38 <elliott> as opposed to the "defined " -- eight -- for the more common case 20:31:50 <CakeProphet> @{} is three characters. :P THREE WHOLE CHARACTERS. 20:31:50 <lambdabot> Maybe you meant: . ? @ bf do ft id pl rc v wn 20:31:53 <ais523> I'd rather save 8 in the common case than save 1 in a somewhat rarer case 20:32:06 <ais523> CakeProphet: and "defined " is EIGHT WHOLE CHARACTERS 20:32:07 <monqy> ?? 20:32:08 <elliott> doesn't @$foo work 20:32:21 <ais523> elliott: yes, if $foo is a variable 20:32:24 <CakeProphet> ais523: yeah but that's not the case I'm working with. :P 20:32:30 <ais523> you need the {} if you have a more complex expression there 20:32:52 <CakeProphet> I suppose I could have my code replace the [] case with undef 20:32:56 <ais523> CakeProphet: why are you habitually storing 0-length arrays/hashes, and caring about them as a special case? 20:33:07 <ais523> I was going to say, perhaps if it really is a special case, undef would make a better special case 20:33:08 <Sgeo> zzo38, what does it do, exactly? 20:33:08 <CakeProphet> ais523: because they contain regex matches. 20:33:18 <CakeProphet> [] == didn't match 20:33:18 <elliott> <oerjan> :t when <$> ?b 20:33:18 <elliott> <lambdabot> forall (m :: * -> *) (f :: * -> *). (Monad m, ?b::f Bool, Functor f) => f (m () -> m ()) 20:33:20 <elliott> oerjan: i'm watching you 20:33:38 <CakeProphet> [1] matched [a,b,c] matched and had groups 20:33:50 <CakeProphet> but I can just replace [] with undef 20:33:55 <ais523> CakeProphet: wow, that's a crazy API 20:34:09 <ais523> I'd expect "didn't match" and "matched with no groups" to have different representations 20:34:09 <CakeProphet> ais523: >_> that's how /.../ works except it is now in reference form. 20:34:17 <zzo38> Sgeo: I have explained before, on this channel, and on #haskell channel. I will type more about what it is doing, on there, too. 20:34:24 <ais523> well, I never said m//'s API was sane 20:34:45 <CakeProphet> ais523: why would it be the same? "matched with no groups" is true, why would it be ()? 20:35:19 <CakeProphet> like, I am literally just taking the result of match and putting brackets around it. 20:35:49 <ais523> it's because Perl's return-a-list APIs are flawed /because/ they aren't nullable, when often they want to be 20:35:56 <oerjan> :t <* 20:35:57 <lambdabot> parse error on input `<*' 20:36:01 <oerjan> :t (<*) 20:36:01 <lambdabot> forall (f :: * -> *) a b. (Applicative f) => f a -> f b -> f a 20:36:20 <ais523> as a silly example, if I do m/(1)|2/, how do I know which branch matched? 20:36:47 <CakeProphet> ais523: it's only flawed when I decide I want them to be arrayrefs. at the non-ref level it works just fine. () is undef in list context, (1) is 1 in list context, (a,b,c) is a special case that you only get in list context. 20:36:53 <CakeProphet> scalar context gives you undef or 1 20:37:13 <ais523> more plausibly, m/(\d+)|NA/ 20:38:13 <CakeProphet> well right, my @captures = m/.../ 20:38:16 <CakeProphet> oh look nothing captured 20:38:49 <ais523> so the problem with m//'s list API is, it's trying to return two separate data in one variable 20:38:56 <ais523> well, one list 20:39:44 <CakeProphet> !perl @c = "test" = /(abc)|test/; print @c 20:39:45 <EgoBot> Can't modify constant item in scalar assignment at /tmp/input.5957 line 1, near "/(abc)|test/;" 20:39:49 <CakeProphet> !perl @c = "test" =~ /(abc)|test/; print @c 20:39:53 <oerjan> :t when <$> ?b <*> ?c 20:39:54 <lambdabot> forall (m :: * -> *) (f :: * -> *). (Monad m, ?b::f Bool, Applicative f, ?c::f (m ())) => f (m ()) 20:40:05 <CakeProphet> !perl @c = "test" =~ /test/; print @c 20:40:05 <EgoBot> 1 20:40:18 <CakeProphet> that is kind of strange. It should really return 1 if it matched but captured nothing. 20:40:34 <CakeProphet> !perl @c = "test" =~ /test/; print 1 if @c 20:40:35 <EgoBot> 1 20:40:40 <CakeProphet> !perl @c = "test" =~ /(abc)|test/; print 1 if @c 20:40:40 <EgoBot> 1 20:40:49 <CakeProphet> ah but (undef) is true 20:41:00 <CakeProphet> so it works out when you want to interpret the capture group as a boolean 20:41:05 <ais523> (undef) would make a more sensible compromise 20:41:15 <CakeProphet> that is what it does. 20:41:19 <ais523> although that's almost as hacky as "0 but true" 20:41:49 <CakeProphet> but it gives you all of the results you'd expect from match while also giving you capture group information. 20:42:22 <oerjan> :t (<$) 20:42:23 <lambdabot> forall a (f :: * -> *) b. (Functor f) => a -> f b -> f a 20:42:29 <CakeProphet> it's just maybe not immediately obvious what those values are. :P 20:43:07 <CakeProphet> okay well I fixed my issue regardless. I won't even have to check for [] 20:43:31 <CakeProphet> if there was no match then it doesn't even include it in the list of matches. 20:43:39 <CakeProphet> as... that would be pointless. 20:43:40 <elliott> ais523: is 0 false in perl six by default? 20:44:01 <ais523> elliott: Perl 6 has numeric, string and boolean contexts 20:44:08 <ais523> 0 cast to a boolean context is false, though 20:44:13 <elliott> ais523: :( 20:44:17 <elliott> ais523: it should be true by default 20:44:21 <elliott> (as opposed to "0 but false") 20:44:22 <CakeProphet> that is the same thing as saying "0 is false in Perl 6" 20:44:31 <CakeProphet> that's also unchanged semantics from Perl 5. 20:44:52 <ais523> elliott: you can put traits on arbitrary objects to make them true or false 20:44:56 <CakeProphet> elliott: uh why. 20:45:03 <ais523> CakeProphet: there's a different quoting level involved 20:45:28 <ais523> in Perl 5, you use the string "'0 but true'" to give something that's zero numerically but true as a boolean, due to exploiting the way the casting works 20:45:40 <ais523> in Perl 6, you start with 0, then modify it with the but modifier to make it true, as in "0 but True" 20:45:59 <CakeProphet> Perl 6 is stupid, so that doesn't surprise me. 20:46:44 <CakeProphet> I don't know if you guys have noticed or not but the spec is kind of a clusterfuck of ideas. 20:47:04 <monqy> I haven't payed attentione 20:47:09 -!- derrik has quit (Quit: reconnect). 20:47:30 <CakeProphet> ais523: the but is optional though, right? you could just say "0 true" 20:47:34 -!- derrik has joined. 20:47:36 <ais523> CakeProphet: they actually work pretty well together, just they're not what people are used to 20:47:47 <ais523> CakeProphet: err, what? that's like me saying "1+1 is 2" and you saying "the + is optional, right?" 20:47:59 <elliott> <CakeProphet> Perl 6 is stupid, so that doesn't surprise me. 20:47:59 <elliott> <CakeProphet> I don't know if you guys have noticed or not but the spec is kind of a clusterfuck of ideas. 20:48:01 <elliott> --perl five fan 20:48:03 <ais523> I'm not talking about the string "0 but true" 20:48:15 <ais523> I'm talking about the operator but, with 0 and True as arguments 20:48:27 <CakeProphet> oh okay 20:48:32 <CakeProphet> I thought it was a string. 20:48:45 <CakeProphet> this makes more sense. 20:48:58 <zzo38> I have seen various good ideas in Perl 6 when looking at things. That includes the Perl 6 Periodic Table of Operators, where I saw that the % (modulo) operator is marked "iffy", which means it has a boolean negated form (like == has != and so on). There are also other operators I saw described there. And other features of Perl 6. 20:49:49 <zzo38> (Obviously, to me at least, the boolean negated form of % would mean it is divisible by.) 20:49:55 <ais523> yep, !% is pretty much a "divisible by" operator 20:50:07 <CakeProphet> you mean there's a seperate negated % operator with a different symbol, or that % returns 0 but true basically? 20:50:11 <CakeProphet> oh okay. 20:50:26 <ais523> CakeProphet: actually, ! is an operator that takes other operators as argument 20:50:27 <zzo38> CakeProphet: I mean a separate negated % operator. Although I don't know the details. 20:50:29 <ais523> and % is a legal argument 20:50:45 <CakeProphet> !x 20:50:50 <ais523> that's a different ! 20:50:53 <ais523> with the same spelling 20:50:57 <CakeProphet> no x is an operator in Perl 5 20:50:58 <ais523> which is used is always obvious from context 20:51:00 <ais523> oh, i see 20:51:03 <ais523> *I see 20:51:08 <ais523> probably in Perl 6 too 20:51:12 <CakeProphet> !perl ptiny "sup"x5 20:51:13 <EgoBot> String found where operator expected at /tmp/input.6941 line 1, near "ptiny "sup"" 20:51:16 <CakeProphet> !perl print "sup"x5 20:51:16 <EgoBot> supsupsupsupsup 20:51:24 <ais523> I wonder if you have a sub x, that it can always tell which is being used 20:51:34 <CakeProphet> !perl print 1x"25" 20:51:34 <EgoBot> 1111111111111111111111111 20:51:41 <CakeProphet> 1x = instant unary converter 20:51:43 <ais523> in Perl 6, presence or absence of whitespace is significant, so it would probably be the difference between !x and ! x 20:51:57 <ais523> (the amount of whitespace, if nonzero, isn't) 20:52:20 <CakeProphet> ais523: yes I imagine it can tell because a sub is prefix but x is infix. 20:52:38 <monqy> is perl 6 parseable 20:52:39 <zzo38> Is this better now? I wrote some explanation now. Still not complete, but I will also write more. If you have account write on that wiki page or on the talk page http://www.haskell.org/haskellwiki/User:Zzo38/Proposal_for_more-notation 20:52:56 <ais523> monqy: yes, more so than Perl 5 20:52:59 <ais523> it even has a defined grammar 20:53:09 <zzo38> If there is any unclear, please notify me. 20:53:29 <ais523> (Perl 5 is, in general, not parseable, although in most cases that actually happen in practice it is) 20:53:39 <copumpkin> zzo38: "Multiple constructors in a single more-declaration are guaranteed to keep the order given." 20:53:45 <copumpkin> what if I write T = One | Two 20:53:48 <copumpkin> and T = Two | One 20:53:53 <CakeProphet> !perl sub x($) {shift+1} print x 1x"4" 20:53:54 <EgoBot> Warning: Use of "shift" without parentheses is ambiguous at /tmp/input.7239 line 1. 20:53:54 <copumpkin> what's the result? 20:53:59 <CakeProphet> !perl sub x($) {(shift)+1} print x 1x"4" 20:53:59 <EgoBot> 1112 20:54:09 <ais523> copumpkin: you writing that made me think of a "copumpkin" as a dual of a pumpkin 20:54:19 <ais523> or a time-reversed pumpkin 20:54:21 <copumpkin> that's what it was intended as 20:54:22 <ais523> a bit like comultiplication 20:54:24 <ais523> heh 20:54:49 <zzo38> copumpkin: It is wrong to type that. Whether the compiler gives an error message or not is up to the compiler, but it doesn't mean anything correct. 20:55:08 <elliott> copumpkin was born when edwardk got a hold of pumpkin 20:55:24 * ais523 tries to imagine what a time-reversed pumpkin would be like 20:55:57 <zzo38> ais523: What is comultiplication? 20:56:36 <ais523> zzo38: you give it one value as an argument, and it returns two values, which if you multiply them, give the original value; in systems in which comultiplication exist (which don't, say, include normal arithmetic) there's normally only one unique way to do that 20:57:43 <zzo38> ais523: OK. What kind of systems are those? 20:57:59 <CakeProphet> so then a copumpkin, upon planting in the ground, yields pumpkin seeds...? 20:58:24 <ais523> I'm not sure; my only experience with comultiplication is proving that a system didn't have it 20:58:46 <ais523> CakeProphet: no, copumpkin seeds, and if you combine them together with the edible part of a copumpkin, you get a compumpkin again 20:59:10 <elliott> `quote pumpkin seeds 20:59:15 <HackEgo> 558) <fungot> Phantom_Hoover: it is a hate so pure and... pumpkin seeds? 20:59:21 * copumpkin sighs 20:59:26 <elliott> copumpkin copumpkin copumpkin copumpkin copumpkin 20:59:30 <elliott> ping forever 21:00:07 -!- hagb4rd has quit (Ping timeout: 252 seconds). 21:00:12 <CakeProphet> quick someone compile that into a quote 21:01:45 <monqy> compile what? are you someone? 21:01:49 <CakeProphet> no. 21:02:06 * oerjan vaguely thinks he's seen something like comultiplication somewhere 21:02:39 <ais523> oerjan: I'd expect you to know several examples, really; I seem to think that all theoretical mathematicians have huge sets of examples of every category in existence 21:02:45 <oerjan> http://en.wikipedia.org/wiki/Hopf_algebra 21:02:50 <ais523> although perhaps you haven't worked with coalgebras much 21:03:28 <oerjan> i knew someone who worked on quantum groups, and that included such things 21:03:39 <ais523> ah, aha, a general classification of things that are simultaneously regular algebras and coalgebras 21:03:42 <ais523> looks useful 21:05:15 <oerjan> i think i spent a bit of a month in ireland thinking about that stuff with him, although nothing came out of it 21:05:33 <oerjan> i cannot recall seeing comultiplication anywhere else 21:08:56 <zzo38> I added the description of use of more-notation in case blocks. 21:10:29 <coppro> woot, I love knowing all the secrets of the university, like mail delivered to the student society :D 21:10:33 <coppro> new OotS book is MIINE 21:14:44 <elliott> deac <- activate ((\c -> putChar c >> deac) <$> e) 21:14:48 <elliott> oerjan: i need mfix or recursive do, right? 21:15:52 <oerjan> um what are you doing 21:15:53 -!- derrik has quit (Quit: night). 21:16:46 <elliott> oerjan: that 21:16:48 <oerjan> if deac is not monadic then you cannot put it on the right of >> though 21:16:53 <elliott> it is 21:16:57 <monqy> is it in bad taste to write (\c -> putChar c >> deac) as ((>> deac) . putChar) because that's the sort of thing I od all the time 21:17:00 <elliott> oerjan: I mean, that is obviously not valid because deac isn't in scope 21:17:22 <elliott> monqy: I would prefer (putChar >=> const deac) or I guess (putChar >>> (>> deac)) would be ok too 21:17:30 <elliott> maybe we need (a -> m b) -> m c -> m c :P 21:17:30 <oerjan> ok, so rec deac <- activate ((\c -> putChar c >> deac) <$> e), i guess 21:17:37 <monqy> that would be good 21:17:38 <elliott> ?hoogle (a -> m b) -> m c -> m c 21:17:38 <lambdabot> Control.Exception handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO a 21:17:38 <lambdabot> Control.Exception.Base handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO a 21:17:38 <lambdabot> Control.OldException handleJust :: (Exception -> Maybe b) -> (b -> IO a) -> IO a -> IO a 21:17:43 <elliott> oerjan: right... is 21:17:47 <elliott> deac <- mfix (\deac -> ...) 21:17:51 <elliott> the desugaring? 21:18:07 <oerjan> something like that 21:18:27 <CakeProphet> :t mfix 21:18:27 <lambdabot> forall a (m :: * -> *). (MonadFix m) => (a -> m a) -> m a 21:19:12 <CakeProphet> :t mfix return 21:19:13 <lambdabot> forall a (m :: * -> *). (MonadFix m) => m a 21:19:32 <CakeProphet> > mfix return :: [Int] 21:19:36 <lambdabot> mueval-core: Time limit exceeded 21:19:43 <elliott> mfix return ~ fix id 21:19:50 <CakeProphet> right. 21:20:38 <CakeProphet> > mfix (const [1,2,3]) :: [Int] 21:20:39 <lambdabot> [1,2,3] 21:20:42 <CakeProphet> woah. 21:20:52 <oerjan> shocking 21:21:16 <monqy> is there a difference between mwhatever and whateverM? is it that the former is specified in a typeclass, and the latter defined elsewhere? 21:21:25 <elliott> :t mempty 21:21:26 <lambdabot> forall a. (Monoid a) => a 21:21:29 <CakeProphet> > mfix (\x -> [x,x+1,x+2]) :: [Int] 21:21:31 <elliott> sometimes it is not even an monads... 21:21:33 <lambdabot> mueval-core: Time limit exceeded 21:21:42 <monqy> mappend is monoid too right 21:21:52 <elliott> yes 21:21:55 <elliott> and mconcat 21:21:57 <monqy> sometimes i'm afraid i'll get mappend and mplus mixed up 21:22:08 <monqy> mempty/mzero too 21:22:10 <CakeProphet> how do I use mfix help. 21:22:35 <monqy> is help the a new fad help 21:23:05 <elliott> no 21:23:06 <elliott> its 21:23:07 <elliott> (c) us 21:23:09 <elliott> CakeProphet is infringe 21:23:13 <CakeProphet> what is fad I just have question help 21:23:19 <coppro> no, I'm infringe 21:23:26 <coppro> ph34r m3 21:23:42 <monqy> is evincar infrenge too i forget 21:23:54 <zzo38> Please look I completed everything in my proposal except for the stuff related to Template Haskell. 21:24:01 <oerjan> monqy: i just read in Control.Monad an hour or so ago that *M is reserved for functions that do nothing other than add monadic wrapping to result types 21:24:17 <oerjan> well nothing much other 21:24:25 <monqy> :t mapM 21:24:25 <lambdabot> forall a (m :: * -> *) b. (Monad m) => (a -> m b) -> [a] -> m [b] 21:24:28 <monqy> ??? 21:24:38 <CakeProphet> mapM is quite useful. 21:24:50 <monqy> or did I misinterpret "add monadic wrapping to the result types" 21:25:03 <CakeProphet> yes 21:25:06 <elliott> no 21:25:08 <oerjan> :t map 21:25:09 <lambdabot> forall a b. (a -> b) -> [a] -> [b] 21:25:27 <oerjan> you will see that the only type difference is some more m's at the final ->'s 21:25:45 <zzo38> I think that is clear 21:25:48 <monqy> oh "result type" applies to more than just the result type? 21:25:59 <monqy> makes sense 21:26:06 <oerjan> yes also result types of internal functions, it would seem 21:26:10 <CakeProphet> yes, "result types" applies to all of the result types. 21:26:15 <CakeProphet> >_> 21:26:30 <fizzie> Helloes from the sweaty Florence. 21:26:40 <elliott> hello how are you enjoying your hotel of badness 21:26:41 <monqy> :t mfix 21:26:42 <lambdabot> forall a (m :: * -> *). (MonadFix m) => (a -> m a) -> m a 21:26:47 <monqy> :t fix 21:26:47 <lambdabot> forall a. (a -> a) -> a 21:26:49 <elliott> checkmate oerjanists 21:26:53 <elliott> fixM 21:27:10 <fizzie> It's bad indeed. Also warm. 21:27:30 <oerjan> CakeProphet: mfix on lists is especially subtle, so much so that i once made an incorrect bug report about it 21:27:50 <elliott> > mfix (9:) 21:27:50 <lambdabot> Occurs check: cannot construct the infinite type: t = [t] 21:28:00 <elliott> > mfix (\x -> 9:[x]) 21:28:03 <lambdabot> mueval-core: Time limit exceeded 21:28:07 <elliott> hepl oerjan 21:28:14 <CakeProphet> how do I use mfix help 21:28:18 <monqy> help 21:28:19 <elliott> die 21:28:20 <elliott> infringing 21:28:21 <elliott> bastard 21:28:23 <elliott> >:( 21:28:26 * elliott enemy 21:28:40 <CakeProphet> > replicateM 4 "help" 21:28:40 <lambdabot> ["hhhh","hhhe","hhhl","hhhp","hheh","hhee","hhel","hhep","hhlh","hhle","hhl... 21:28:44 <monqy> hhhh 21:28:56 <monqy> bad stutter...... 21:29:00 <CakeProphet> > nub . permutations $ "help" 21:29:02 <lambdabot> ["help","ehlp","lehp","elhp","lhep","hlep","pleh","lpeh","leph","pelh","epl... 21:29:07 <monqy> pleh 21:29:40 <CakeProphet> oerjan: leph what is mfix on lists. 21:29:49 <monqy> lef 21:30:11 <CakeProphet> I like elhp 21:30:23 <CakeProphet> I (c) it 21:30:25 <CakeProphet> it is mine now. 21:30:34 <CakeProphet> you may not be an infringe. 21:31:10 <monqy> dont worry i wont...............................because elhp is bad 21:31:14 <oerjan> > mfix (\x -> [1:x, 2:x, 3:x]) 21:31:14 <monqy> (so bad) 21:31:15 <lambdabot> [[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1... 21:31:18 <monqy> eek 21:31:24 <CakeProphet> oh okay. 21:31:25 <monqy> what did you do 21:31:31 <oerjan> lessee 21:31:40 <oerjan> > map (take 5) $ mfix (\x -> [1:x, 2:x, 3:x]) 21:31:41 <lambdabot> [[1,1,1,1,1],[2,2,2,2,2],[3,3,3,3,3]] 21:31:50 <monqy> > sequence (mfix (\x -> [1:x, 2:x, 3:x])) 21:31:50 <lambdabot> [[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1... 21:31:52 <CakeProphet> sir you need to calm down. 21:31:54 <monqy> 123 21:33:13 -!- augur has quit (Remote host closed the connection). 21:37:29 <zzo38> I wrote something about use of more-notation with Template Haskell, too, now. 21:39:32 <oerjan> !haskell import Control.Monad.Fix; newtype Fix f a = Fix (f (Fix f a)); whee = mfix (\r -> newIORef (Fix r)); wrrr 0 r = return (); wrrr n r = do {Fix r' <- readIORef r; putStr "*"; wrrr (n-1) r' }; main = do r <- whee; wrrr 50 r 21:39:58 <oerjan> !haskell import Control.Monad.Fix; import Data.IORef; newtype Fix f a = Fix (f (Fix f a)); whee = mfix (\r -> newIORef (Fix r)); wrrr 0 r = return (); wrrr n r = do {Fix r' <- readIORef r; putStr "*"; wrrr (n-1) r' }; main = do r <- whee; wrrr 50 r 21:40:03 <EgoBot> ​************************************************** 21:40:11 <oerjan> yay just two tries 21:41:30 <Deewiant> !haskell replicate 50 '*' 21:41:33 <EgoBot> ​"**************************************************" 21:42:48 <oerjan> Deewiant: THAT WASN'T THE POINT 21:43:01 <CakeProphet> oerjan's is more elegant. 21:43:45 <coppro> ^ 21:44:00 <oerjan> anyway, the actual point was to demonstrate how mfix with IO's allows you to make IO actions referring to their own result. 21:44:23 <oerjan> in this case, making a cyclic list of mutable references. 21:47:43 <CakeProphet> hmm that's interesting. 21:48:04 <CakeProphet> if you rewrote the reference it would break the self-reference, yes? 21:48:32 <oerjan> of course any attempt to _evaluate_ the result before the IO action finishes will break. 21:49:00 <oerjan> well yes. 21:49:16 <oerjan> although in this case it's not that hard to put it back 21:49:44 <CakeProphet> oh okay so r and r' are never evaluated in the above, but if they were they would break. 21:50:26 <oerjan> um it's just inside whee they cannot be. wrrr evaluates r alright. 21:50:54 <oerjan> the whole mfix action must finish before you look strictly at the result. 21:51:03 -!- zzo38 has left. 21:51:32 <oerjan> this is for the IO monad. other monads may manage to be more lazy than that, i think. 21:53:03 <CakeProphet> ah okay. 21:53:36 <CakeProphet> I cannot think of a single use for such a reference.. lol 21:54:55 <oerjan> mutable graphs? 21:57:03 <CakeProphet> there's only one reference right? that references itself infinitely. 21:57:17 <Deewiant> I used mfix for something in Haschoo at one point but I don't remember what 21:57:58 <oerjan> anyway more generally this allows you to use tying-the-knot methods even if you are working in the IO monad. perhaps a reference to itself is not the most practical example of it, even pure values interleaved with IO actions can benefit. 21:58:46 <fizzie> "'You made me do it': Classification of Blame in Married Couples' Interactions by Fusing Automatically Derived Speech and Language Information". Someone's taken (parts of) http://www.phdcomics.com/comics/archive.php?comicid=718 to heart. 21:59:53 <oerjan> http://oerjan.nvg.org/esoteric/Unshackled.hs has some examples >:) 22:01:27 <oerjan> it occurs to me that probably won't compile with ghc. 22:01:33 <elliott> why not? 22:01:43 <elliott> mdo is still supported, just deprecated, IIRC 22:01:52 <oerjan> no LANGUAGE pragmas 22:02:06 <oerjan> well you can still add them on the command line i guess 22:02:06 <elliott> can just use -X 22:02:13 <elliott> I like how fillMemory uses mdo for no reason 22:02:39 <elliott> or maybe I just misunderstand mdo 22:02:41 <oerjan> it does? 22:02:53 <Deewiant> No it doesn't 22:03:03 <Deewiant> elliott: mem <- newMemory rArr prior to rArr <- 22:03:06 <oerjan> mem and rArr reference each other 22:03:17 <elliott> oh, so it does 22:04:58 -!- ais523 has quit (Ping timeout: 245 seconds). 22:08:11 -!- p01son has joined. 22:11:14 -!- p01son has quit (Quit: Leaving). 22:16:57 <CakeProphet> :t mfix 22:16:58 <lambdabot> forall a (m :: * -> *). (MonadFix m) => (a -> m a) -> m a 22:17:35 <CakeProphet> instance MonadFix CakeMonad where mfix = ($undefined) --:3 22:18:35 <Lymee> @src mfix 22:18:35 <lambdabot> Source not found. :( 22:18:39 <Lymee> oh right 22:19:03 <CakeProphet> Lymee: do you have :3 on highlight? 22:19:39 <Lymee> Nope! 22:21:16 <oerjan> CakeProphet: i think there are some MonadFix laws which that probably breaks 22:21:26 <CakeProphet> you think? 22:21:43 <oerjan> mfix (return . f) = return (fix f) iirc 22:23:16 <CakeProphet> well for strict functions, bottom and m bottom are pretty close... 22:23:41 <CakeProphet> *return bottom 22:25:19 <oerjan> > length (return undefined) 22:25:20 <lambdabot> 1 22:26:01 <CakeProphet> what if the monad were strict also? 22:26:45 <Lymee> @src return 22:26:45 <lambdabot> Source not found. My brain just exploded 22:26:49 <Lymee> :t return 22:26:50 <lambdabot> forall a (m :: * -> *). (Monad m) => a -> m a 22:26:53 <oerjan> i think a monad in which return were strict and not always bottom would break the monad laws. 22:27:09 <Lymee> oerjan, so make it always return bottom. 22:27:09 <Lymee> :3 22:27:15 <elliott> oerjan: nope, actually 22:27:26 <elliott> oerjan: see http://haskell.1045720.n5.nabble.com/Strict-Monad-td3079813.html 22:27:38 <elliott> MonadLib has that as Lift, I think (http://hackage.haskell.org/packages/archive/monadLib/3.6.2/doc/html/MonadLib.html) 22:27:42 <elliott> well, http://hackage.haskell.org/packages/archive/monadLib/3.6.2/doc/html/src/MonadLib.html#Lift 22:27:54 <elliott> instance Monad Lift where 22:27:54 <elliott> return x = L x 22:27:54 <elliott> fail x = error x 22:27:54 <elliott> L x >>= k = k x -- Note: the pattern is important here 22:27:54 <elliott> -- because it makes things strict 22:27:55 <CakeProphet> oerjan: also when f is lazy wouldn't it satisfy the mfix law? 22:28:02 <elliott> oerjan: caret 22:28:09 <elliott> instance MonadFix Lift where 22:28:10 <elliott> mfix f = let m = f (runLift m) in m 22:28:10 <elliott> fwiw 22:28:29 <oerjan> elliott: "in which return were strict" 22:28:38 <oerjan> your return isn't strict is it? 22:29:02 <oerjan> (as a function) 22:29:20 <elliott> well, no 22:29:23 <elliott> but it's a strict monad :P 22:29:23 <oerjan> anyway, return undefined >> return x = return x by the monad laws, i believe 22:30:46 -!- BeholdMyGlory has quit (Remote host closed the connection). 22:33:12 -!- azaq23 has joined. 22:33:15 <oerjan> CakeProphet: mfix (return . (1:)) = return (fix (1:)) but yours would give mfix (1:) = return (1:undefined) 22:33:21 <oerjan> er 22:33:33 <oerjan> *mfix (return . (1:)) = return (1:undefined) 22:34:09 <CakeProphet> oerjan: ah 22:34:34 <CakeProphet> I'm shocked, really. 22:34:51 <CakeProphet> oerjan: also wouldn't it be possible to include laws as part of Haskell? 22:35:05 <CakeProphet> basically as a compile-time check? 22:35:35 <elliott> CakeProphet discovers Coq. 22:35:39 <oerjan> theorem prover yada yada halting problem. 22:35:47 <elliott> `addquote <oerjan> theorem prover yada yada halting problem. 22:35:49 <HackEgo> 630) <oerjan> theorem prover yada yada halting problem. 22:36:24 <CakeProphet> is there some unwritten rule that compilers must halt? 22:36:27 <CakeProphet> how silly. 22:36:39 -!- augur has joined. 22:36:54 <CakeProphet> compilation is more fun when it's potentially undecidable. 22:37:19 <pikhq> You would think that. 22:40:03 -!- pikhq_ has joined. 22:40:53 <CakeProphet> what if you gave the compiler a written promise that everything was fine? 22:40:53 <oerjan> if a compiler doesn't halt it doesn't count as proof of TC-ness, at least 22:42:02 <oerjan> haskell has that, it's called unsafeCoerce. 22:42:47 <oerjan> you may find it somewhat unsatisfactory for ensuring monad laws. 22:43:18 -!- pikhq has quit (Ping timeout: 245 seconds). 22:44:54 <Sgeo> I might not be on Freenode tomorrow 22:45:11 <oerjan> elliott: hm that Id monad from your link actually has a strict return. hm. 22:45:49 <oerjan> but i think that works because that monad contains _only_ return x values. 22:47:52 <oerjan> so that undefined >>= f is not necessarily undefined. hm actually isn't that the definition of a _lazy_ monad. 22:50:12 -!- FireFly has quit (Quit: FireFly). 22:54:23 -!- augur has quit (Remote host closed the connection). 22:55:10 -!- augur has joined. 22:58:03 -!- zzo38 has joined. 23:03:14 <zzo38> I want to implement more-notation in Haskell, and be able to use it with Template Haskell. Writing it as a preprocessor will not do that 23:03:40 <zzo38> (That is, I want to be able to reify more-notation) 23:09:28 <pikhq_> Huh. For licensing reasons, Sun published a different package of the JDK for distros to use. 23:09:34 <pikhq_> Oracle is discontinuing that package. 23:10:05 <pikhq_> Making it so the official JDK is not at all legally redistributable. 23:10:51 -!- sllide has joined. 23:17:12 -!- Vorpal_ has changed nick to Vorpal. 23:20:12 -!- copumpkin has quit (Ping timeout: 240 seconds). 23:20:37 -!- copumpkin has joined. 23:32:07 <Gregor> pikhq_: And what's the status of OpenJDK? 23:32:17 <Gregor> Other than <Oracle> lol, no 23:33:37 <pikhq_> Gregor: Functioning, but with bugs? 23:34:01 <pikhq_> Also, perfectly legal. 23:34:19 <Gregor> Right, OK. 23:34:29 <Gregor> I mean, last I knew, my Java is icedtea. 23:34:53 <elliott> "Last I knew, my java is iced tea." --Gregor, senile. 23:34:57 <coppro> pikhq_: Why is this "Huh."? 23:35:42 <pikhq_> coppro: Did not realise that Sun was that friggin' retarded with the licensing. 23:35:50 <Sgeo> I still have no idea where the safest place in my apartment, if there is one, is 23:35:51 <Sgeo> :( 23:35:55 <pikhq_> "No, you can't redistribute this! Redistribute this OTHER package instead!" 23:35:58 <Gregor> elliott: BACK IN MY DAY, WE COULD ONLY GET 24 OUNCES OF ICED TEA IN OUR COFFEE AT STARBUCKS, AND WE LIKED IT! YOU WHIPPERSNAPPERS AND YOUR 124 OUNCE COFFEE-SLURPEE-DRINK-IT-CUPS ARE CODDLED 23:36:20 <elliott> Gregor: It's OK. Have this hot steaming mug of OpenJDK (water not included). 23:36:27 <elliott> Sgeo: wat 23:36:49 <pikhq_> elliott: Hurricane coming his way. 23:36:56 <elliott> oh 23:36:57 <elliott> right 23:36:59 <Gregor> elliott: YOU YOUNGINS AND YOUR ROCK-AND-ROLL COFFEE SEX PARTIES 23:37:14 <Sgeo> elliott, I live on an island that's in the path of a hurricane. I'm well outside the evacuation zone, but worried about wind breaking my window or something 23:39:02 <oerjan> an island in the eastern us, with a storm coming... 23:39:06 <oerjan> ^style lovecraft 23:39:06 <fungot> Selected style: lovecraft (H. P. Lovecraft's writings) 23:39:15 <oerjan> fungot: what is your comment to this? 23:39:15 <fungot> oerjan: the next day, his last in raback, he again goes alone to bid the long-dead count farewell. once more the lighters grew wont to put out from the north curse and whine, and the 23:40:33 <oerjan> Sgeo: fungot says you should look out for long-dead counts 23:40:33 <fungot> oerjan: in a field, forced poison down his throat, as if to dispel the mood which was engulfing her more and more i come to a sort of 23:41:19 <Gregor> Sgeo: If you don't, he'll force poison down your throat. Or maybe that's how you're supposed to deal with him? Also it seems the poison is more of a mood-enhancer. 23:49:23 -!- augur has quit (Remote host closed the connection). 23:56:20 -!- evincar has joined. 23:57:36 <evincar> So it turns out that parsing with iterators is quite natural. 23:58:51 <CakeProphet> he lies. 23:59:14 <evincar> Largely because everything's modelled as a lazy dataflow. 23:59:29 <evincar> And any accumulation or state is encapsulated, if not actively discouraged. 23:59:37 <elliott> itt: parser combinators are literally the best anyone who doesn't like them is not a smart person