00:00:11 <ais523> also, random libraries dotted around the Internet (Java scores well on that metric)
00:00:36 <elliott> ais523: Python probably measures up well in comparison
00:00:58 <elliott> ais523: bear in mind that I think most CPAN hype is due to it basically being the first of its kind
00:01:02 <ais523> 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:16 <ais523> being first of its kind definitely gives a relatively major boost, though
00:01:20 <elliott> 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:34 <ais523> CPAN has automated testing, etc
00:01:40 <ais523> I do find partially broken stuff quite often
00:01:43 <ais523> but completely broken is rare
00:02:23 <elliott> 71145 Uploads, 23245 Distributions
00:02:23 <elliott> 98470 Modules, 9170 Uploaders
00:02:41 <elliott> I find it very hard to believe that there are anywhere near 23245 useful packages on CPAN
00:02:50 <elliott> although I suppose with the ridiculous kind of splitting they do it might be possible
00:06:28 <CakeProphet> I don't know much about rubygems but I believe it has a fairly large set of packages as well.
00:10:18 <CakeProphet> perl -e "use List::Util 'sum'; print sum(split /\D+/, <>)" catlist.txt
00:10:31 <CakeProphet> catlist.txt is a copypasta from the category list on hackage
00:11:26 <elliott> Hackage's are all good, though.
00:12:22 <monqy> 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:13:03 <Gregor> pikhq: THEN FRIGGIN' DO IT
00:13:09 <pikhq> Come on, Firefox on DOS.
00:13:20 <Gregor> monqy: It's a lot of bandwidth so I'm not trying to make it super-duper-well-known :P
00:14:39 <CakeProphet> just found this little morsel on the web: perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"'
00:15:03 <CakeProphet> converts the number to unary and then determines if it's prime
00:15:07 <pikhq> It's surprisingly easy to do this in qemu, BTW.
00:15:40 <pikhq> 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:17:03 <elliott> 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 <Phantom_Hoover> So the ^1?$ presumably tests if it can be divided into m repetitions of n?
00:17:48 <CakeProphet> 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 <elliott> ^1?$ just matches epsilon and "1", Phantom_Hoover.
00:19:38 <CakeProphet> but to me (11+?)\1 says "match an even number of 1's" unless I'm misunderstanding the nongreedy semantics
00:20:31 <elliott> Are you sure it's not just an odd-or-even tester? :p
00:24:54 <Phantom_Hoover> i.e. that the regex matches any m repetitions of a sequence of n 1s?
00:27:11 <ais523> this is all kind-of obvious, btw, you people
00:27:27 <ais523> I think I wrote a regex like that myself as a proof of concept
00:28:49 <ais523> 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 <ais523> what you're doing wrong is trying to read them a line at a time rather than character at a time
00:31:59 -!- Phantom_Hoover has quit (Quit: Leaving).
00:32:43 <CakeProphet> yeah I agree that they're easy to read for the most part. What happened was the +? semantics threw me off
00:33:02 <CakeProphet> 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 <CakeProphet> `run echo "234346234346134983746987234987239587239847235" | perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"'
00:34:19 <monqy> does +? do matching differently than * then?
00:34:52 <monqy> I know the relationship between + and *
00:34:52 <CakeProphet> *? is like * in formal regular expressions.
00:35:04 <monqy> but I might not be getting ?
00:35:23 <CakeProphet> *? matches the minimum number of repetitions, * matches maximum.
00:35:52 <monqy> so is ? just a greediness thing then?
00:36:25 <CakeProphet> though actually I guess formal regular expressions have no notion of greediness.
00:36:51 <monqy> 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 <CakeProphet> that's what ? normally means, *? and +? are special forms
00:37:19 <CakeProphet> because you would never put a ? after * and +
00:37:41 <CakeProphet> there's also ?? which I'm not quite so clear on.
00:38:27 <CakeProphet> it's a nongreedy ?, so I guess it'll match epsilon if the preceeding pattern matches in that case.
00:38:46 <CakeProphet> whereas ? would match the non-epsilon case in situation.
00:40:14 <CakeProphet> 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 <CakeProphet> in other words, it consumes 1's until the number of 1's divides the total number.
00:46:29 <CakeProphet> > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in sieve [2..]
00:46:30 <lambdabot> [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 <CakeProphet> > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 1000 $ sieve [2..]
00:46:45 <lambdabot> [7927,7933,7937,7949,7951,7963,7993,8009,8011,8017,8039,8053,8059,8069,8081...
00:46:49 <CakeProphet> > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 10000 $ sieve [2..]
00:46:57 <CakeProphet> > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 9999 $ sieve [2..]
00:47:07 <CakeProphet> > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 3333 $ sieve [2..]
00:47:14 <CakeProphet> > let sieve (p:xs) = p : sieve (filter (\x -> x `mod` p /= 0) xs) in drop 2222 $ sieve [2..]
00:47:17 <lambdabot> [19597,19603,19609,19661,19681,19687,19697,19699,19709,19717,19727,19739,19...
00:47:45 <CakeProphet> let sieve (p:xs) = p : sieve {filter (\ x -> x 'mod' p /= 0) xs)
00:48:16 <CakeProphet> echo "19739" | perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"'
00:48:21 <CakeProphet> `run echo "19739" | perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"'
00:48:52 <oerjan> > nubBy(((>1).).gcd)[2..]
00:48:53 <lambdabot> [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:50:32 <oerjan> well gcd is more expensive than mod
00:51:00 <CakeProphet> I'll just run it on my machine to get insanely large primes.
00:52:36 <oerjan> 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 <monqy> nubBy is pretty inefficient as well iirc
00:53:18 <oerjan> well yes but i think nubBy is pretty equivalent to what CakeProphet wrote
00:53:35 <lambdabot> nubBy eq (x:xs) = x : nubBy eq (filter (\ y -> not (eq x y)) xs)
00:54:14 -!- copumpkin has quit (Ping timeout: 260 seconds).
00:54:31 -!- copumpkin has joined.
00:56:24 <oerjan> > nubBy(((<1).).flip mod)[2..]
00:56:26 <lambdabot> [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:34 <oerjan> > nubBy(((<1).).mod)[2..]
00:56:35 <lambdabot> [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 <oerjan> 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 <CakeProphet> I know the Perl prime number tester is not very memory efficient, but perhaps it's computationally efficient.
01:00:07 <CakeProphet> `run echo "104729" | perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ && print "$_ 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 <pikhq> That's pretty comedic. You can give the installer an invalid serial number.
01:05:26 <pikhq> 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:37 * CakeProphet pipes a Haskell programming that generates primes to the perl one-liner. a wonderful thing is happening.
01:10:33 <CakeProphet> it's gradually starting to output slower as the numbers increase.
01:11:59 <CakeProphet> I'm just wondering at what point it will start to slow to a crawl.
01:14:06 <CakeProphet> Haskell program generating primes, Perl one-liner thing testing that they're primes.
01:14:21 <monqy> and how is that beautiful
01:15:00 <CakeProphet> because they're happily communicating on my processor, which is computing mad amounts of instructions.
01:17:54 <CakeProphet> sorted by CPU usage, the two two processes on my machine are currently "perl" and "java"
01:19:15 <monqy> what is java doing
01:19:17 <CakeProphet> probably because it is working much faster than perl.
01:19:34 <CakeProphet> uh, I think it's the java applet for my online class.
01:36:39 <CakeProphet> lol, I just tried to define a main function in Python
01:36:58 <CakeProphet> earlier I tried to use "using" instead of "import" in a Haskell program
01:47:58 -!- hagb4rd has joined.
02:02:43 <CakeProphet> super(self.__class__, self).__init__(source)
02:03:31 <CakeProphet> 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 <elliott> CakeProphet: super is a waste of time
02:07:00 <elliott> also I'm pretty sure you're meant to put the actual class there, not self.__class__
02:07:09 <elliott> that's sort of the whole idea what with subclasses, I gather
02:07:23 <ais523> ah, I finally remembered what combo I'd bound to turn windows black and white
02:07:34 <ais523> now I'm trying to remember /why/ I bound a complicated combination to do that
02:07:40 <ais523> (super-shift-mousewheeldown, fwiw)
02:07:45 <elliott> CakeProphet: but seriously, just do Foo.__init__(self, ...) and avoid multiple inheritance forever
02:08:01 <ais523> elliott: yep, and mousewheelup to turn them back again
02:08:06 <ais523> hey, it's not like I'm going to press it by accident
02:08:15 <ais523> there are various amounts of desaturation in between
02:08:36 <ais523> I knew it was modifiers + mousewheel, but forgot which modifiers
02:10:43 <CakeProphet> elliott: if I recall correctly, the super(self.__class__, self).__init__ stuff is "more pythonic"
02:11:35 <CakeProphet> maybe I should go ask #python even though they suck dicks.
02:11:45 <elliott> CakeProphet: It is literally identical to super unless you have multiple inheritance.
02:11:53 <elliott> If you have multiple inheritance, you have two or more problems.
02:12:13 <elliott> CakeProphet: But seriously, I'm pretty sure you _have_ to use it like super(ClassName, self) for it to work properly.
02:12:19 <elliott> Or later inheritance will mess it up.
02:12:37 <CakeProphet> super(self.__class__, self) is the same as super(ClassName, self)
02:12:37 <elliott> CakeProphet: No, it patently does not have the same semantics.
02:12:48 <elliott> self.__class_ =/= ClassName if self is an instance of a subclass of ClassName.
02:13:05 <elliott> CakeProphet: You may also enjoy this fun fun fun article: http://fuhm.net/super-harmful/
02:13:26 <elliott> tl;dr you have no hope of getting super right, multiple inheritance is shit, just say SuperClass.__init__(self, ...) and be happy.
02:13:56 <CakeProphet> time to rewrite those lines in 6 or so classes.
02:14:19 <CakeProphet> < Dulak> CakeProphet: super() or call it as ParentClass.method() are the two options, I typically avoid super myself
02:14:38 <elliott> Sounds like a Cardassian name.
02:14:52 <elliott> Make sure he doesn't hit you with a rock.
02:15:40 <hagb4rd> avoid super? this is so unesoteric
02:15:54 <elliott> Are we sure hagb4rd isn't actually a bot?
02:16:02 <CakeProphet> HERE AT ESOTERIC WE VALUE CLEAN, ELEGANT CODE.
02:16:42 <elliott> hagb4rd: not from here you don't
02:16:54 <MDude> 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 <Gregor> There have been various, IIRC PSOX is the most recent.
02:17:40 <elliott> MDude: Not ASCII, but eight-bit, yes. You might be thinking of PESOIX or EsoAPI or PSOX.
02:19:33 <oerjan> hagb4rd: well as a small turing test, you might explain zygohistomorphic prepromorphisms as applied to the INTERCAL threading model.
02:19:34 <CakeProphet> elliott: okay so I've got a huge class tree of AST node types
02:19:51 <ais523> oerjan: I'm not even sure /I/ can do that
02:20:03 <elliott> CakeProphet: that might be one of your problems.
02:20:08 <CakeProphet> would you consider it bad practice to implement the interpreter by calling an evaluate() method on the top level node?
02:20:22 <CakeProphet> which then calls subnodes evaluate methods, etc...
02:20:55 <elliott> CakeProphet: itt: visitor pattern
02:21:19 <CakeProphet> awesome because that will actually be more pleasant than the alternative.
02:21:21 <elliott> CakeProphet: but you may also want to do it visitor style instead.
02:21:25 <elliott> http://en.wikipedia.org/wiki/Visitor_pattern#Source
02:21:33 <elliott> basically just syb: the verbose oop edition
02:22:01 <CakeProphet> I think that is the same thing as what I was talking about
02:22:21 <elliott> but you probably don't care
02:22:41 -!- oerjan has quit (Quit: Good night).
02:22:44 <hagb4rd> oerjan: would you like to explain it to me? i'd be glad to learn
02:22:45 <CakeProphet> 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 <elliott> CakeProphet: a method is better imo
02:23:11 <CakeProphet> elliott: so basically the difference here is that the visitor object has a method as well?
02:24:29 <CakeProphet> instead of the "visitor" object I'll just be passing around an environment object.
02:24:38 <elliott> yeah, you don't understand the visitor pattern, but it doesn't matter
02:24:45 <elliott> if you want extensibility it's easier to have a method
02:24:54 <hagb4rd> oerjan: i really do not know much, but it took me 30 years of my life to find this channel ;)
02:25:02 <Patashu> isn't visitor pattern kidna like monads?
02:25:13 <elliott> hagb4rd: you spent thirty years of your life wanting an irc channel about esolangs?
02:25:53 <MDude> I was tihnking of making a 2D language that requires miltithreading, but it looks like Flip already does that.
02:26:01 <Patashu> isn't visitor pattern where you expose an iterator over all your children?
02:26:06 <hagb4rd> elliot: no not really.. to find a channel i really do not understand anything
02:26:36 <elliott> hagb4rd: any channel where people spoke nonsense all day would fit that bill, so i recommend you try #vjn
02:26:47 <elliott> Patashu: yes, which is unrelated to monads.
02:27:00 <Patashu> monads are where you can apply a function over a container of values regardless of what the container is, right?
02:27:09 <hagb4rd> elliot: and not to forget.. find guys as charming as you are
02:27:19 <elliott> Patashu: that's functors, and the description is misleading
02:27:28 <elliott> ("computation" is better than "container" but still not quite accurate)
02:27:36 <Gregor> hagb4rd: If you had said that a week ago, we'd call the cops on you X-D
02:27:55 <elliott> Gregor: Dude, augur used to talk a lot in here.
02:28:02 <CakeProphet> elliott: yeah visitor pattern looks really annoying I'm not going to do that.
02:28:09 <Gregor> elliott: Having sex with augur, where else?
02:28:21 <hagb4rd> gregor: is your game making progress?
02:28:47 <Gregor> hagb4rd: It's implemented, but my attempts at making bots for it thusfar have had limited success.
02:28:50 <Gregor> elliott: *sobblecopter*
02:29:11 <Patashu> tried genetically making bots yet?
02:29:15 * Sgeo suddenly envisions writing tax processing code using Haskell's List monad
02:29:24 <elliott> Genetic programming is really really shitty.
02:29:31 <elliott> But it's still my first thought when I think of rezzo :P
02:29:36 <elliott> I mean, see how badly it does for BF Joust
02:29:39 <elliott> rezzo is about ten times more complicated
02:29:44 -!- azaq23 has joined.
02:29:56 <elliott> You can't just generate a program to do any task that involves some kind of tolerated imperfection :P
02:29:59 <Patashu> it's not shitty for -everything-
02:35:06 <CakeProphet> wow that did not take long enough to debug, obviously something is wrong.
02:37:56 <CakeProphet> elliott: also I'm curious as to how you would do an AST in Python
02:38:57 <elliott> 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 <hagb4rd> yea the solution is clean, safe, fast and absolutely wrong
02:39:42 <CakeProphet> ...I think using a class is actually a better approach in Python.
02:39:53 <CakeProphet> YOU CAN'T CODE HASKELL IN OTHER LANGUAGES, ELLIOTT.
02:40:16 <elliott> the first thing is... not the haskell solution.
02:40:27 <elliott> hagb4rd: seriously, you are literally just parroting things from a qdb, right?
02:40:37 <elliott> or like a trite geek phrase database
02:40:47 <elliott> 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 <CakeProphet> elliott: but OO is so elegant! I've got like 77 lines of boilerplate AST code.
02:43:09 <hagb4rd> elliott: y should i do such miserable things? nope.. i read this on a sticker or sth
02:44:22 <CakeProphet> hagb4rd: do you know how to write computer programs?
02:44:23 <Sgeo> YES YES YES HASKELL LAZINESS HELPS SOLVE MY PROBLEMS
02:44:34 <Sgeo> At least one of them, anyway
02:45:01 <Sgeo> I still feel like I'd... wait, State monad would break that, wouldn't it?
02:45:01 <hagb4rd> i've come here to change this
02:45:46 <Sgeo> I should actually try it at some point
02:45:52 <Sgeo> Wonder if the ST monad has these problems
02:45:58 <hagb4rd> cakeprophet: but i'm not working at this lowlevel usually
02:46:22 * Patashu ponders low level haskell... iota?
02:46:24 <elliott> what did you do to my client why can i see your messages again :(
02:46:42 <Sgeo> elliott, nothing deliberately
02:47:34 <elliott> Patashu: http://hpaste.org/50517
02:56:31 <CakeProphet> also what we've been talking about recently hasn't bee "low level"
02:59:35 <elliott> is hagb4rd a programmer i thought he wasn't
03:03:14 <hagb4rd> 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 <hagb4rd> the opposite of operation mindfuck, you know
03:06:12 -!- pikhq has joined.
03:07:43 <monqy> hi is bad things happening
03:07:50 <Gregor> <Larry Page> I need a new company cell phone. Random lackey, go buy a Motorola. <Random lackey> Aye aye! (later) <Larry Page> Which model did you buy? <Random lackey> ... model?
03:09:48 <elliott> 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:12:56 <hagb4rd> the opposite of operation mindfuck, you knowu practice here
03:13:44 <pikhq> Stepdad types router admin password in plaintext, gets pissed that I noticed. Hooray, dealing with stupid!
03:14:17 <Gregor> Family: Literally the worst thing? (Since stealing elliott's phrases, anyway)
03:14:50 <elliott> I am fairly sure I did not invent any of the mannerisms I use.
03:14:57 <elliott> But by all means attribute them to me :P
03:14:59 -!- azaq23 has quit (Ping timeout: 252 seconds).
03:15:23 <monqy> I probably invented at least a good few of my mannerisms
03:16:17 <hagb4rd> 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 <elliott> hagb4rd: have we told you that you've got the wrong definition of esoteric yet
03:17:17 <pikhq> Anyways. I've got DESQview X working, but I can't get the friggin' network stack to work
03:18:32 <hagb4rd> elliott: u don't miss any chance to do so, yes
03:19:50 <hagb4rd> my english seems infantile but i'm a fucking intelligent bot
03:20:01 <elliott> http://esolangs.org/wiki/Main_Page, http://en.wikipedia.org/wiki/Esoteric_programming_language might help :)
03:23:01 <CakeProphet> hagb4rd: so you can't program? we should fix that
03:23:19 <monqy> are you sure this is a good idea....
03:23:30 <CakeProphet> teaching someone how to program is always a good idea.
03:23:52 <monqy> how are you going to
03:24:15 <hagb4rd> let me just listen for a while and ignore my stupid comments
03:24:17 <CakeProphet> and I will wait, and continue working on my project.
03:24:35 <CakeProphet> you'll just listen to us and not know what we're talking about at all.
03:24:59 <elliott> hagb4rd: you know histomorphism morphisms?
03:25:02 <pikhq> CAN HAS NETWORKING
03:25:09 <elliott> well what prepromorphisms are to morphisms
03:25:15 <elliott> and zygohistomorphisms are to histomorphisms
03:25:25 <elliott> are to zygohistomorphic prepromorphisms
03:25:33 <elliott> what histomorphic morphisms are
03:25:44 <hagb4rd> no, but i have a hairdresser callled dominique
03:26:03 <CakeProphet> elliott: I'm hoping you just made those words up
03:26:42 <elliott> CakeProphet: zygohistomorphic prepromorphisms are real.
03:26:48 <elliott> see http://www.haskell.org/haskellwiki/Zygohistomorphic_prepromorphisms, http://stackoverflow.com/questions/5057136/real-world-applications-of-zygohistomorphic-prepromorphisms
03:27:08 <elliott> CakeProphet: oh, http://www.reddit.com/r/programming/comments/6ml1y/a_pretty_useful_haskell_snippet/c04ako5 before the stackoverflow link
03:27:08 <CakeProphet> no thanks I'm currently working on making 2 grand.
03:27:19 <hagb4rd> okay.. that should be enough to confuse me in lesson1..thx
03:27:36 <CakeProphet> hagb4rd: no you definitely need to read an introductory text on how to program in some language.
03:28:03 <CakeProphet> and not just read confusing things you don't understand.
03:28:15 <hagb4rd> okay.. i'm used to c, java, pearl and stuff you're really not interested it
03:28:27 <elliott> CakeProphet: well, that's what the other kind of esoteric is all about.
03:28:34 <elliott> so it must do something for a lot of people
03:28:38 <monqy> i recommend the a gentle introduction to haskell
03:29:07 <hagb4rd> but i will read this articles..i promise
03:29:54 <CakeProphet> my favorite part about writing a parser by hand has been: the myriad of error messages
03:30:10 <elliott> CakeProphet: you should write it in haskell instead. and then also use trifecta or something
03:30:48 <copumpkin> it's a sweet parser library edwardk has been writing
03:30:53 -!- azaq23 has joined.
03:30:56 <elliott> CakeProphet: http://hackage.haskell.org/package/trifecta
03:31:03 <elliott> i haven't used it but apparently it is like parsec but nicer??
03:31:10 <elliott> and i hear it gives fancy syntax-highlighted automatic errors like clang does
03:31:16 <CakeProphet> oh, no too late for that. and this guy wants it in Python.
03:31:20 <elliott> as opposed to parsec's errors which are.... not good.........
03:31:29 <elliott> CakeProphet: that's ok, just write a python bytecode backend for ghc
03:31:46 <copumpkin> it also gives you syntax highlighting in html or other outputs if you want
03:31:50 <CakeProphet> because python bytecode is so non-language specific.
03:31:51 <elliott> not even that hard, I would guess
03:31:53 <elliott> stg isn't that complicated is it?
03:32:03 <elliott> CakeProphet: um python bytecode is actually really easy to target
03:32:04 <hagb4rd> okay..let's start with haskell then
03:32:08 <elliott> it's just a really simple stack machine
03:32:27 <CakeProphet> yes I know. but would that be easy to translate to from a functional language?
03:32:33 <pikhq> Let's see how hella-slow this is.
03:32:44 <elliott> CakeProphet: ghc doesn't go straight from haskell to assembly dude
03:32:56 -!- MDude has changed nick to MSleep.
03:33:05 <CakeProphet> so you're saying translate either Core or C to Python bytecode yes?
03:33:11 <elliott> CakeProphet: no, either STG or Cmm
03:33:31 <elliott> it goes Haskell → Core → STG → Cmm → backend, I believe
03:33:46 <elliott> Cmm is just GHC's internal dialect of C-- (http://www.cminusminus.org/)
03:33:52 <elliott> so it's basically C but with fewer assumptions and no high-level features.
03:34:07 <elliott> I dunno how nice stg would be to compile, ask copumpkin :-D
03:34:19 <elliott> but I'm pretty sure it's more functional-ish than Cmm
03:34:25 <elliott> so probably you want to turn Cmm into Python bytecode
03:34:31 <elliott> hmm, now I want to implement this :/
03:34:35 <copumpkin> it's not really a visible language
03:34:49 <hagb4rd> what's your opinio on ms' f#
03:34:51 <pikhq> This message sent from DOS.
03:34:52 <elliott> copumpkin: tell me writing a Cmm → Python bytecode compiler is a bad idea
03:35:02 <copumpkin> it wouldn't be impossible, but I wouldn't do it
03:35:06 <elliott> hagb4rd: it's like OCaml except proprietary and not nice
03:35:08 <CakeProphet> hagb4rd: I don't really have one. Kind of neutralish.
03:35:15 <elliott> copumpkin: btw, "it's not really a visible language" - about STG or Cmm?
03:35:30 <elliott> I mean obviously none of it is "visible" but backends have to process something :P
03:35:46 <CakeProphet> I'm almost convinced there's no clean way to write a parser via imperative style.
03:35:57 <elliott> copumpkin: well, right, a bunch of the rts is cmm isn't it
03:36:09 <elliott> CakeProphet: imperative programs compose terrible, q.e.d.?
03:36:17 <elliott> 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 <elliott> i like how most of this is "exactly like C-- EXCEPT ..."
03:38:19 <CakeProphet> elliott: though at least python has a partition method which makes things somewhat cleaner.
03:38:29 <CakeProphet> still I find myself resorting to character-by-character loops more than I would like.
03:38:36 <elliott> CakeProphet: you could just use a parser combinator library
03:39:03 <CakeProphet> ...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 <monqy> why didn't you use a parser combinator library to start with
03:39:23 <elliott> CakeProphet: what are you actually coding
03:39:41 <elliott> 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 <monqy> cakeprophets language "its totally cool and good okay"
03:39:58 <elliott> please tell me it's at least a dsl
03:41:01 <pikhq> My goodness this is amazing.
03:41:35 <pikhq> This xterm is running in a DOS X server.
03:42:05 <Sgeo> Cool. Why would anyone make a DOS X server though?
03:42:09 <Sgeo> Except for fun
03:42:13 <Sgeo> Or if it's old
03:42:22 <pikhq> It's fucking ancient.
03:42:39 <pikhq> 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:44:09 <pikhq> DOS is more ancient than you would like to think.
03:44:46 <Sgeo> It's not DOS that I'm failing to think of as ancient (although I guess that too), but X.
03:45:36 <pikhq> Yeah. Still, it's utterly insane.
03:46:43 <CakeProphet> monqy: dude wait till I write my regex-inspired language.
03:47:42 <CakeProphet> yeah because it makes complete sense for Perl to be inspired by a subset of itself.
03:48:08 <pikhq> I could go deeper.
03:48:22 <pikhq> I could start qemu.
03:49:11 <CakeProphet> actually regex is a superset of Perl due to (?{...}) and friends
03:51:00 <CakeProphet> 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:45 <CakeProphet> and more like a programming language with regular expression operations as first-class citizens.
03:52:41 <CakeProphet> also there's multiple contexts that an expression can be evaluated in, like Perl.
03:53:06 <monqy> ew contexts (puke)
03:53:12 <Patashu> multiple contexts is basically implicit casting right?
03:53:39 -!- variable has quit (Remote host closed the connection).
03:55:12 <CakeProphet> also in Perl subroutines can routine two completely different things based on their context.
03:55:29 <CakeProphet> the builtin operators do this often, and user-defined subroutines can do it with the wantarray operator
03:55:54 <Patashu> that's something overloaded functions don't do
03:56:26 <monqy> (puke)(puke)(puke)
03:56:55 <Patashu> *ponders object contexts plus polymorphism*
03:57:49 <CakeProphet> !perl $_='test'; print scalar /(.)(.)(.)(.)/
03:57:50 <EgoBot> Warning: Use of "scalar" without parentheses is ambiguous at /tmp/input.29688 line 1.
03:57:58 <CakeProphet> !perl $_='test'; print (scalar /(.)(.)(.)(.)/)
03:57:58 <EgoBot> Warning: Use of "scalar" without parentheses is ambiguous at /tmp/input.29772 line 1.
03:58:04 <CakeProphet> !perl $_='test'; print scalar (/(.)(.)(.)(.)/)
03:58:12 <CakeProphet> I don't really see how it was ambiguous but OKAY.
03:58:25 <CakeProphet> so yeah in list context regex match returns a list of its captures
03:58:35 <elliott> CakeProphet ~ "maybe not as well-versed in perls grammar as perl"
04:00:13 <CakeProphet> Patashu: also because Perl subroutines take a list as their single argument that means passing as argument = list context
04:00:32 <CakeProphet> Patashu: unless you use scalar, which forces scalar context, as I did.
04:00:36 <hagb4rd> !perl $_=':P'; print /(.)(.)/
04:01:37 <hagb4rd> last but not least it was kind of erotic
04:04:37 <CakeProphet> I actually do find Perl code to be beautiful.
04:05:04 <Patashu> I find vb code to be beautiful
04:06:00 <CakeProphet> $x=0;map{/i/&&$x++;/d/&&$x!=0&&$x--;/o/&&print"$x\n";$x*=$x!=16&&$x if/s/}<>
04:07:16 <monqy> myndzi is the best part
04:12:51 -!- variable has joined.
04:14:48 <pikhq> 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 <hagb4rd> this is an awesone piece of js code http://deanm.github.com/pre3d/monster.html
04:28:48 <CakeProphet> "awesome piece of js" -- that statement cancels itself out and becomes nothingness
04:30:27 <hagb4rd> 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:31:27 <hagb4rd> http://deanm.github.com/pre3d/monster.js
04:33:10 <CakeProphet> yeah I found it. it's pretty much not very possible to read.
04:33:21 <CakeProphet> but from what I can tell it manipulates a canvas object.
04:35:31 <monqy> for compression purposes, presumably
04:35:44 <monqy> https://github.com/deanm/pre3d/tree/master/demos dunno if that demo is here though
04:40:50 <hagb4rd> i try to get it formatted.. but even that seems not be trivial
04:41:10 <hagb4rd> what the hell happens there
04:43:48 <CakeProphet> 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 <CakeProphet> http://www.youtube.com/watch?v=O2rGTXHvPCQ -- How IRC works, according to American television
04:56:06 -!- evincar has joined.
05:04:49 <evincar> 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 <evincar> I guess this is the part where I say "I might have to make one!"
05:06:04 <evincar> s/(functional languages)/$1 that I like/
05:06:54 <evincar> Lately I've seen type systems as more of a gimmick than anything.
05:07:08 <CakeProphet> you don't know anything about type systems.
05:07:24 <evincar> I don't know much about Haskell.
05:07:39 -!- azaq231 has joined.
05:07:56 <evincar> Never written anything non-trivial in it.
05:08:34 -!- azaq23 has quit (Ping timeout: 260 seconds).
05:08:58 <pikhq_> CakeProphet: Aaah, how hackers talk when they don't want to be overheard. XD
05:09:04 <evincar> Generally speaking, yes. I don't know what you're getting at.
05:09:36 <pikhq_> Also, |)\34|_ #4><><0|)\5 |_|53 1337.
05:09:41 <CakeProphet> pikhq_: yeah that's totally how it works. thanks smart math show.
05:10:28 <evincar> A type system is gimmicky in that it serves only to enforce contracts that probably wouldn't have been violated anyway.
05:10:40 <evincar> Static typing requires type annotation at some point, even with type inference.
05:10:58 <evincar> So you do have up-front work to do.
05:11:13 <evincar> I just don't think it's necessary for all programs.
05:11:16 <CakeProphet> 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 <evincar> The notion of type error is tied to a type system, though.
05:11:49 <CakeProphet> 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 <pikhq_> No, a type error can happen otherwise. It's just nowhere near as *clear* that's what happening.
05:12:51 <evincar> So a type error in an untyped language is just a logic error.
05:12:58 <evincar> Or dynamically typed or what have you.
05:13:01 <pikhq_> Particular form thereof.
05:13:04 <CakeProphet> 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 <pikhq_> One where you're using the wrong *sort* of value in a place.
05:13:47 <evincar> I'm not saying type systems in general are bad, nor static type systems explicitly.
05:14:01 <pikhq_> You're saying it's "gimmicky".
05:14:03 <evincar> I just don't think the majority of software needs to be typed.
05:14:25 <pikhq_> You are one insane optimist.
05:14:28 <evincar> And that use of typing in software that *doesn't* need it is merely a gimmick.
05:14:41 <pikhq_> The majority of software needs as absolute much help as it can *get*.
05:14:42 <Patashu> Can you give an example of needing typing then?
05:15:03 <pikhq_> Most software is not merely poor, it is *terrible* and *fundamentally broken*.
05:15:33 <CakeProphet> 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 <pikhq_> A strong type system can make this less prevalent.
05:15:36 <evincar> Type annotations are great as an optimisation.
05:15:57 <CakeProphet> evincar: Haskell requires almost no type annotations. that's not an argument against a well-made type system.
05:16:18 <evincar> I just don't think that there's significant value to be gained by *omitting* features from a language, namely unrestricted typing.
05:16:33 <pikhq_> s/unrestricted typing/unrestricted memory access/
05:16:37 <pikhq_> Any further questions?
05:16:46 <evincar> That's not what I mean at all and you know it.
05:17:09 <CakeProphet> you mean weak typing or the ability to use the wrong type in the wrong place?
05:17:28 <evincar> More or less. I like being able to be wrong.
05:17:32 <EgoBot> Traceback (most recent call last):
05:17:34 <pikhq_> 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 <pikhq_> Most programmers, given power, will manage to summon nasal demons.
05:17:54 <evincar> Just in case I need to be "wrong" in that particular way at some point.
05:18:22 <pikhq_> Also, yes, you can do *really* nasty things to Haskell's type system if you want.
05:18:39 <pikhq_> This, for good reason, is neither the default nor encouraged.
05:19:29 <CakeProphet> 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 <pikhq_> CakeProphet: Maybe he wants the ability to be unintentionally wrong?
05:20:27 -!- kwertii has quit (Quit: bye).
05:20:50 <CakeProphet> 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:08 <evincar> I dunno, I just think it should be all-or-nothing.
05:21:20 <evincar> You stay out of my way or you give me powerful tools.
05:21:25 <hagb4rd> intermezzo: http://www.youtube.com/watch?v=3417VhdGScc
05:21:27 <evincar> And I've no doubt Haskell's tools are powerful.
05:21:39 <evincar> It's just not my cup of tea.
05:21:57 <CakeProphet> evincar: because it tells you at compile time when there's a type error? I don't understand.
05:22:33 <evincar> I mean, in a dependently-typed language, with enough type information, you can consider any error a type error.
05:23:20 <evincar> 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 <CakeProphet> >_> why are we talking about dependent typing now.
05:24:16 <evincar> It should be that either every error is a type error, or none is.
05:24:33 <evincar> Or so it seems to me at the moment.
05:25:10 <Patashu> if you run it it runs no matter what you put in
05:25:58 <evincar> Anyway, I'll look into getting Haskell to run on Bluehost.
05:29:36 <CakeProphet> parser is finsihed. time to move on the interpreter.
05:37:34 <CakeProphet> ...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 <CakeProphet> I think it is entirely stupid that Python has no sensible way to hide methods from an interface.
05:58:24 <CakeProphet> 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 <CakeProphet> monqy: help how do I use lambdabot to send messages to people.
06:14:29 <lambdabot> tell <nick> <message>. When <nick> shows activity, tell them <message>.
06:21:16 <lambdabot> words s = case dropWhile isSpace s of
06:21:16 <lambdabot> s' -> w : words s'' where (w, s'') = break isSpace s'
06:21:24 <pikhq_> @tell CakeProphet You tell me?
06:22:08 <lambdabot> CakeProphet: You have 2 new messages. '/msg lambdabot @messages' to read them.
06:22:09 <lambdabot> forall a. (a -> Bool) -> [a] -> ([a], [a])
06:22:20 <monqy> CakeProphet probabley telled privately.........
06:39:09 <lambdabot> quicksilver said 1y 2m 18d 19h 54m 29s ago: you use @tell
06:39:09 <lambdabot> pikhq_ said 17m 44s ago: You tell me?
06:39:35 <CakeProphet> lol, I apparently asked this question a year ago.
06:42:31 -!- azaq231 has quit (Quit: Leaving.).
06:50:55 -!- GreaseMonkey has quit (Quit: The Other Game).
06:55:35 <ais523> `addquote <CakeProphet> monqy: help how do I use lambdabot to send messages to people. [...around half an hour later...] <CakeProphet> @messages <lambdabot> quicksilver said 1y 2m 18d 19h 54m 29s ago: you use @tell
06:55:37 <HackEgo> 629) <CakeProphet> monqy: help how do I use lambdabot to send messages to people. [...around half an hour later...] <CakeProphet> @messages <lambdabot> quicksilver said 1y 2m 18d 19h 54m 29s ago: you use @tell
06:58:18 <ais523> the unnecessary accuracy on the date just makes it better
07:00:35 <ais523> interesting that lambdabot doesn't remind of messages if you miss the first "you have messages" message
07:00:41 <ais523> until another message is sent
07:02:55 -!- ais523 has quit (Remote host closed the connection).
07:33:16 <evincar> Although the last (and first) time I smoked a hookah was a bit extreme.
07:39:57 <CakeProphet> 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 <CakeProphet> by properly tokenizing the input before I begin constructing the AST.
07:40:25 <monqy> how about using a parser combinator library
07:41:15 <CakeProphet> but I would also like to be able to construct an elegant parser from scratch.
07:41:59 <monqy> hint it won't be elegant give up now
07:42:15 <evincar> I'm doing an experiment with an ugly parser at the moment.
07:42:21 <CakeProphet> it's already too late. This is not my elegant parser.
07:42:35 <CakeProphet> This is my first attempt to write a non-trivial parser, really.
07:42:49 <evincar> I thought "what's the most painful way to model parsing?"
07:42:58 <evincar> And to myself replied "iterators!"
07:43:08 <monqy> if it's nontrivial you shouldn't be writing it by hand
07:44:22 <monqy> 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 <CakeProphet> do most programming languages use parsing libraries for their parsers?
07:44:37 <monqy> "most programming languages"?
07:44:41 <monqy> do you mean most implementations?
07:44:47 <monqy> and how should I know
07:44:53 <monqy> though probably most of them use parser generators
07:45:00 <CakeProphet> do I really need to be explicit at every moment in every conversation?
07:45:02 <monqy> yacc/bison and its ilk
07:45:09 <CakeProphet> I can't just say "programming language" and get away with what I really mean?
07:46:26 <monqy> or wait was the lexer by hand too
07:46:29 <monqy> I think it may have been
07:46:37 <CakeProphet> 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 <monqy> do people really ask that?
07:47:08 <evincar> Paul Graham says the same thing occasionally.
07:47:09 <monqy> why are there so many natural languages why not just have one
07:47:15 <evincar> Because he has such a hard-on for Lisp.
07:47:46 <monqy> does he really say that in the same sense?
07:48:05 <CakeProphet> also is there any kind of lexer that adds structure to the output tokens?
07:48:05 <monqy> where the same sense is "i am genuinely puzzled by the existence of multiple programming languages"
07:48:50 <evincar> monqy: No, obviously not. He's just saying "Why doesn't everyone just use Lisp?"
07:48:54 <CakeProphet> seems like you could go ahead and get that step out of the way and simplify the parser
07:49:00 <evincar> Although he goes on to give very good reasons why not.
07:49:06 <monqy> evincar: yes that is a different sense
07:49:10 <monqy> evincar: a very different sense
07:49:19 <monqy> evincar: it's not even saying the same thing at all
07:49:33 <monqy> CakeProphet: what step
07:49:46 <evincar> Superficially it is. "Why so many? Why not just (this) one?"
07:49:59 <monqy> evincar: if superficially means using the same words
07:50:13 <evincar> Fine, I'll keep working on my bad parser.
07:50:15 <CakeProphet> monqy: the step of structuring the program by brackets, string literals, and so forth.
07:50:21 <evincar> I am why we can't have nice things.
07:50:56 <evincar> CakeProphet: You want a concrete syntax tree?
07:51:42 <evincar> That is, reflecting only the syntactic structure of the program, with any static meaning attached.
07:52:34 <CakeProphet> 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:53:44 <CakeProphet> in the lexer step, so that when you parse the full AST you already an idea of where things stop and end.
07:53:59 <monqy> that would complicate the lexer a lot, unless it's already really complicated
07:54:13 <evincar> Nah, it wouldn't be terribly complicated.
07:54:24 <evincar> See a "(", go down a level.
07:54:25 <monqy> and I'm not entirely sure what you mean by structing by brackets
07:54:26 <CakeProphet> monqy: but it would simplify the parser to a degree.
07:54:41 <evincar> See a "]" that doesn't match the "(" above you, error.
07:54:52 <evincar> It automagically takes care of nesting.
07:54:55 <CakeProphet> monqy: ....how does that not make sense. (stuff (goes here) ) is your input string
07:55:04 <CakeProphet> bam, now it is the token list ("stuff" ("goes" "here"))
07:56:14 <monqy> I wasn't sure what you meant by brackets
07:56:29 <CakeProphet> so now when the parser scans the tokens, it doesn't have to deal with parentheses.
07:57:08 <monqy> that isn't language-universal i hope you know
07:57:21 <monqy> anyway that's not the lexer's job; add another step if you want it
07:59:18 <monqy> while the added complexity to the parser of having to traverse the tree is pretty minimal, you have considered it, right
07:59:37 <monqy> anyway just use a parser combinator library
08:00:11 <CakeProphet> 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:01:19 <monqy> but when you aren't writing it all by hand, you ~don't have to worry~
08:01:35 <monqy> so what's your point
08:02:23 <CakeProphet> 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:50 <monqy> the virtues of hand-writing parsers?
08:03:03 <evincar> Consider it a learning experience.
08:03:05 <monqy> in such a case I'd hand write a parser combinator library, or at least a parser generator
08:03:18 <evincar> Consider it a research experience.
08:03:39 <monqy> I've had all the parser-handwriting experience I feel I need
08:04:25 <CakeProphet> perhaps I need more experience with "using appropriate libraries"
08:05:23 <CakeProphet> also what if I ever want to write a Perl implementation?
08:05:36 <monqy> what's so special about perl
08:06:04 <CakeProphet> I believe the parser must be Turing complete in order to be correct.
08:06:31 <CakeProphet> or at least perl's (the only implementation I know of) is.
08:06:55 <monqy> what do you mean by the parser being turing complee
08:08:16 <CakeProphet> I don't believe it can be statically parsed
08:09:36 -!- Patashu has quit (Ping timeout: 264 seconds).
08:10:53 <CakeProphet> this is probably why most Perl syntax highlighters are horrible.
08:12:39 <monqy> oh I've just never heard "turing complete" used in that sense
08:12:45 <CakeProphet> and: http://www.jeffreykegler.com/Home/perl-and-undecidability
08:12:47 <evincar> I don't think it's the right term.
08:12:52 <monqy> yeah that's probably why
08:16:36 <CakeProphet> I recall reading that the perl parser uses a number of hueristics to basically guess what the source code means.
08:17:32 <evincar> Those are largely unrelated.
08:17:39 <evincar> I mean, they both take place in the parser.
08:18:06 <CakeProphet> right, what I mean is that a parser library probably is not going to allow me to do that.
08:18:12 <evincar> But one is related to the fact that later code is subject to interpretation in the context of earlier code.
08:18:21 <evincar> While the other is just DWIM.
08:18:34 <evincar> Assuming an otherwise ambiguous situation.
08:18:58 <evincar> Which isn't so much "heuristics" as it is just the Principle of Least Surprise.
08:19:35 <monqy> heuristics of least surprise
08:21:50 <CakeProphet> large numbers of files and directories that I cannot navigate very well.
08:25:13 <CakeProphet> yeah I have no idea where to actually find the parser.
08:26:21 <monqy> what all #includes parser.h
08:27:35 <CakeProphet> U8expect;/* how to interpret ambiguous tokens */
08:28:02 <monqy> I wonder what they were thinking when they wrote perl
08:28:55 <CakeProphet> NEXTTOKE nexttoke[5]; /* value of next token, if any */
08:38:04 <CakeProphet> monqy: I bet they were thinking "man I want a practical extraction and report language"
08:38:31 <CakeProphet> okay so perly.c is where the actual parser is.
08:38:56 <monqy> also: because it has to be a godawful mess to be practical
08:39:07 <CakeProphet> http://perl5.git.perl.org/perl.git/blob_plain/HEAD:/perly.y
08:39:22 <monqy> %token <i_tkval> LOOPEX DOTDOT YADAYADA
08:39:33 <monqy> %token <i_tkval> COLONATTR
08:41:38 <monqy> anyway yadayada is best
08:43:09 <EgoBot> syntax error at /tmp/input.19173 line 1, near "{..."
08:43:47 <monqy> were you trying to see how that would lex?
08:44:12 <EgoBot> syntax error at /tmp/input.19287 line 1, near "..."
08:44:45 <monqy> presumably the ellipsis is metasyntax not literal perl???
08:45:25 <CakeProphet> no it says in perldoc that ... can stand-in for a statement and does nothing.
08:46:08 <CakeProphet> if lying is joking then I guess perldoc is pretty good joke
08:46:32 <monqy> good joke regardless. because perl. ha ha.
08:53:06 <CakeProphet> monqy: you laugh, but perl is the cutting edge in perl-oriented design.
08:54:32 <CakeProphet> http://perl5.git.perl.org/perl.git/blob_plain/HEAD:/regcomp.c
08:55:18 <CakeProphet> I32 naughty; /* How bad is this pattern? */
08:56:02 <monqy> i like the parts where it increments naughty
08:56:13 <monqy> what is naughty's purpose
08:58:03 <CakeProphet> in this file it just sets a naughty flag if it goes over 10
08:59:03 <CakeProphet> if (!(prog->intflags & PREGf_NAUGHTY)/* XXXX If strpos moved? */
08:59:52 -!- Phantom_Hoover has joined.
09:04:44 <CakeProphet> http://perl5.git.perl.org/perl.git/blob_plain/HEAD:/Configure
09:06:24 <monqy> "ARGGGHHHH!!!!!" - that file
09:07:55 -!- FireFly has joined.
09:08:08 <CakeProphet> if grep blurfldyick grimble >/dev/null 2>&1 ; then
09:08:09 <monqy> also me on that file
09:08:29 <CakeProphet> if grep blurfldyick grimble >/dev/null 2>&1 ; then contains=contains
09:09:01 <CakeProphet> elif grep grimblepritz grimble >/dev/null 2>&1 ; then contains=grep
09:09:13 <Phantom_Hoover> CakeProphet, configures are automatically generated, aren't they?
09:09:57 <Phantom_Hoover> monqy, that's a test of grep's behaviour, so they presumably just used the first word they could think of.
09:10:24 <monqy> they are bad at good words
09:11:05 <monqy> bug: grimble? really?
09:14:32 <CakeProphet> Dear Perl user, system administrator or package
09:14:33 <CakeProphet> maintainer, the Perl community sends greetings to
09:14:34 <CakeProphet> you. Do you (emblematical) greet back [Y/n]? n
09:14:52 <CakeProphet> # This question was auctioned at YAPC::Europe-2007 in Vienna
09:14:53 <CakeProphet> # I never promised you could answer it. I only auctioned the question.
09:21:23 <evincar> 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:46 <evincar> I don't know why I'm putting myself through this pain.
09:21:59 <CakeProphet> Configure is actually generating a config.sh
09:22:12 <CakeProphet> and Configure is generated from something called metaconfig.
09:35:29 <Phantom_Hoover> 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:43:38 <evincar> Alright, I've finally written enough boilerplate crap to safely write the useful(?) bit of this monstrosity.
09:44:18 <evincar> This is what I get for wanting lazy parsing in a language that is really, really not designed for it.
09:45:32 <monqy> why would you want anything in c++, except maybe a good language
09:47:32 <Phantom_Hoover> monqy, have you not heard of elliott's ventures into C++.
09:48:01 <monqy> I;ve heard of c++ sudoku, but I forget quite what it was
09:48:04 <monqy> nothing else I can remember
09:48:40 <evincar> Phantom_Hoover: This sounds entertaining.
09:48:58 <Phantom_Hoover> 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 <evincar> Well, after all that, parsing with iterators.
11:07:26 <evincar> Reduced the main method to: print(to_tokens(to_utf32(to_buffered(to_raw(stream)))));
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 <Phantom_Hoover> http://28.media.tumblr.com/tumblr_lgt3723bWm1qgcsjxo1_500.jpg
12:28:22 <oerjan> is it one those darn dang cultural references
12:41:34 <Phantom_Hoover> Patashu, the guys in the car look an awful lot like SBaHJ.
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:24:53 -!- wetneb has joined.
17:52:36 <Gregor> Phantom_Hoover: There only is one :P
18:03:38 -!- quintopia has quit (Ping timeout: 264 seconds).
18:05:47 -!- Phantom_Hoover has quit (Ping timeout: 245 seconds).
18:14:06 <pikhq_> Well, that's utterly surprising.
18:14:16 <pikhq_> Fun fact: Bochs does real mode faster than qemu.
18:14:19 -!- quintopia has joined.
18:14:38 <CakeProphet> that's because Boch knows how to keep it real.
18:18:00 <CakeProphet> !perl sub min($$){ my ($a,$b) = @_; [$a => $b]-> [$b <= $a] } print min(4,10)
18:18:22 <CakeProphet> !perl sub min($$){my($a,$b)=@_;[$a => $b]->[$b <= $a]} print min(4,10)
18:29:32 -!- sliddy has quit (Ping timeout: 245 seconds).
18:31:57 <CakeProphet> !perl sub min($$){my($a,$b)=@_ if @_;[$a => $b]->[$b <= $a]} print sort min, 5,4,3,2,1
18:32:17 <CakeProphet> !perl sub min($$){my($a,$b)=@_ if @_;[$a => $b]->[$b <= $a]} print sort {min} 5,4,3,2,1
18:32:17 <EgoBot> Not enough arguments for main::min at /tmp/input.28958 line 1, near "min}"
18:32:23 <CakeProphet> !perl sub min(;$$){my($a,$b)=@_ if @_;[$a => $b]->[$b <= $a]} print sort {min} 5,4,3,2,1
18:32:23 <EgoBot> Sort subroutine didn't return a numeric value at /tmp/input.29016 line 1.
18:32:49 <CakeProphet> hmmm, I thought $a and $b were special dynamically scoped variables. Ah, I guess not when I redeclare them with my
18:33:54 <EgoBot> No comma allowed after subroutine name at /tmp/input.29149 line 1.
18:34:14 <EgoBot> No comma allowed after subroutine name at /tmp/input.29207 line 1.
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 <zzo38> 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 <CakeProphet> zzo38: if you want, but I don't think people will buy it.
18:50:56 <CakeProphet> 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 <CakeProphet> 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 <CakeProphet> but that's not guaranteed to be an option in every situation like that.
18:53:02 <CakeProphet> f x = f' (g x) where f'(C1 a) = ...; f'(C2 b) = ...
18:53:20 <CakeProphet> more wouldn't allow you to add new patterns to f' because it's not in scope outside of f
18:54:03 <zzo38> 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 <zzo38> So you would add patterns by using more-notation with case-blocks.
18:54:55 <CakeProphet> what about in my example. how would it work there?
18:55:11 <CakeProphet> how do you specify which case expression you are modifying?
18:55:15 -!- Taneb|Kindle has joined.
18:56:23 <Taneb|Kindle> I have just made a discovery that could revolutionize the face of computing!
18:56:29 <CakeProphet> also I think you can do something similar to this with type families
18:56:40 <zzo38> 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 <zzo38> Cases = C3 c -> c + 1; Cases = _ -> 42;
18:57:34 -!- pikhq has joined.
18:58:05 -!- pikhq_ has quit (Ping timeout: 260 seconds).
18:59:23 <zzo38> CakeProphet: Did you notice anything else wrong? If so, I can try to describe those things too.
19:01:04 <CakeProphet> no, but I think type families is possibly a better solution to the kind of data type extension you want
19:03:13 <zzo38> 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 <Taneb|Kindle> I think the world needs a brainfuck-I hate your bf derivative I really do-MIBBLLII polyglot
19:07:28 <Taneb|Kindle> Somebody managed to write a Piet-Piet polyglot
19:08:38 <Taneb|Kindle> In Piet, it printed "Piet", and in Piet it printed "Hello, World!" I think
19:09:26 <lambdabot> elliott: You have 3 new messages. '/msg lambdabot @messages' to read them.
19:10:34 <Taneb|Kindle> It is near the bottom of the example Piet programs on dangermouse.net
19:11:10 <CakeProphet> between pod, __END__ markers, heredocs, arbitrary quote delimiters, and regular comments
19:11:20 <CakeProphet> 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 <Taneb|Kindle> I think perl is in many ways more esoteric than, eg, brainfuck
19:15:09 <Taneb|Kindle> Brainfuck isn't really that esoteric,come to think of it
19:15:30 <Taneb|Kindle> You can tell what it does just by looking at it
19:16:06 <Taneb|Kindle> That is morethan ca be said for languages such as Haskell or XSLT
19:19:45 <Taneb|Kindle> More people have heard of brainfuck than Mondrian or Visual J#
19:20:06 <elliott> I can tell what Haskell code does just by looking at it.
19:20:10 <elliott> That's called knowing Haskell. :p
19:27:07 -!- oerjan has joined.
19:27:22 <Taneb|Kindle> It seems to be everything this channe is against
19:27:49 <Taneb|Kindle> Except it is neither Python nor a brainfuc derivative
19:28:09 <oerjan> this channel is against python?
19:28:32 -!- derrik has joined.
19:28:43 <elliott> We need more cpressey and olsner so we can get the anti-Python flames brighter.
19:28:52 <elliott> Actually we need more cpressey full stop so we can have more cpressey.
19:29:35 <Gregor> And also, that's a poor description of it.
19:29:37 <CakeProphet> I can tell what Perl code does just by looking at it.
19:29:40 <Gregor> It was basically just Java.
19:30:01 <Gregor> CakeProphet: perl -wlne'END{print$n}eof&&$n++;/<title>([^<]+)/i&&$n--' *
19:30:28 <oerjan> CakeProphet: must be all your weed use
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:31 <oerjan> and i did it _without_ weed, even
19:33:14 <oerjan> it counts certain lines
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: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: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:13 <CakeProphet> and decrements when there IS a title loine
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: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:53:44 <CakeProphet> I don't really understand what is so experimental about \N
20:00:14 <CakeProphet> !perl "this is a test" =~ /.*?(?{pos})test/; print "this is a test" =~ /.{$^R}test/
20:01:03 -!- ais523 has joined.
20:01:29 <elliott> How Much of R is Written in R... (r-bloggers.com)
20:15:26 <CakeProphet> !perl @matches = "test" =~ /test/; print @matches
20:15:33 <CakeProphet> !perl @matches = "(test)" =~ /test/; print @matches
20:15:44 <CakeProphet> !perl @matches = "test" =~ /(test)/; print @matches
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: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:29 <ais523> () is a value, [] and {} are references
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: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: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: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 <lambdabot> forall (m :: * -> *). (Monad m) => Bool -> m () -> m ()
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: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: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: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: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 <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 <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: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: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 <elliott> <lambdabot> forall (m :: * -> *) (f :: * -> *). (Monad m, ?b::f Bool, Functor f) => f (m () -> m ())
20:33:38 <CakeProphet> [1] matched [a,b,c] matched and had groups
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: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:37:13 <ais523> more plausibly, m/(\d+)|NA/
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: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:54 <lambdabot> forall (m :: * -> *) (f :: * -> *). (Monad m, ?b::f Bool, Applicative f, ?c::f (m ())) => f (m ())
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:40 <CakeProphet> !perl @c = "test" =~ /(abc)|test/; print 1 if @c
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: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: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: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: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: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: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: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: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:53 <ais523> with the same spelling
20:50:58 <ais523> which is used is always obvious from context
20:51:08 <ais523> probably in Perl 6 too
20:51:13 <EgoBot> String found where operator expected at /tmp/input.6941 line 1, near "ptiny "sup""
20:51:24 <ais523> I wonder if you have a sub x, that it can always tell which is being used
20:51:34 <EgoBot> 1111111111111111111111111
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:54 <EgoBot> Warning: Use of "shift" without parentheses is ambiguous at /tmp/input.7239 line 1.
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:22 <ais523> a bit like comultiplication
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:15 <HackEgo> 558) <fungot> Phantom_Hoover: it is a hate so pure and... pumpkin seeds?
20:59:26 <elliott> copumpkin copumpkin copumpkin copumpkin copumpkin
21:00:07 -!- hagb4rd has quit (Ping timeout: 252 seconds).
21:01:45 <monqy> compile what? are you someone?
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: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:53 -!- derrik has quit (Quit: night).
21:16:48 <oerjan> if deac is not monadic then you cannot put it on the right of >> though
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:47 <elliott> deac <- mfix (\deac -> ...)
21:18:27 <lambdabot> forall a (m :: * -> *). (MonadFix m) => (a -> m a) -> m a
21:19:13 <lambdabot> forall a (m :: * -> *). (MonadFix m) => m a
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:31 <elliott> sometimes it is not even an monads...
21:21:42 <monqy> mappend is monoid too right
21:21:57 <monqy> sometimes i'm afraid i'll get mappend and mplus mixed up
21:22:35 <monqy> is help the a new fad help
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 <lambdabot> forall a (m :: * -> *) b. (Monad m) => (a -> m b) -> [a] -> m [b]
21:24:50 <monqy> or did I misinterpret "add monadic wrapping to the result types"
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: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:30 <fizzie> Helloes from the sweaty Florence.
21:26:40 <elliott> hello how are you enjoying your hotel of badness
21:26:42 <lambdabot> forall a (m :: * -> *). (MonadFix m) => (a -> m a) -> m a
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 <lambdabot> Occurs check: cannot construct the infinite type: t = [t]
21:28:40 <lambdabot> ["hhhh","hhhe","hhhl","hhhp","hheh","hhee","hhel","hhep","hhlh","hhle","hhl...
21:29:02 <lambdabot> ["help","ehlp","lehp","elhp","lhep","hlep","pleh","lpeh","leph","pelh","epl...
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: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: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: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:41:33 <EgoBot> "**************************************************"
21:42:48 <oerjan> Deewiant: THAT WASN'T THE POINT
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: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: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:36 <CakeProphet> I cannot think of a single use for such a reference.. lol
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:43 <elliott> mdo is still supported, just deprecated, IIRC
22:02:06 <oerjan> well you can still add them on the command line i guess
22:02:13 <elliott> I like how fillMemory uses mdo for no reason
22:02:39 <elliott> or maybe I just misunderstand mdo
22:03:03 <Deewiant> elliott: mem <- newMemory rArr prior to rArr <-
22:03:06 <oerjan> mem and rArr reference each other
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:58 <lambdabot> forall a (m :: * -> *). (MonadFix m) => (a -> m a) -> m a
22:17:35 <CakeProphet> instance MonadFix CakeMonad where mfix = ($undefined) --:3
22:21:16 <oerjan> CakeProphet: i think there are some MonadFix laws which that probably breaks
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:25:19 <oerjan> > length (return undefined)
22:26:45 <lambdabot> Source not found. My brain just exploded
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: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> 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:09 <elliott> instance MonadFix Lift where
22:28:10 <elliott> mfix f = let m = f (runLift m) in m
22:28:29 <oerjan> elliott: "in which return were strict"
22:28:38 <oerjan> your return isn't strict is it?
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:33 <oerjan> *mfix (return . (1:)) = return (1:undefined)
22:34:51 <CakeProphet> oerjan: also wouldn't it be possible to include laws as part of Haskell?
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: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: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: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:49 <pikhq_> elliott: Hurricane coming his way.
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 <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: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