»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
flussence this makes no sense... `panda install Bailador` fails on test 05 with «No such method 'decode' for invocant of type 'Any'». The test runs fine when I run it manually 00:02
tadzik perl6 -Ilib t/test or perl6 -Iblib/lib t/test? 00:05
may be a precomp bug? :/
flussence -Ilib 00:06
tadzik yeah, try -Iblib/lib
flussence yeah, fails there 00:07
tadzik jnthn needs to be told, yea
00:11 MayDaniel left
flussence I wonder if the other problem I was having was caused by that too 00:12
00:12 cognominal left 00:17 rindolf left, cognominal joined 00:21 ServerSage left
japhb_ flussence, I'm thinking so; I'm getting precompile problems during panda's own bootstrap, when panda tries to compile itself (lib/Panda/Ecosystem.pm, in particular), after compiling its prereq modules: 00:39
When pre-compiling a module, its dependencies must be pre-compiled first.
Please pre-compile /home/geoff/git/rakudo/install/lib/parrot/4.10.0-devel/languages/perl6/site/lib/JSON/Tiny.pm
Given that it just did that halfway up the screen, I call shenanigans. 00:40
01:04 anuby joined 01:14 hypolin joined 01:38 geekosaur left 01:41 anuby left 01:42 anuby joined, geekosaur joined 01:44 japhb_ left 01:54 sorear joined 01:57 cognominal left 02:17 mst is now known as humbug, humbug is now known as mst 02:50 FROGGS left 03:03 FROGGS joined 03:07 orafu left, orafu joined 03:23 aindilis joined 03:36 colomon left 04:19 jaldhar_ joined
lue [backtracking] is that socket reading problem the reason why P6's SCGI module wouldn't work for me? ISTR noticing it didn't receive the entire message (although I never bothered to count how many bytes were returned) 04:23
04:49 aindilis left
alec what does the operator that looks like french quotation marks do? 05:16
it's like >>, but it's a single character
i can't type it because i'm in a TTY
i think it's called 'hyper'? 05:17
05:18 telex left
alec also, it's not possible to simply type it as >>, is it? does it have to be the special unicode char? 05:19
05:19 sftp left 05:20 telex joined
alec anyway, the character displays fine in my TTY, but i don't know how to type it... 05:20
the line i am trying to figure out is:
well, it's two lines:
my ($s, $t) = open('rosalind_hamm.txt').lines(); 05:21
05:21 colomon joined
alec say [+] ($s.comb Zeq $t.comb)>>.not>>.Int; 05:22
where >> is replaced by the character in question
doy for what it's worth, >> and » are interpreted the same 05:23
alec i see
yes
ok, that's comforting
doy everything has an ascii representation, there are just some things that look nicer when reading the code 05:24
alec ok
doy r: say [1.5, 2.5, 3.5]>>.Int
p6eval rakudo c8de2e: OUTPUT«1 2 3␤»
colomon it's the hyper meta-op, in this case it's basically the same as say [+] ($s.comb Zeq $t.comb).map({ $_.not }).map({ $_.Int })
alec ok 05:25
Z makes it a zip, right?
colomon though in theory the hyper version is allowed to operate in parallel while .map is sequential
alec ok
colomon Zeq is zipped eq, yes
alec my ($s, $t) = open('rosalind_hamm.txt').lines(); 05:27
that's the first line
colomon I'm not clear why you'd want to do Zeq and >>.not instead of just Zne
alec it's not my code
it's a solution to a rosalind.info problem
colomon yes, I understand that, generic "you". :)
alec ah 05:28
grondilu wrote it, dunno if he is a regular here
colomon he is
alec ok
the first line basically makes sense to me, and i know what the code is doing already because i had to do it in order to see the solutions 05:29
but the second line is not clear
what does [+] do?
i'm new to perl btw
colomon It adds list that follows. 05:30
05:30 telex left
alec i don't know any perl, but i like the look of perl6 so much that i desperately want to learn it 05:30
ok
colomon [+] is new to perl 6.
alec yeah
does having an $ mean it's a string?
colomon [ op] is the reduce meta-op.... so [+] 1, 2, 3 is the same is 1 + 2 + 3
alec ahh
colomon no, $ is just a normal scalar variable in perl
alec i see
ok
what does .comb do? 05:31
colomon with no arguments, it turns a string in a list of characters.
sorear alec: what language(s), if any, do you already know?
colomon r: say "Hello!".comb
p6eval rakudo c8de2e: OUTPUT«H e l l o !␤»
colomon sorear! \o/
colomon is relieved sorear++ is around, as colomon needs to get to bed
alec i can write/read python but i'm no python god
sorear 'eh, colomon.
alec and i'm very comfortable in bash 05:32
i've dabbled in haskell a bit
but i'm just at the level where i can read it and sorta get what's going on
sorear [+] = Prelude.sum
alec ok
colomon r: say ("Hello".comb Zeq "hello".comb) 05:33
p6eval rakudo c8de2e: OUTPUT«False True True True True␤»
sorear also foldl (+) 0
colomon r: say ("Hello".comb Zeq "hello".comb)>>.not
alec ahh
p6eval rakudo c8de2e: OUTPUT«True False False False False␤»
alec nice
sorear [foo] = foldl/foldr
alec yeah
colomon r: say ("Hello".comb Zeq "hello".comb)>>.not>>.Int
p6eval rakudo c8de2e: OUTPUT«1 0 0 0 0␤»
colomon r: say [+] ("Hello".comb Zeq "hello".comb)>>.not>>.Int
p6eval rakudo c8de2e: OUTPUT«1␤»
sorear it uses the operator's declared direction and neutral element
alec ahhhh
colomon should be the same as
alec yes
colomon r: say [+] ("Hello".comb Zne "hello".comb)>>.Int
p6eval rakudo c8de2e: OUTPUT«1␤»
colomon r: say [+] ("Hello".comb Zne "hello".comb) # or even 05:34
p6eval rakudo c8de2e: OUTPUT«1␤»
colomon (ne is "strings are not equal", just as eq is "strings are equal")
alec yes
r: say "Hello".comb 05:35
p6eval rakudo c8de2e: OUTPUT«H e l l o␤»
alec ok, i'm getting it i think
colomon okay, I've got to get to bed. good night, all
alec night colomon
05:36 telex joined
alec r: my $s = "hello"; my $t = "world; say [+] ($s.comb Zeq $t.comb)>>.not>>.Int; 05:36
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Unable to parse expression in double quotes; couldn't find final '"'␤at /tmp/RsSoCh6FwE:1␤------> y [+] ($s.comb Zeq $t.comb)>>.not>>.Int;⏏<EOL>␤ expecting any of:␤ method arguments␤»
alec hmm
why didn't that execute?
oops 05:37
r: my $s = "hello"; my $t = "world"; say [+] ($s.comb Zeq $t.comb)>>.not>>.Int;
p6eval rakudo c8de2e: OUTPUT«4␤»
alec ok
getting it now
r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb)>>.not>>.Int;
p6eval rakudo c8de2e: OUTPUT«1 1 1 0 1␤»
alec yeah
i still don't fully understand >> but that's because i don't fully understand the $_
sorear foo>>.bar => map (\x -> x.bar) foo 05:38
interpreting .bar as a method call
$_ is not involved
alec right, it's just that colomon described >>.not as being somehow equivalent to .map({ $_.not }) 05:40
is there a way to think of it in terms of sets and functions?
sorear that's the same as .map(-> $_ { $_.not }) 05:41
-> $foo { CODE } is how you write a lambda in perl 6
alec ok
sorear if you leave off -> $foo, -> $_ is assumed
alec yes, i've seen that in the one other perl6 snippet i've looked at
ok
but what is $_? is it familiar from perl5?
r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb); 05:42
p6eval rakudo c8de2e: OUTPUT«False False False True False␤»
alec r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb)>>.not; 05:43
p6eval rakudo c8de2e: OUTPUT«True True True False True␤»
05:43 geekosaur left
alec r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb)>>.Int; 05:43
p6eval rakudo c8de2e: OUTPUT«0 0 0 1 0␤»
alec r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb)>>.not.Int;
p6eval rakudo c8de2e: OUTPUT«5␤»
sorear alec: $_ is just an ordinary "anonymous" variable 05:44
alec ok
sorear alec: perl 5 uses $_ too in some cases. for instance (p5) for @list { $_ is valid here }
alec r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb)>>.not>>.Int;
p6eval rakudo c8de2e: OUTPUT«1 1 1 0 1␤»
alec ok
sorear er, for (@list) { $_ is valid here }
05:44 geekosaur joined
sorear you could of course also do for my $whatever (@list) { $whatever is valid here } 05:45
alec ok
sorear but for very short loops, for @stuff { $_++ } can be a nice saving
alec r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb).not.Int;
p6eval rakudo c8de2e: OUTPUT«0␤»
alec yes
r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb).not.>>Int;
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Confused␤at /tmp/RNnYdVJQ72:1␤------> "world"; say ($s.comb Zeq $t.comb).not.⏏>>Int;␤ expecting any of:␤ dotty method or postfix␤»
alec r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb).not>>.Int;
p6eval rakudo c8de2e: OUTPUT«0␤»
alec r: my $s = "hello"; my $t = "world"; say [+] ($s.comb Zeq $t.comb)>>.not>>.Int; 05:46
p6eval rakudo c8de2e: OUTPUT«4␤»
alec r: my $s = "hello"; my $t = "world"; say ($s.comb Zeq $t.comb)>>.not>>.Int; 05:47
p6eval rakudo c8de2e: OUTPUT«1 1 1 0 1␤»
alec i'm still a bit confused
doy which part don't you understand?
alec hmmm
do you think it's important to understand why >> does what it does in order to use it? 05:48
because if it's not, then i needn't bother i guess
doy what do you mean by "why"?
it does what it does because it's a useful thing to do on occasion
alec yes
i mean how it causes things to happen 05:49
how it actually functions under the hood
doy a lot of the point of >>. vs something like an explicit map is that you don't know how it works under the hood
if i understand things correctly
alec ok
flussence the important thing to understand about » is that it's allowed to do each item of the list in random order
doy that way, it's free to do things like parallelize the operation if possible
or do other things like that 05:50
as far as i'm aware, all current implementations just treat it as equivalent to a map, but that's not guaranteed 05:51
alec ok
how can i play around with rakudo on my own? 05:52
as a command interpreter?
flussence doy: nope, they actually randomise the order so that people don't depend on it behaving like map
doy flussence: ah, that's a good idea
alec: you can install it via your distro's package manager, or build it from source from the github repository 05:53
alec yes, i've got it
do i just start perl6 if i want an interpreter?
nvm 05:56
i got it
moritz \o 06:03
sorear o/ 06:06
alec ok, got a question regarding that stuff 06:13
r: my $s="suetohaueas"; my $t="zzzzzzozzzz"; say ($s.comb Zeq $t.comb).Int; 06:14
p6eval rakudo c8de2e: OUTPUT«11␤»
alec r: my $s="suetohaueas"; my $t="zzzzzzozzzz"; say ($s.comb Zeq $t.comb)>>.Int;
p6eval rakudo c8de2e: OUTPUT«0 0 0 0 0 0 0 0 0 0 0␤»
alec why does .Int alone make it 11?
doy the .Int method on arrays returns the length 06:15
alec aaah
i see
ok
that makes sense
thank you
where can i read about these methods?
06:15 skids left
doy not entirely sure where the most useful place is, but the language spec is here perlcabal.org/syn/ 06:18
looks like the Numeric section of S32 has some information
alec ok
ah, i already had that site open in a tab
06:24 quester joined 06:25 adu joined 06:27 skids joined 06:29 jokar joined 06:35 SamuraiJack joined 06:44 adu left 06:57 DaVe joined
DaVe ? 06:57
who am I?
06:57 DaVe is now known as Guest84522
Guest84522 where am I? 06:57
Why should I wait till next Christmas to get perl6 in production? 06:58
I have been waiting for 5 Christmases 06:59
07:02 Guest84522 left
moritz don't wait, just use it 07:08
sorear moritz: ey's gone 07:13
moritz noticed
07:14 xinming_ joined 07:17 xinming left 07:19 elkng joined
elkng "does Perl 6 compiler uses a slab allocator for internal memory management same as Perl 5 compiler ?" 07:20
moritz "how is compiler baby made?" 07:23
07:29 am0c joined 07:45 arkydo joined 08:04 ServerSage joined, GlitchMr joined 08:10 rindolf joined 08:15 kaare_ joined, SamuraiJack_ joined 08:17 SamuraiJack left 08:20 SamuraiJack_ left 08:21 SamuraiJack_ joined 08:30 SamuraiJack_ left 08:33 SamuraiJack_ joined 08:46 quester left 08:59 arkydo left 09:11 rummik joined, labster joined
labster Hi all. I've been following Perl 6 for a couple of years now, eagerly awaiting Christmas. Not that I'm a good enough programmer to make Christmas come any faster, so I haven't felt like contributing much. 09:14
though I finally got myself together, and decided to make a port of File::Find::Duplicates, because perl can always use more modules. github.com/labster/perl6-File-Find-Duplicates
moritz labster: cool 09:16
labster: I've given you commit access so that you can add the META.info URL to github.com/perl6/ecosystem/ 09:17
(to META.list) 09:18
labster oh, thanks. The code isn't that great yet, and I'm sure I lost most of the laziness in the evaluation, but hey, it works. at least on rakudo. 09:19
09:23 arkydo joined
doy does Test come with rakudo? 09:27
dalek osystem: 4699222 | (Brent Laabs)++ | META.list:
Added File::Find::Duplicates
09:28
moritz 09:32
v
labster according to S24, it does come with rakudo. At least it came with r* for me.
09:34 scottp joined 09:35 ShaluS joined
sorear doy: yes 09:36
doy what is the appropriate way to use rakudo after building it from a checkout
moritz make install
sorear doy: make install, then run it. PREFIX defaults to $PWD/install to make this work
moritz then put the install/bin dir into your $PATH
felher good morning, #perl6 09:37
sorear elkng: semantic error in question. perl 6 is a language with several implementations; neither rakudo nor niecza directly uses the system malloc for objects
elkng "moritz what is baby made?" 09:38
moritz oh, that was a question? I thought it was a quote
so I replied with a quote in kind
sorear elkng: why are you surrounding your questions with quotes?
09:39 FROGGS left
elkng sorear: I tryed it once 09:39
09:41 Psyche^ joined 09:45 ShaluS left, Patterner left, Psyche^ is now known as Patterner 09:50 arkydo left 09:52 SmokeMachine joined 10:04 hypolin left 10:07 Kharec joined 10:29 anuby left 10:46 labster left 10:51 Kharec left
masak g'day, #perl6 11:15
tadzik hey hey 11:18
elkng questions should be specifically aboutperl6 to post here ? 11:21
masak moritz: it's "compiler babby formed", not "baby made". :P 11:22
elkng: we're quite lenient about off-topic discussions. but it's good if you at least try to have some connection to Perl 6, yes. 11:23
11:23 rummik left 11:29 proller joined 11:36 proller left 11:39 proller joined
masak only two days left to sign up to p6cc2012! strangelyconsistent.org/blog/the-20...ng-contest 11:39
don't be left out. sign up now. :) 11:40
elkng is perl6 finished allready ? 11:42
11:43 mcglk left 11:46 FROGGS joined
masak elkng: I'll answer, but first: is Perl 5 finished already? 11:47
(I need to know your definition of "finished" here.)
FROGGS hi there 11:48
masak FROGGS! \o/ 11:49
FROGGS masak! \o/
:o)
11:49 proller left
elkng masak: is said perl6 was developed for very long period and how its now ? can be used as much as perl 5 ? 11:54
11:58 proller joined
FROGGS elkng: Perl 6 has not that much modules of course, but the language is ready and more powerful of course 11:58
and Perl 6 is as fast/slow as Perl 5 + Moose 11:59
masak FROGGS: er. 12:01
elkng: what FROGGS said except the last part. :)
elkng: I started using Perl 6 in earnest back in 2008. back then, the leading implementation had *lots* of bugs. 12:02
now, not so much. now it's very usable.
there are things missing, mostly in the modules camp.
and documentation is still lacking.
12:02 rummik joined
masak people are working on that. 12:02
FROGGS masak: whats wrong with the last part? 12:04
masak FROGGS: putting aside the fact that it's Rakudo/Niecza that's slow or fast, not Perl 6... 12:06
FROGGS: ...neither implementation beats Perl 5 in terms of runtime speed.
12:06 proller left
masak you must be thinking of startup speed. 12:06
huf what's rakudo/niecza's startup speed now? 12:07
masak but advertising that as "Perl 6 is as fast/slow as Perl 5 + Moose" is *wildly* misleading.
FROGGS masak: right, I mean rakudo in this case, not the spec
masak huf: Rakudo's is quite good nowadays. on the order of .3 seconds, I think.
huf oh, that *is* close to p5+Moose
masak FROGGS: because the spec can't be executed directly.
huf which is ~.25 on my box
masak huf: I shouldn't give hard figures like that. it will depend a lot on your hardware, of course. 12:08
look, someone likes Rakudo's new error messages: twitter.com/leed0/status/281887675...08/photo/1
FROGGS masak: there was a talk at YAPC::EU 2012 about speed comparision, rakudo was in some cases faster than Perl 5 + Moose, and IIRC it was not just about startup times
masak jnthn++
FROGGS: I'm sure there are isolated cases where Rakudo can compete, yes. 12:09
we're not yet at the point where we can pretend it can compete in all areas.
FROGGS ya, that is true
12:11 bbkr left
FROGGS FWIW, "Perl 6" or better its implementations is ready when there is an announcement saying that 12:12
and I believe this could be made already
masak sure. the *announcement* that Perl 6 implementations are ready could've been made at any time. 12:20
as early as the day after the announcement to start Perl 6 itself.
...doesn't make it useful. :)
...or true.
12:24 proller joined
masak the reality of it all is, and has always been, that there isn't a "ready" bit for Perl 6 and its implementations, which we have to inspect carefully and announce when it flips over to True. 12:25
instead, every day the implementations grow a little more useful, and will cover a few new use cases for a few new people. gaining in speed and stability. 12:26
the trick is to be clear about those new features, to blog about them and speak about them at conferences, and to craft informative release announcements. this will pull in the right people. 12:27
but I seriously don't believe in all this "ding! cake's done!" crap. sorry.
12:31 MayDaniel joined
FROGGS well, if you wanna wait for the day when there is no bug anymore in rakudo or niecza, then you can wait very long 12:31
is there a roadmap of important features that need to implemented in order to call it ready? 12:32
au wonders if such announcements can be made by anyone, whenever and wherever they found perl6 to be ready for their particular use. "cake's good enough for me here!" 12:33
FROGGS as you said earlier, a software is never complete and never will be stalled, so there must be made a decision at some point to call it ready
au: good point 12:34
masak FROGGS: bugs isn't a big blocker, and hasn't been for years. that was not what I was going for. 12:35
FROGGS: speed. user-facing documentation. a realistic connection to CPAN. those are the big three. 12:36
(that's my personal roadmap, mind)
FROGGS okay, I think I agree with these points
masak here's a roadmap for Rakudo: github.com/rakudo/rakudo/blob/nom/docs/ROADMAP 12:37
Niecza usually does planning in its release messages, but I see no such planning in v24's. 12:38
arnsholt au: I like that approach. Very distributed systems-ish
masak very anarchic. :)
but there's nothing stopping anyone from doing that already. 12:39
au yup. :)
masak some people have.
I think ingy did such a post.
blogs.perl.org/users/ingy_dot_net/2...ready.html
in *2010*.
timotimo :D 12:40
FROGGS hmmm, at work I use about 80 Perl 5 modules, I believe the half of them have not that many deps, maybe none at all... would be a cool thing to actually replace all that with Perl 6 code...
FROGGS writes his own roadmap
but I dont wanna write DateTime::SpanSet 12:41
NET::EMI (to send SMS) might be done in a day 12:43
masak FROGGS: I like this way of thinking. :) 12:44
12:51 proller left 12:52 proller joined
masak more precisely, the "what can I use Perl 6 for today, with what's there?" kind of thinking. 12:55
12:56 colomon left
FROGGS well, I recognized that Perl 6 code because of its OO nature is more readable as the crap I wrote years ago with Perl 5 12:56
so I hope it is easier to maintain 12:57
and doing new things is always cool and fun
Ayiko cake is fun! 13:00
FROGGS .oO( the cake is a lie ) 13:01
Ayiko it can also do useful stuff now and then :)
and cool things! (unlike what I need to use at work) 13:02
13:02 proller left 13:03 colomon joined, proller_ joined, proller joined, proller_ left 13:05 proller_ joined 13:08 proller left 13:09 cognominal joined 13:13 Khisanth left 13:19 pmurias joined 13:26 Khisanth joined
diakopter waves hi from an airport 13:44
tadzik hi hi
FROGGS hi 13:50
masak o/, diakopter 13:54
13:58 proller_ left 13:59 proller_ joined 14:02 elkng_ joined, elkng left 14:03 DrEeevil joined 14:04 elkng_ is now known as elkng 14:05 ivan`` left 14:06 ivan`` joined 14:13 PacoAir joined 14:25 pmurias left 14:31 denisboyun_ joined 14:37 jokar left 14:39 atrodo joined 14:48 am0c left 14:55 denisboyun_ left 15:06 dayangkun joined 15:07 dayangkun left, pmurias joined, dayangkun joined 15:14 cognominal left 15:16 stopbit joined 15:32 lorn left 15:34 lorn joined, grondilu joined 15:35 rummik left, rummik joined 15:36 isBEKaml joined 15:39 pmurias left 15:41 isBEKaml left 15:42 cognominal joined 15:47 werwerwer_ joined 15:50 werwerwer left, denisboyun_ joined 15:54 pmurias joined
pmurias jnthn: should pastie.org/5584751 produce a correct setting? 15:54
jnthn: I get pastie.org/5584758 when trying to load that 15:55
15:56 arkydo joined, lk joined 15:57 lk left
grondilu rn: say sqrt(9) ~~ Int 16:04
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«False␤»
masak rn: say sqrt(9) ~~ Num 16:07
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«True␤»
masak \o/
rn: say 2 ** 128 16:08
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«340282366920938463463374607431768211456␤»
masak rn: say sqrt 2 ** 128
p6eval niecza v24-12-g8e50362: OUTPUT«1.8446744073709552E+19␤»
..rakudo c8de2e: OUTPUT«1.84467440737096e+19␤»
16:12 am0c joined
masak apparently, the Lisp term for "macroish" is en.wikipedia.org/wiki/Fexpr 16:12
16:13 Chillance joined
pmurias masak: is "macroish" a term we define somewhere? 16:24
16:30 denisboyun_ left
masak people keep using it on the channel to mean "its operands look like ordinary parameters, but they're more like thunks" 16:30
examples: 'if', '&&', '||', '//', attribute initializations. 16:31
16:31 xinming_ is now known as xinming 16:32 denisboyun_ joined 16:33 pmurias left 16:36 bluescreen10 joined, pmurias joined 16:43 SamuraiJack_ left 16:46 denisboyun_ left 16:49 am0c left 16:53 bluescreen10 left 16:57 arkydo left 17:02 bluescreen10 joined 17:05 sftp joined 17:10 pmurias left 17:12 pmurias joined 17:17 alec left 17:35 proller_ left 18:04 REPLeffect left, REPLeffect joined 18:05 denisboyun_ joined 18:29 denisboyun_ left 18:42 cognominal left 18:49 snearch joined 18:51 arkydo joined 18:54 fgomez left 18:57 denisboyun_ joined 19:02 REPLeffect left 19:16 fgomez joined 19:24 arkydo left
doy rpn: class Foo { has Hash of Hash $.foo = {} }; Foo.new 19:26
p6eval pugs: OUTPUT«*** ␤ Unexpected "of"␤ expecting variable name␤ at /tmp/BfDFlYmEB9 line 1, column 22␤»
..niecza v24-12-g8e50362: OUTPUT«===SORRY!===␤␤Coercive declarations NYI at /tmp/24VpPs2B34 line 1:␤------> class Foo { has Hash of Hash⏏ $.foo = {} }; Foo.new␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1443…
..rakudo c8de2e: OUTPUT«Type check failed in assignment to '$!foo'; expected 'Hash+{TypedHash}' but got 'Hash'␤ in block at src/gen/CORE.setting:755␤ in method BUILDALL at src/gen/CORE.setting:733␤ in method bless at src/gen/CORE.setting:723␤ in method new at src/gen/CORE.setting:708…
doy am i misunderstanding how this works, or is this just not properly implemented yet 19:27
flussence I think typed hash/arrays aren't quite there 19:28
masak I don't recall seeing 'of' in working code. 19:32
19:32 denisboyun_ left
doy okay 19:32
it just looked like it was trying to work, so i wasn't sure 19:33
heh, and running that line in rakudo's repl makes it segfault once you exit 19:36
masak tries to reproduce that 19:37
19:37 rummik left
masak yep. 19:37
19:38 rummik joined
masak submits rakudobug 19:38
19:42 thou left
dalek ar: 1300bc2 | moritz++ | docs/announce/2012.12:
[announce] fix some numbers
19:46
19:49 Kharec joined 19:54 denisboyun joined
dalek ar: 0feb3a0 | moritz++ | tools/star/release-guide.pod:
add 2012.12 release to release-guide.pod
19:54
moritz Rakudo star 2012.12 released. 19:56
doy r: class Foo { method foo { self.bar; return }; method bar { for (1, 2, 3) -> $a { die "???" }; return } }; Foo.new.foo 19:59
p6eval rakudo c8de2e: OUTPUT«???␤ in method bar at /tmp/BvHMVayfXJ:1␤ in method foo at /tmp/BvHMVayfXJ:1␤ in block at /tmp/BvHMVayfXJ:1␤␤»
doy r: class Foo { method foo { self.bar; return }; method bar { for (1, 2, 3) -> $a { die "???" } } }; Foo.new.foo
p6eval rakudo c8de2e: ( no output )
doy r: class Foo { method foo { self.bar }; method bar { for (1, 2, 3) -> $a { die "???" } } }; Foo.new.foo
p6eval rakudo c8de2e: OUTPUT«???␤current instr.: 'throw' pc 329649 (src/gen/CORE.setting.pir:147534) (src/gen/CORE.setting:9196)␤called from Sub 'die' pc 34121 (src/gen/CORE.setting.pir:13473) (src/gen/CORE.setting:558)␤called from Sub '' pc 332 ((file unknown):187) (/tmp/bbLj_nOXKc:1)␤called …
doy ^^ another bug? 20:00
masak moritz++ # release!
doy: wh...
oh.
lazy for loop. 20:01
I'm telling you, that stuff is confusing to people.
TimToady++ suggested putting in a warning for that. may be a good idea. 20:02
doy i find it quite odd that a for loop behaves differently as the last statement in a block than it does anywhere else
that third one gets the error message wrong in any case 20:03
moritz I don't see the point of warning of laziness
either lazy is what we want; then we educate people
or lazy is not what we want; then I throw out the whole sink stuff
but warnings gives you the worst of both worlds 20:04
you can't really use the laziness because the warnings are annoying
but still you have to factor in the fact that stuff could be lazy
doy the confusing part here is that it's not always lazy 20:05
i mean, why does the first one work properly?
timotimo oh, a release! 20:06
masak doy: because the for loop isn't the last statement, the 'return' is. 20:07
doy oh right, i was thinking in terms of dynamic context, which i suppose isn't how perl 6 works 20:08
or wait
hmmm
yeah 20:09
i think
japhb (Thinking out loud ...) Is the unification of: for @a -> $b { ...} ---> @a.map: -> $b {...} a false one? Even though they *can* be computationally equivalent, is it doing the right thing in programmer's brains? Do we really just want a special form for map to avoid TTIAR (so it looks like a for does now) that does *not* like to be sunk?
.oO( Useless use of map in sink context )
20:10 Kharec left
doy for what it's worth, i would expect map to be lazy, but not for 20:10
colomon japhb: yeah, I've never been convinced the unification makes sense.
what doy said.
japhb agreed.
colomon to be more precise: I would expect for to be lazy in evaluating the list you want to loop over. But I would expect it to start looping right away. 20:11
doy what's the difference? 20:12
japhb colomon, I assume you mean so that you can 'last' out of a loop over an infinite sequence?
colomon what japhb said.
doy ah, right
colomon or return from it, or any of perl's many other flow control operationrs. 20:13
japhb Sure. :-)
xenoterracide question on Str.tc, I assume it's short for "Title Case" but is it Title Case? because I would say that ucfirst and title case imply different behaviors
japhb Flow control operators: We haz them.
20:14 denisboyun left
colomon xenoterracide: it's supposed to be title case, but how well it is currently implemented I do not know. 20:14
japhb xenoterracide, it is indeed titlecase. I believe the removal of ucfirst is because people *think* that is correct behavior, but in many languages it isn't. And we're trying to steer people towards default-correct behavior, rather than making them think about when it's correct and when not. 20:15
(Niecza may well have this better than Rakudo, because sorear++ spent a lot of time working through the Unicode specs, but I don't know for sure.)
xenoterracide hmm 20:17
doy so regardless of the lazy for issue, is the third snippet worth a bug report?
moritz xenoterracide: there are some languages where there is a special uppercase char for the start of the word, or something 20:18
xenoterracide interesting
japhb doy: There may already be one, since I'm pretty sure that's been seen before. Basically, VM errors should never escape raw all the way out to the user.
doy okay 20:19
xenoterracide well I'm off to job, maybe when I bore of games I'll get back to rakudo
japhb (Hence much time spent squashing any number of NPMCA (Null PMC Access) errors)
20:20 Kharec joined
doy so one more design sort of question 20:20
if i have an attribute in a role
and want it to have a strict type constraint, but allow more lax values in the constructor (which get coerced to a standard form)
what's the right way to do that
overriding new works, but doesn't really make a lot of sense in a role 20:21
masak so, your question is about coercion?
doy yeah
masak might help to talk around some small piece of code.
doy okay, sec
moritz you add a submethod BUILD to the role which calls a method that coerces the value before binding to the attribute?
doy moritz: oh, BUILD is run before attributes are assigned? 20:22
masak the new(-ish) syntax for coercien is TargetType(SourceType)
BUILD assigns the attributes.
moritz doy: BUILD is what binds the attributes
masak: but it's not properly implemented yet :(
doy BUILD runs from least derived to most derived though, doesn't it?
20:22 cognominal joined
doy so shouldn't the attributes already be bound by the time it gets to the BUILD in my class? 20:23
moritz yes, and no
moritz -> sleep
doy: have you read doc.perl6.org/language/objects#Obje...nstruction ? 20:24
really sleep&
doy i skimmed it a while ago
i'll read it over
masak roles don't enter into the type hierarchy. 20:26
they flatten into the class.
doy oh, so a BUILD is actually generated that assigns the attributes, if you don't write one 20:28
i was thinking that all happened at the base Object level
20:33 denisboyun_ joined 20:46 fgomez left, buubot_backup left 20:49 buubot_backup joined, SmokeMachine left
doy so i guess the issue i'm asking about involves typed hashes 20:51
i want to turn Foo.new(things => [$bar, $baz]) into assigning $.things = { $bar.name => $bar, $baz.name = $baz } 20:52
i'm not really clear on what would be involved to make something like that happen via the type system
(i want the type of $.things to be "Hash of MyApp::Thing") 20:54
masak r: class Thing { has $.name }; class Foo { has %.things; method new(@things) { my %things = map {; .name => $_ }, @things; self.bless(*, :%things) } }; my $bar = Thing.new(:name<bar>); my $baz = Thing.new(:name<baz>); say Foo.new(things => [$bar, $baz]).things.perl; 20:55
p6eval rakudo c8de2e: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in method new at /tmp/Buw_1Vw09H:1␤ in block at /tmp/Buw_1Vw09H:1␤␤»
masak ah.
r: class Thing { has $.name }; class Foo { has %.things; method new(:@things) { my %things = map {; .name => $_ }, @things; self.bless(*, :%things) } }; my $bar = Thing.new(:name<bar>); my $baz = Thing.new(:name<baz>); say Foo.new(things => [$bar, $baz]).things.perl;
p6eval rakudo c8de2e: OUTPUT«("bar" => Thing.new(name => "bar"), "baz" => Thing.new(name => "baz")).hash␤»
doy right, that's what i'm doing now
masak doy: goodenuf?
doy but $.things is defined in a role
and it'd be nice to be able to have that coercion be encapsulated in the role
i can't really have two roles that both override new like that 20:56
masak I'm not sure I know of a good trick to do .new-like stuff from a role. sorry. :/
doy okay
i'm just fiddling with some existing moose code, and in that code, it works by having a coercion on the type constraint 20:57
but i get the impression that that sort of thing works quite a bit differently in perl 6
20:58 denisboyun_ left
masak we don't fully have coercion on type constraints yet. 21:00
it's not yet implemented, I mean.
21:00 snearch left
doy okay 21:00
21:04 elkng left, GlitchMr left 21:20 raiph left 21:30 REPLeffect joined 21:32 kaare_ left 21:33 pmurias left 21:34 bbkr joined 21:50 rindolf left
masak 'night, #perl6 21:51
colomon o/ 21:52
21:53 aindilis joined
FROGGS wtf: www.ebay.de/itm/160914072789 ? 21:53
colomon is completely failing at paying his taxes for the month. 21:55
grondilu FROGGS: that's kind of racist 21:58
FROGGS racist/humor, something like that ;o) 21:59
I've seen black construction workers in a lego duplo box today, that is some sort of racism 22:00
the other ppl (bus driver, police men) are white
colomon finally got the taxes paid on the third try 22:02
FROGGS colomon: online payment? 22:03
colomon ETFS phone payment. 22:04
I've been using it for better than a decade, yet managed to completely screw it up twice this time around.
using it every month...
grondilu
.oO(yet I had laughed a lot when watching "the I.T crowd")
22:05 fgomez joined 22:06 pmurias joined
FROGGS it crowd is cool, ya 22:07
sorear colomon: what kind of taxes do you have to pay monthly? 22:10
22:10 cognominal left
grondilu is a bit curious about that as well 22:11
22:12 fgomez left 22:13 denisboyun_ joined
colomon sorear: state and federal withholding, social security, and medicare. 22:14
22:15 labster joined 22:20 cognominal joined 22:24 denisboyun_ left
labster How would I go about getting the inode of a path? 22:26
arnsholt The stat sytem call, I'd imagine 22:28
If it's not exposed via the .IO stuff somehow, you'll probably have to FFI stat(2) with NativeCall 22:30
22:30 denisboyun_ joined
labster stat and lstat are in the synopsis as methods for IO, but they're not exposed yet. 22:30
arnsholt Ah, right. Have you seen if they're implemented? 22:31
labster I assume they're being called somewhere, because :d and :f work
arnsholt It might not be too hard to fix up and a good Rakudo hacking first experience if it's reasonably simple
Unfortunately, I'm not terribly well acquainted with the IO stuff 22:32
22:32 thou joined
arnsholt If you're not afraid of an adventure, try finding out how :d and :f and friends are implemented 22:33
That should show how to implement it
labster Eh, I'm not either, but I'll take a look into it. I just made a port File::Find::Duplicates, but it's more of a port of fdupes than the p5 FFD, which is pretty low in features.
dalek rl6-bench: 1e9fcfa | (Geoffrey Broadwell)++ | bench:
Get rid of a reliable segfault/glibc dump by adding 'eager do ' to a few for loops. This ... bites.
22:36
arnsholt labster: If you check in a bit earlier tomorrow for example, there're probably more people around who do know the answers 22:38
A lot of the core devs are Europe-based, so it's getting a bit late
22:41 PacoAir left
labster yeah, I noticed... I've been lurking on the IRC logs for a while, before finally deciding to contribute. California here, so it's more "check late at night". 22:41
Timbus nqp::stat(nqp::unbox_s($.path), pir::const::STAT_EXISTS)
src/core/IO.pm line 38
doy what do people use to run test suites?
japhb I think the above perl6-bench commit has convinced me I don't want for loops to be lazy unless I ask for it. Sure, Rakudo/Parrot's failure mode for late evaluation (crashing) was bad, and that needs to be fixed. But it took me a really long time to nail down the problem, because my mental model of 'for' is strongly oriented towards default-eager instead of default-lazy. 22:43
.oO( We just need to get jnthn++ to move to California, and we'll have the timezone problem solved. :-)
22:44
doy, perl5's prove, usually. I thought I saw something about someone adding a native prove function to panda, but I dunno what happened with that. 22:46
doy how do you get perl5's prove to work with perl6?
japhb prove -e 'perl6', as I recall 22:47
skids japhb: Well, except that the whole idea of for loops returning a list is new in Perl6 in the first place.
pmurias perl5's prove works great 22:48
doy prove -e '../src/rakudo/install/bin/perl6 -I lib' t
the '-I lib' needs to be inside the -e option, but yeah
japhb skids, I like that it returns a list. I like the general mappish behavior. I don't like that it is as lazy as map, by default.
I want for to be a default-eager map 22:49
22:51 fgomez joined 23:03 denisboyun_ left 23:04 MayDaniel left 23:05 denisboyun_ joined 23:07 cognominal left 23:10 fgomez left, stopbit left 23:12 fgomez joined
doy hmmm 23:20
r: my $foo = "foo"; say $foo ~~ s/a//; say $foo; say $foo ~~ s/f//; say $foo 23:21
p6eval rakudo c8de2e: OUTPUT«True␤foo␤True␤oo␤»
doy why do both of those return True
how do you tell if a substitution successfully matched? 23:22
23:25 fgomez left
dalek rl6-bench: 64ba332 | (Geoffrey Broadwell)++ | bench:
Sigh, another 'eager do for' required to get sane semantics
23:31
23:31 whiteknight joined 23:32 thou left
dalek rl6-bench: a5ad579 | (Geoffrey Broadwell)++ | README:
Add a note in the prereqs section of the README about required Perl 6 modules
23:38
23:44 alec joined
alec is there a way i can open a flat text file and then automagically turn it into a hash from the perl6 prompt? 23:45
the flat text file in question is formatted like:
A 58583.989
B 494858.494
C 443839.393
and so on
of course, editing it into a perl6 script i can use %name= < (flat text) >; but the point is that i want to be able to read in data from the prompt 23:46
alec sees, on an unrelated note, two nicks in this channel from unix.stackexchange.com, geekosaur and xenoterracide... hi guys! 23:47
pmurias jnthn: fix the problem by passing :target('pir')
23:48 Kharec left, Kharec joined
Ayiko alec: my %h = (slurp 'filename').split(/\s+/); 23:49
japhb alec, perhaps "%name = slurp($filename).comb(/\S+/)" ?
Ayiko lol
japhb heh
alec ok
flussence %( open('input').lines.map(*.split(/\s+/, 2)) )
japhb "Great minds think in complementary operations"?
alec lol
thanks guys, i'm sure one of those will fit the bill
alec has to admit, perl6 is probably the first programming language he's ever actually fallen in LOVE with 23:50
Ayiko doy: I hoped $/ would help for making the difference, but unsuccessful match doesn't seem to reset $/ 23:51
alec is there any syntactic reason to use % over $ when defining a hash, or is it just more readable that way?
japhb r: say "I \x[2665] Perl 6" 23:52
p6eval rakudo c8de2e: OUTPUT«I ♥ Perl 6␤»
japhb alec: % improves readability, but also constrains the variable to an Associative container 23:53
alec ok 23:54
japhb And also implies list assignment
alec ok
i'm also just blown away by how, from the raukdo interpreter, i can start typing a filename, and get tab completion
that's just too good to be true
programming languages aren't supposed to be that cool 23:55
geekosaur but I'm not very active there of late... life still to ****ed up atm :/ 23:58
flussence actually that's just because nobody bothered to change the default libreadline behaviour in the repl