Perl 6 - the future is here, just unevenly distributed

IRC log for #rosettacode, 2013-10-21

| Channels | #rosettacode index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:19 mwn3d joined #rosettacode
00:42 mwn3d1 joined #rosettacode
02:57 realazthat joined #rosettacode
03:09 BenBE joined #rosettacode
03:18 RRR2 joined #rosettacode
03:25 TimToady joined #rosettacode
04:50 * TimToady wonders if anyone will notice he was fixing ruby code... :)
05:12 eMBee :-)
05:20 ttmrichter TimToady: How do you distinguish between fixed Ruby code and Ruby code as-intended?
05:20 ttmrichter (Also, if you fixed my Ruby Turing Machine I thank you 'cause that was a horrific hack.)
05:22 TimToady nah, I just fixed Nigel's code in http://rosettacode.org/mw/index.php?title=Zhan​g-Suen_thinning_algorithm&curid=16497&​diff=169453&oldid=169427&rcid=192844
05:22 fedaykin "Difference between revisions of "Zhang-Suen thinning algorithm" - Rosetta Code" http://rldn.net/9nT
05:22 TimToady I felt bad because I'd earlier put in a comment pointing out exactly which line was wrong :)
05:24 TimToady (it was already marked incorrect for producing the wrong output, as it happened)
05:25 TimToady it does make me glad, however, that we don't have to use .each to iterate arrays in Perl 6 (though of course it would be spelled .map there instead)
05:26 TimToady .each seems to be one of those hammer things that make things look like nails :)
05:27 ttmrichter TimToady: Take a look at http://rosettacode.org/wiki/U​niversal_Turing_machine#Ruby and make it suck less?  :D
05:27 fedaykin "Universal Turing machine - Rosetta Code" http://rldn.net/tFlo
05:27 ttmrichter "foreach" and "map" do slightly different things in my book.
05:28 ttmrichter A map is a transformation (and is largely declarative in use) while a foreach is an imperative repetition.
05:28 TimToady wow, that diff I linked really got confused...
05:28 TimToady sez who?
05:28 TimToady in Perl 6 they are considered the same thing
05:28 ttmrichter I'd be uncomfortable using "map" to print out each value of a collection, for example.
05:28 ttmrichter And I'd have a problem with that.  Thankfully I don't use Perl6.  :)
05:29 TimToady well, I wouldn't use map for that anyway, but for different reasons :)
05:29 TimToady but mapping values to side effects is just as much a mapping as maping values to other values :)
05:30 ttmrichter I disagree.
05:30 ttmrichter But I come from an increasingly militant declarative position.  ;)
05:30 TimToady it's just values in the side-effect monad :)
05:31 ttmrichter Monads are just a Haskeller's way of saying "we're programming C code but don't want to admit it".  :P
05:32 TimToady well, and now who's denigrating declarations? :P
05:33 Hypftier I still see people asking why .NET's IEnumerable doesn't have ForEach (which List has) on SO. But somehow I tend to adapt my usage to the language, as I don't miss IEnumerable.ForEach in C#, but I use % in PowerShell for both foreach and map (for lack of distinct options).
05:34 TimToady but basically, the semicolon separating statements in Perl 6 puts the first statement into "sink" context, which declares that the statement is being evaluated only for its side effects, and in fact the compiler is allowed to complain if you use something pure in such a location
05:38 TimToady r: 42
05:38 camelia rakudo e55c66: ( no output )
05:38 TimToady r: 42; 43
05:38 camelia rakudo e55c66: OUTPUT«WARNINGS:␤Useless use of constant integer 42 in sink context (line 1)␤»
05:39 TimToady so if you use map in sink context, it's obvious to the compiler that you want it for the side effects
05:40 TimToady and the essence of computer language design is making things that are obvious to the computer obvious to the programmer, and vice versa
05:43 TimToady of course, different things are obvious to different people, which keeps life interesting :)
05:44 Hypftier (especially noticeable when things that are obvious to the writer of some code aren't obvious to a later reader [which sometimes even is the same person])
06:27 ttmrichter God I hate captchas.
06:28 ttmrichter Can someone vet this for readability?  http://rosettacode.org/wiki​/Function_definition#Prolog
06:28 fedaykin "Function definition - Rosetta Code" http://rldn.net/NoEB
06:30 TimToady seems fine to me
06:31 TimToady but then, sometimes things are obvious to me that are not obvious to other people (and vice versa), so perhaps you should get a second opinion :)
06:31 ttmrichter Anybody who's here.  :)
06:33 ttmrichter I just want to get across the idea that A) Prolog doesn't have functions, B) this can have advantages and C) that you can make it have functions if you really want.
06:35 TimToady B is perhaps the weakest so far
06:35 TimToady but then you might need to harp on unification a bit more for that
06:35 ttmrichter Which is a tad out of scope at this point.
06:36 ttmrichter I could write a whole essay on how your predicate is its own test framework.  :)
06:36 TimToady maybe just the point that a function can only go one direction, whereas these can proceed in whichever direction there are holes :)
06:36 TimToady or maybe you said that and I spaced out
06:36 ttmrichter Sadly that's not possible once you have "is/2".
06:36 ttmrichter is/2 is a bit of a blight on Prolog's declarative nature.
06:37 ttmrichter The only way to make any code that has is/2 reversible is to use var/1 to write the reverse case manually.
06:37 TimToady that must mean it's a monad of some sort :P
06:37 ttmrichter Nah, it's more a uniqueness type.
06:38 TimToady Darn, I peeked at the cat, and it died!
06:39 TimToady wait, what am I doing in this box with a geiger counter and a vial of poison?
06:39 ttmrichter I think when the counter clicks you're supposed to smash the vial.
06:39 TimToady I...see...
06:40 TimToady fortunately, this is the universe in which I smash the counter first :)
06:41 TimToady unfortunately, I have only the vial to smash it with, or my face...vial, or face...vial, or face...hmm
06:44 ttmrichter Flip a coin.  Heads I win, tails you lose.
06:44 TimToady sounds like a cat's game to me
06:46 * TimToady should go off to bed so that he's asleep when his nightmares come true...
06:58 ttmrichter http://imgur.com/a/3XdPg
06:58 fedaykin "BASIC Infinite Loop Finder - Imgur"
10:34 ttmrichter joined #rosettacode
11:40 mwn3d joined #rosettacode
12:05 Koen_ joined #rosettacode
12:06 Koen_ joined #rosettacode
12:27 mwn3d1 joined #rosettacode
12:28 mwn3dsphonesucks joined #rosettacode
12:31 RRR2 joined #rosettacode
12:41 RRR2 joined #rosettacode
13:26 BenBE joined #rosettacode
13:26 RRR2 joined #rosettacode
13:38 mikemol|zoe joined #rosettacode
14:12 BenBE_ joined #rosettacode
14:18 RRR2 joined #rosettacode
14:25 RRR2__ joined #rosettacode
14:26 RRR2 joined #rosettacode
14:31 RRR2_ joined #rosettacode
14:38 RRR2_ joined #rosettacode
14:40 RRR2_ joined #rosettacode
15:46 RRR2_ joined #rosettacode
16:14 * TimToady confesses in public that he was wrong about Nigel's code, and that his fix only had the effect of reversing the order of the two passes
16:14 * TimToady shall strive not to be wrong again in this millennium :)
16:36 BenBE_ TimToady: Good to hear; wanna have some work to do on GeSHi to redeem yourself?
16:37 BenBE joined #rosettacode
16:39 TimToady Are you suggesting I translate it to Perl 6?  :D
17:13 BenBE TimToady: No, but there are still some language files awaiting review and fixing.
18:43 sorear joined #rosettacode
19:39 BenBE_ joined #rosettacode
20:35 RRR2 joined #rosettacode
22:16 mwn3d joined #rosettacode
22:22 mwn3d1 joined #rosettacode
23:33 mwn3d joined #rosettacode

| Channels | #rosettacode index | Today | | Search | Google Search | Plain-Text | summary