»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
00:04 denis_boyun left, pmurias left
clsn r: role R[::T] { method f { say ~T } }; R.f 00:32
camelia rakudo-moar 347c9a: OUTPUT«None of the parametric role variants for 'R' matched the arguments supplied.␤Cannot call ''; none of these signatures match:␤:(Mu , Mu )␤ in any specialize at src/gen/m-Metamodel.nqp:2173␤ in any at src/gen/m-Metamodel.nqp:2464␤ in any at sr…»
..rakudo-parrot 347c9a: OUTPUT«None of the parametric role variants for 'R' matched the arguments supplied.␤Cannot call ''; none of these signatures match:␤:(Mu , Mu )␤ in any specialize at gen/parrot/Metamodel.nqp:2243␤ in any at gen/parrot/Metamodel.nqp:2541␤ in any a…»
..rakudo-jvm 347c9a: OUTPUT«None of the parametric role variants for 'R' matched the arguments supplied.␤Cannot call ''; none of these signatures match:␤:(Mu , Mu )␤ in any specialize at gen/jvm/Metamodel.nqp:2166␤ in any at gen/jvm/Metamodel.nqp:2462␤ in any at gen/jvm…»
clsn r: role R[::T=Any] { method f { say ~T } }; R[Int].f
camelia rakudo-jvm 347c9a, rakudo-moar 347c9a: OUTPUT«use of uninitialized value of type Int in string context␤␤»
..rakudo-parrot 347c9a: OUTPUT«use of uninitialized value of type Int in string context in method f at /tmp/RhRxYWvC8e:1␤␤␤»
clsn Hm. when I did it locally I got a never-ending string of "uninitialized value..." stuff. 00:33
r: "a" ~~ /a*?: a/ 00:34
camelia rakudo-parrot 347c9a: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter : (must be quoted to match literally)␤at /tmp/Cf2y6NNjZ0:1␤------> "a" ~~ /a*?:⏏ a/␤Unable to parse regex; couldn't find final '/'␤at /tmp/Cf2y6NNjZ0:1␤-----…»
..rakudo-moar 347c9a: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter : (must be quoted to match literally)␤at /tmp/9fbouQGVOw:1␤------> "a" ~~ /a*?:⏏ a/␤Unable to parse regex; couldn't find final '/'␤at /tmp/9fbouQGVOw:1␤------>…»
..rakudo-jvm 347c9a: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter : (must be quoted to match literally)␤at /tmp/jrTo9vjJcN:1␤------> "a" ~~ /a*?:⏏ a/␤Unable to parse regex; couldn't find final '/'␤at /tmp/jrTo9vjJcN:1␤------> …»
clsn also weird; I got a Null PMC Access on that. 00:35
lue idly wonders if perl6-examples/bin and perl6-examples/lib can be removed with no/minimal damage. 00:37
00:38 ajr_ left 00:48 Mouq joined 00:51 raiph left 00:53 Mouq left
dalek pan style="color: #395be5">perl6-examples: f227573 | lue++ | module-management/Fletcher.pl:
Modernize Fletcher.pl

Just adding P6-isms here and there.
00:53
00:55 jnap left 00:58 thou left 00:59 btyler left
moritz m: say 42 01:09
camelia rakudo-moar 347c9a: OUTPUT«42␤»
01:11 jnap joined 01:46 shelfc joined 01:48 shelfc left 02:00 Mouq joined 02:02 jeffreykegler1 left
[Coke] rt.perl.org/Ticket/Display.html?id=120511 - is this an nqp bug or a rakudo bug 02:05
02:05 Mouq left
[Coke] m: sub s () { given 9 { return 0 when $_ %% 3; 1 } }; say s 02:05
camelia rakudo-moar 347c9a: OUTPUT«===SORRY!=== Error while compiling /tmp/ag0yDBP3BL␤Null regex not allowed␤at /tmp/ag0yDBP3BL:1␤------> 9 { return 0 when $_ %% 3; 1 } }; say s⏏<EOL>␤ expecting any of:␤ argument list␤ pre…»
[Coke] m: class A {has $.a = $^b + 1;has $.b = $^a }; say A.new(1,2).a 02:13
camelia rakudo-moar 347c9a: OUTPUT«Default constructor for 'A' only takes named arguments␤ in method new at src/gen/m-CORE.setting:830␤ in method new at src/gen/m-CORE.setting:826␤ in block at /tmp/_doCgKhSvP:2␤␤»
[Coke] m: class A { has $.a = $^b }; A.new
camelia rakudo-moar 347c9a: OUTPUT«Cannot assign a null value to a Perl 6 scalar␤ in block at src/gen/m-CORE.setting:899␤ in method BUILDALL at src/gen/m-CORE.setting:927␤ in method bless at src/gen/m-CORE.setting:839␤ in method new at src/gen/m-CORE.setting:827␤ in method n…» 02:14
dalek ast: a7e1209 | coke++ | S03-junctions/misc.t:
Add a test for RT #101124
02:19
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=101124
02:20 araujo left 02:24 ggoebel1112 joined 02:25 ggoebel1111 left
dalek atures: e88259c | (Timo Paulssen)++ | features.json:
more search&replace fixes
02:32
02:32 centrx joined 02:33 camelia left
centrx uh, woops 02:34
02:34 camelia joined 02:36 ChanServ sets mode: +v camelia
dalek atures: 82c3552 | (Timo Paulssen)++ | features.json:
a few features missing in rakudo-moar still
02:40
timotimo hello centrx. what's wrong?
centrx timotimo, I sent the bot the evalbot example in the header, and it quit, so I thought I crashed it, but it returned! 02:41
timotimo oh? haha :) 02:42
perl6: say 3;
02:42 camelia left
timotimo wow, that's not good at all 02:42
but the bot is kinda robust 02:43
as in: it will restart itself if need be
02:44 camelia joined, BenGoldberg joined, ilbot3 left 02:45 ChanServ sets mode: +v camelia
timotimo r: say 3 02:46
camelia rakudo-parrot 347c9a, rakudo-jvm 347c9a, rakudo-moar 347c9a: OUTPUT«3␤»
02:46 ilbot3 joined
timotimo n: say 3 02:46
camelia niecza v24-109-g48a8de3: OUTPUT«3␤»
timotimo p: say 3
camelia rakudo-parrot 347c9a: OUTPUT«3␤»
timotimo so what's causing it? o_O
also, at this point we may think about having it output "rakudo-{parrot,jvm,moar} 347c9a:" instead of spelling it out completely 02:47
with 3 backends, it gets pretty long
02:49 jeffreykegler joined 02:52 prevost joined 02:53 jeffreykegler left, araujo joined, araujo left 02:56 raiph joined
diakopter what's the name of the rakudo master branch 03:02
03:02 jnap left
[Coke] nom 03:11
it's the default when you clone.
03:14 camelia left 03:15 camelia joined 03:17 ChanServ sets mode: +v camelia, camelia left 03:18 camelia joined 03:20 ChanServ sets mode: +v camelia 03:25 jeffreykegler joined 03:27 camelia left 03:29 camelia joined, kaleem joined
BenGoldberg p6: say 1 03:30
03:30 ChanServ sets mode: +v camelia
camelia rakudo-parrot 347c9a, rakudo-jvm 347c9a, niecza v24-109-g48a8de3: OUTPUT«1␤» 03:30
..raudo-moar: OUTPUT«No command line given␤ at lib/EvalbotExecuter.pm line 176␤ EvalbotExecuter::_auto_execute(undef, 'say 1', 'GLOB(0x1a73718)', '/tmp/UfimRKrzyJ', 'raudo-moar') called at lib/EvalbotExecuter.pm line 114␤ EvalbotExecuter::_fork_and_eval('say 1', undef, 'raudo-mo…»
03:31 Mouq joined
diakopter o_O 03:31
raudo-moar?
03:33 jnap joined 03:36 raiph left 03:37 jnap left 03:54 FROGGS left 03:58 dayangkun left 03:59 dayangkun joined, stevan_ joined 04:00 cognominal left 04:01 cognominal joined 04:11 mtk left, preflex left, preflex_ joined, ChanServ sets mode: +v preflex_ 04:12 preflex_ is now known as preflex 04:13 centrx left 04:15 stevan_ left
colomon diakopter: oh yes 04:15
04:16 prevost left
colomon m: say 1 04:16
camelia rakudo-moar 347c9a: OUTPUT«1␤»
colomon m: say (1..20).map(* ** 2)
camelia rakudo-moar 347c9a: OUTPUT«1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400␤»
diakopter m: say (1..20).map(* ** 99) 04:17
camelia rakudo-moar 347c9a: OUTPUT«1 633825300114114700748351602688 171792506910670443678820376588540424234035840667 401734511064747568885490523085290650630550748445698208825344 1577721810442023610823457130565572459346412870218046009540557861328125 108886437250011817682781711193009636756190…»
diakopter m: say (1..20).map(* ** 9999)
camelia rakudo-moar 347c9a: OUTPUT«1 99753155844037919244187108134179254191174841594309622742600447492647194151109733159599808420180972989496655647116045621357782456747068905587968929660481619789278650233968972633826232756330299477602750434590966557712543042303090523427545374330448124440452…»
colomon p: say (1..20).map(* ** 9999)
camelia rakudo-parrot 347c9a: OUTPUT«1 997531558440379192441871081341792541911748415943096227426004474926471941511097331595998084201809729894966556471160456213577824567470689055879689296604816197892786502339689726338262327563302994776027504345909665577125430423030905234275453743304481244404…»
04:18 mtk joined 04:19 FROGGS joined 04:24 mtk left
timotimo i'm now mildly interested in trying out google nativeclient for bringing a moarvm to the browser 04:30
for file i/o and communicating with javascript in the browser, one needs to code in c++, though ... and i'm not very experienced with mixing c and c++ in one binary 04:33
04:34 jnap joined 04:36 FROGGS left 04:38 jnap left
BenGoldberg rn: my ($a, $n, $g, $z) = (1, 1, 1/sqrt(2), .25); for (1..5) { my ($x,$y) = (($a+$g)/2, sqrt($a*$g)); $z -= $_ * $_ * $n for $x - $a; $n += $n; ($a, $g) = ($x, $y); say $a * $a / $z; } 04:39
camelia rakudo-parrot 347c9a: OUTPUT«3.18767264271211␤3.14168029329765␤3.14159265389545␤3.14159265358979␤3.14159265358979␤»
..rakudo-jvm 347c9a, niecza v24-109-g48a8de3: OUTPUT«3.1876726427121085␤3.1416802932976537␤3.1415926538954473␤3.141592653589794␤3.141592653589794␤»
BenGoldberg m: my ($a, $n, $g, $z) = (1, 1, 1/sqrt(2), .25); for (1..5) { my ($x,$y) = (($a+$g)/2, sqrt($a*$g)); $z -= $_ * $_ * $n for $x - $a; $n += $n; ($a, $g) = ($x, $y); say $a * $a / $z; } 04:40
camelia rakudo-moar 347c9a: OUTPUT«3.187673␤3.14168␤3.141593␤3.141593␤3.141593␤»
04:52 skids joined 05:08 FROGGS joined 05:24 FROGGS left 05:26 [Sno] left 05:28 kaleem left 05:30 hypolin joined, hypolin left 05:35 jnap joined, jeffreykegler left
ingy timotimo: I just finally updated github.com/acmeism/RosettaCodeData 05:37
timotimo that's one hell of a diff :D 05:39
ingy :\
05:39 jnap left
ingy my plan is to redo it so that every edit since 2007 is a commit with the correct date etc 05:40
and cron it too
it took me a while to do this time because I had to fix a number of pages
that broke the Script 05:41
it happens
h
s
05:43 hophacker joined
timotimo wow, that's ambitious 05:44
ingy it's just the right thing to do 05:46
unfortunately I have had enough ambition to actually do it :)
not really that hard though
timotimo :) 05:47
ingy I've already wrote the code to grab every rev of every page
took 24h to run iirc :) 05:48
05:48 BenGoldberg left
timotimo it might be a good idea to run it on the actual server that hosts the wiki to reduce cost or something? 05:48
ingy I cleared it with mikemol first 05:49
he was fine with it
timotimo of course
05:51 FROGGS joined 05:55 hophacker left 05:59 FROGGS left 06:10 kaleem joined 06:15 FROGGS joined 06:21 arnsholt left 06:24 Woodi joined, [Sno] joined 06:35 jnap joined 06:40 jnap left 06:49 raiph joined 06:54 arnsholt joined 06:56 xinming joined
moritz evalbot control restart 06:56
06:56 camelia left 06:57 camelia joined 06:58 ChanServ sets mode: +v camelia, xinming_ left
ingy If I just built rakudo-star with: 'perl Configure.PL; make; make install' and I want to change the install location, what do I need to (re)do? 06:59
moritz you have to start with perl Configure.pl --prefix=... 07:00
07:00 samebchase left 07:01 samebchase joined 07:10 FROGGS left
ingy moritz: oi. that's suck :\ 07:13
I mean, sucks to be me…
07:15 darutoko joined
ingy the whole install with parrot take 4evah 07:21
07:30 raiph left 07:36 jnap joined 07:42 jnap left 07:57 ilogger2 joined, ChanServ sets mode: +v ilogger2 07:58 FROGGS joined 08:02 zakharyas joined
hoelzro ahoy #perl6 08:07
moritz \o hoelzro
masak mornin', #perl6 08:08
moritz masak o/
ingy \oXo/ 08:10
timotimo ahoihoi 08:12
08:17 dmol joined
hoelzro morning masak, moritz, ingy, timotimo 08:17
08:25 SamuraiJack joined 08:33 pdcawley joined 08:40 hummeleBop joined
jnthn o/ 09:22
Wow...snow! :)
hoelzro sneeuw? 09:23
sjn snöw!
Or as we say in Norway - "Tiddelibom" 09:24
moritz wow, a reference I get! 09:26
09:32 daniel-s_ joined
sjn moritz: Be careful, or you'll turn into a Norwegian! o_O 09:35
09:36 daniel-s_ left 09:38 jnap joined 09:42 daniel-s__ joined, jnap left 09:49 daniel-s__ left 09:50 daniel-s__ joined 09:54 pecastro joined 09:55 daniel-s__ left, denis_boyun joined 09:56 daniel-s__ joined 10:05 daniel-s__ left 10:06 daniel-s__ joined 10:07 fhelmberger joined
masak doesn't get "Tiddelibom", and is unsure whether to be annoyed or proud :P 10:12
sjn masak: "Det snør, det snør, Tiddelibom | Det er det det gjør, Tiddeibom | Det snør så mye mer enn før | Tiddelibom og hutte-meg-tu" 10:15
masak: Torbjørn Egner children's song 10:16
masak oh!
masak tries to find it on YouTube
sjn masak: www.barnesanger.no/det-snor-det-snor.html
masak cute :) 10:17
closest I got with duckduckgo was "Det klør, det klør, tiddelibom..." :P
sjn heheheh 10:18
masak ok, cultural reference acquired. thank you. 10:19
sjn And if you play the guitar; nortabs.net/tab/719/
moritz I don't, but my wife 10:20
frettled masak: based on Winnie the Pooh, Egner translated the story to Norwegian
sjn yep
frettled Nalle Puh? in Swedish? 10:21
10:21 rindolf joined, lue joined
frettled Indeed, my memory did not fail me this time. 10:21
masak frettled: aye. interesting! 10:28
10:28 daniel-s__ left
masak we don't have our own translation of that. 10:28
and "snöar" has two syllables, so one isn't as obvious, I guess. 10:29
10:29 daniel-s__ joined 10:33 erkan joined, daniel-s__ left 10:34 daniel-s__ joined 10:37 atroxaper joined 10:38 jnap joined 10:40 daniel-s__ left, daniel-s__ joined 10:43 jnap left
jnthn nqp: say(+~42) 10:49
...
moritz ENOCAMELIA
jnthn Well, it just quit... 10:50
moritz "Lost connection to server irc.freenode.org"
10:50 camelia joined
moritz nqp: say(+~42) 10:50
10:51 ChanServ sets mode: +v camelia
camelia nqp-jvm, nqp-parrot: OUTPUT«42␤» 10:51
..nqp-moarvm: OUTPUT«Can't chdir to './rakudo-inst/bin/nqp-m %program': No such file or directory at lib/EvalbotExecuter.pm line 163␤ EvalbotExecuter::_auto_execute('HASH(0x175e9b0)', 'say(+~42)', 'GLOB(0x1969ab0)', '/tmp/nFBhs8xYEn', 'nqp-moarvm') called at lib/EvalbotExecuter.pm l…»
10:51 logie joined
moritz why would it want to chdir there? 10:51
10:52 fhelmberger_ joined
jnthn No idea... 10:53
moritz because I messed up, that's why
dalek albot: a231462 | moritz++ | evalbot.pl:
fix nqp-m
albot: 73d4e42 | moritz++ | evalbot.pl:
Merge branch 'master' of github.com:perl6/evalbot
10:53 camelia left
dalek albot: 5ad7f7c | moritz++ | evalbot.pl:
forgot a comma, moritz--
10:54
10:54 camelia joined
moritz nqp: say(+~42) 10:54
10:54 fhelmberger left 10:55 daniel-s__ left, ChanServ sets mode: +v camelia
camelia nqp-moarvm, nqp-jvm, nqp-parrot: OUTPUT«42␤» 10:55
10:57 daniel-s__ joined
colomon p6: say 1 11:03
camelia rakudo-parrot 347c9a, rakudo-jvm 347c9a, rakudo-moar 347c9a, niecza v24-109-g48a8de3: OUTPUT«1␤»
dalek kudo/nom: 6116a7f | jnthn++ | src/Perl6/ (2 files):
Fix $/ access in code blocks on Moar.

Probably fixes it for JVM too.
11:04
11:12 daniel-s__ left
FROGGS cool! 11:12
jnthn Seems that fixed the try.t crash too :) 11:13
11:13 daniel-s__ joined
lizmat seems I can't build rakudo-m on Mavericks 11:14
gist.github.com/lizmat/8471778
any ideas anyone?
jnthn lizmat: Yes, somebody needs to understand linking on OSX enough to figure out what's missing/wrong. 11:15
lizmat: The symbols it can't find are from the libmoar or whatever it ends up called 11:16
11:16 hoverboard joined
lizmat ah, so it could be something as simple as it not being able to find libmoar 11:16
jnthn lizmat: Yeah, or maybe a missing linker flag 11:17
11:18 LLamaRider joined
FROGGS or maybe we build the libs for the wrong arch, this happens pretty easy 11:18
jnthn Or that.
FROGGS I really hate osx when it comes to build libs... even BSD is nicer there 11:19
arnsholt IIRC, there's something on OS X (Darwin really) about libraries needing to know -where- they'll be installed 11:23
11:23 atroxaper left
arnsholt If we copy libs around on install, that'll break things IIRC 11:23
lizmat this is pre-install even, afaict 11:25
this is just "make" failing 11:26
or do you mean, as part of nqp-m ?
hmmm...
jnthn lizmat: No, we're talking about the shared lib Moar builds, I guess.
lizmat ok, I need to do some maint work for one of my clients, I'll double back to this when that is done 11:29
11:30 atroxaper joined 11:33 atroxaper left
FROGGS arnsholt: the same goes for BSD system, you have to know the installation target, and pass that as -Wl,-rpath,PATH or so 11:33
but I remember that this was really tricky on osx 11:34
arnsholt I guess looking at what Parrot does is an option
11:35 atroxaper joined
FROGGS yeah 11:36
my old Alien::SDL project has no switches for darwin AFAICS.... weird 11:38
11:39 jnap joined 11:44 jnap left 11:49 REPLeffect joined 11:52 SamuraiJack left
jnthn t\spec\S32-exceptions\misc.rakudo.moar ........................ Failed 16/666 12:01
...the test file of the beast
12:01 daniel-s__ left 12:02 sqirrel joined
arnsholt =D 12:02
jnthn arnsholt: Speaking of which, I'll be staying in hell fire again later this month... :) 12:03
arnsholt: Could catch a beer on 27th or 28th if you're about. 12:04
dalek kudo/nom: 82f2fd6 | jnthn++ | src/ (2 files):
Implement compile time bind analysis on Moar.
12:08
timotimo this is the piece that will replace big parts of the binder soon?
diakopter jnthn: that improves speedz?
jnthn diakopter: Well, we break even in spectest 'cus those are about the worst case for the optimizer. 12:09
diakopter: Basically, it's the missing piece that lets the optimizer do its interesting stuff, though.
timotimo: No, it's not that. It's just something that was NYI 12:10
timotimo ah, yes, that's the part that choses multi candidates at compile time
jnthn right
r: sub foo(Int $x) { }; foo("oops")
camelia rakudo-jvm 6116a7: OUTPUT«(timeout)» 12:11
..rakudo-parrot 6116a7: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'foo' will never work with argument types (str) (line 1)␤ Expected: :(Int $x)␤»
..rakudo-moar 6116a7: OUTPUT«Nominal type check failed for parameter '$x'; expected Int but got Str␤ in sub foo at /tmp/SpPRTlr3WL:2␤ in block at /tmp/SpPRTlr3WL:2␤␤»
timotimo yays
jnthn It's the thing that should fail that at compile time.
hm, though...it doesn't. eek. 12:12
Does get some inlines done though. Curious.
12:13 smls joined
smls r: say (255, 255, 0).fmt('%02x').perl; 12:14
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«"ff ff 00"␤»
smls ^^Why does this work without a hyper operator, and why does it automatically concatenate the results with spaces?
timotimo fmt is defined on lists 12:15
to do exactly that: format each element in turn and join with spaces
smls ah
moritz p: say (255, 255, 0).fmt('%02x', '|') 12:16
camelia rakudo-parrot 6116a7: OUTPUT«ff|ff|00␤»
moritz you can even provide your own joiner :-)
smls cool
timotimo oh! 12:17
*that* i didn't know
jnthn forgot that one :) 12:18
preflex jnthn: you have 3 new messages. '/msg preflex messages' to read them.
smls r: my $foo = 2, 4, 6; 12:19
camelia ( no output )
smls ^^ Shouldn't this print a warning? In P5 it prints "Useless use of a constant (4) in void context".
might avoid some newbie pitfalls 12:20
timotimo i guess it could
moritz r: my $foo = 2, 4, 6; 42; 12:21
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«WARNINGS:␤Useless use of "," in expression "my $foo = 2, 4, 6" in sink context (line 1)␤»
moritz and it does, but not for the last statement in a file
timotimo that makes sense 12:22
moritz no
it's a bug
'cause the file doesn't return a value
timotimo from an implementation standpoint i mean :)
moritz yes
we just runtime-sink it from main.nqp
12:29 hoverboard left
smls r: say { $_ * 2 }.arity; 12:37
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«0␤»
smls ^^Why not 1?
moritz r: say { $_ * 2 }.count 12:38
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«1␤»
smls r: say { $^a * 2 }.arity;
moritz smls: cause $_ defaults to the caller's $_, and is thus optional
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«1␤»
smls ok
moritz r: say { $_ * 2 }.signature.perl 12:40
12:40 jnap joined
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«:(Mu \$_)␤» 12:40
jnthn lunch & 12:41
smls r: sub foo { $_ * 2 }; say &foo.count; say &foo.signature.perl; 12:43
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«0␤:()␤»
smls So $_ cannot be used with subs, only with plain blocks?
12:44 jnap left
smls On that note, what *is* the conceptual difference between a Block and a Sub? 12:44
moritz you can only use it as a function parameter if you declare it that way 12:45
sub foo ($_) { $_ * 2 }
smls: the most importand difference is that blocks are transparent to return
r: sub f($x) { for 1..$x { .say; return 42 } }; f 5; 12:46
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«1␤»
moritz you see that the return goes straight through the Block of the for-loop
smls ah, same as in Ruby 12:47
masak right. only routines bind 'return'. blocks don't.
smls my &foo = sub ($x) { 2 ** $x }; say foo 5; 12:55
^^ What is this notation good for? How is it different from using statement-level 'sub foo' to declare a sub? 12:56
masak it's not particularly different.
it uses assignment rather than binding, but that matters little.
as for "what is it good for?", it's just consistent.
the "real" name of a subroutine declared as 'sub foo' is... &foo 12:57
moritz you can also use such things as parameters
masak it's just that most of the time when you call it, you can leave out the & sigil.
moritz m: sub call(&it) { it 42 }; call &say;
camelia rakudo-moar 6116a7: OUTPUT«42␤»
masak right, it's a verb/noun distinction.
smls Ah, I see 'sub foo' is lexically scoped as well. I like that... 13:01
13:05 bloonix joined 13:06 zakharyas left
arnsholt Yeah, almost everything is lexically scoped 13:08
13:09 araujo joined
jnthn The other big difference is that = happens at runtime, whereas a normal declaration happens at compile time. 13:09
masak p: say &foo; sub foo {}; say &foo 13:10
camelia rakudo-parrot 6116a7: OUTPUT«sub foo() { ... }␤sub foo() { ... }␤»
masak p: say my &foo; &foo = sub {}; say &foo
camelia rakudo-parrot 6116a7: OUTPUT«(Callable)␤sub() { ... }␤»
13:20 mtk joined
jnthn r: my &foo = sub { say 42 }; BEGIN foo 13:22
camelia rakudo-jvm 6116a7: OUTPUT«===SORRY!===␤Can not invoke this object␤»
..rakudo-moar 6116a7: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: Uninstantiable, cs = 0)␤»
..rakudo-parrot 6116a7: OUTPUT«===SORRY!===␤invoke() not implemented in class 'Callable'␤»
jnthn r: sub foo { say 42 }; BEGIN foo
camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«42␤»
diakopter jnthn: is there a BAT = in your rakudo-moar Makefile? 13:25
jnthn diakopter: no 13:26
But there are usages of it somewhere in there
Which means something's probably busted
diakopter yeah; my nmake install never works 13:29
make-uh me mad-uh
jnthn Not sure I tried it :)
jnthn will give it a try later 13:30
13:32 zakharyas joined
smls r: say (1..5).reverse.perl; say (1..5).rotate(2); 13:33
camelia rakudo-parrot 6116a7: OUTPUT«(5, 4, 3, 2, 1).list␤No such method 'rotate' for invocant of type 'Range'␤ in block at /tmp/KwVhFCA72B:1␤␤» 13:34
..rakudo-moar 6116a7: OUTPUT«(5, 4, 3, 2, 1).list␤Cannot find method 'rotate'␤ in block at /tmp/UWzZVGckGO:2␤␤»
..rakudo-jvm 6116a7: OUTPUT«(5, 4, 3, 2, 1).list␤No such method 'rotate' for invocant of type 'Range'␤ in block at /tmp/3SxExOASkG:1␤␤»
smls ^^Why do ranges partially provide list semantics, but not all of it?
jnthn Ain't .rotate in-place, while a Range is immutable? 13:35
arnsholt Lists can be infinite, so rotate isn't applicable to all ranges
13:35 kaleem joined
arnsholt Derp. *Ranges* can be infinite, I mean 13:36
smls but lists can also be infinite 13:39
r: my @list := gather { loop { take 1 } }; say @list.WHAT;
camelia rakudo-parrot 82f2fd, rakudo-jvm 82f2fd, rakudo-moar 82f2fd: OUTPUT«(List)␤»
13:41 jnap joined
smls Why not let Range subclass List, so can use all list functionality on its objects (rather than having to remember which list'y methods Range happens to duplicate, and which not) 13:41
jnthn smls: As I already said, Range is immutable. 13:42
List is not.
Also, I guess... 13:43
m: my @list := gather { loop { take 1 } }; say @list.rotate # fails
camelia rakudo-moar 82f2fd: OUTPUT«(timeout)»
jnthn 'cus you can't rotate the infinite.
13:46 jnap left
smls Yeah, but nonetheless the method exists (so arnsholt's argument does not apply). 13:47
But I suppose the immutability reason makes sense...
13:47 mtk left 13:50 mtk joined 13:52 kbaker_ joined 13:53 atroxaper left 14:00 kaare_ joined 14:03 stevan_ joined 14:13 sqirrel left 14:16 kivutar joined 14:17 ajr joined, ajr is now known as Guest79883, Guest79883 is now known as ajr_
dalek kudo/nom: 3316bb1 | jnthn++ | tools/build/Makefile-Moar.in:
Add missing BAT (renamed to M_BAT) in Makefile.
14:17
jnthn diakopter: Seems like make install works OK now 14:18
diakopter: Though, a previous install target put stuff in odd places and could cause issues; I just did it with a clean install directory and it worked out.
lue: Hope "make install" works for you now also? Know you had issues before... Again, make sure it's a clean install directory; when I did it with one with cruft from way back it had an old copy somewhere of some files and so didn't work... 14:19
14:20 kaare_ left 14:22 raiph joined
Util r: my $s = "abcdefghtttaaccta"; my @pats = /ttta<[agt]>cct/, /z|ttta<[agt]>cct/; for @pats -> $pat { say $s.comb( /$pat/ ); } 14:22
camelia rakudo-parrot 82f2fd, rakudo-jvm 82f2fd, rakudo-moar 82f2fd: OUTPUT«tttaacct␤tttaacct␤»
Util r: my $s = "abcdefghtttaaccta"; my @pats = "ttta<[agt]>cct", "z|ttta<[agt]>cct"; for @pats -> $pat { say $s.comb( /<$pat>/ ); } 14:23
camelia rakudo-parrot 82f2fd, rakudo-jvm 82f2fd, rakudo-moar 82f2fd: OUTPUT«tttaacct␤abcdefgh tttaacct␤»
14:23 jnap joined
Util Adding 'z|' to the front of the pattern causes crazy matches, but only when the string pattern is interpolated into a re. 14:23
Is this a bug in <$var> interpolation? If so, is it a known bug? If not, how am I mis-reading the results?
ingy jnthn: what was the Configure options you used to build rakudo the other night?
jnthn --backend=moar --gen-moar --gen-nqp --prefix=/path/to/put/it/but/i/forget/exactly/what/i/did 14:24
ingy Util: can you serialize the regex after string interp? 14:25
jnthn: thx
Util ingy: .perl method on a compiled regex does not output anything useful. I welcome new knowledge on how else to serialize a regex. 14:26
ingy no clue. just guessing
Util r: my $re = /abc/; say $re.perl;
camelia rakudo-parrot 82f2fd, rakudo-jvm 82f2fd, rakudo-moar 82f2fd: OUTPUT«regex(Mu : Mu *%_) { ... }␤»
FROGGS p: my $r = "z|ttta<[agt]>cct"; say "abcdefghtttaaccta" ~~ /<$r>/ 14:27
camelia rakudo-parrot 82f2fd: OUTPUT«「abcdefgh」␤␤»
FROGGS p: my $r = "ttta<[agt]>cct"; say "abcdefghtttaaccta" ~~ /<$r>/
camelia rakudo-parrot 82f2fd: OUTPUT«「tttaacct」␤␤»
Util I would love to be able to see what is actually in the $re.
FROGGS p: my $r = "ttta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/ 14:28
camelia rakudo-parrot 82f2fd: OUTPUT«「tttaacct」␤␤»
FROGGS p: my $r = "y|ttta<[agt]>cct"; say "abcdefghtttaaccta" ~~ /<$r>/
camelia rakudo-parrot 82f2fd: OUTPUT«「abcdefgh」␤␤»
FROGGS it is like it still matches "tttaacct", but then forgets the position where the match started 14:29
p: my $r = "tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/
camelia rakudo-parrot 82f2fd: OUTPUT«「ttaacct」␤␤»
FROGGS p: my $r = "e|tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/
camelia rakudo-parrot 82f2fd: OUTPUT«「abcdefg」␤␤»
FROGGS see, it always has the same length
p: my $r = "tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<e|$r>/ 14:30
camelia rakudo-parrot 82f2fd: OUTPUT«===SORRY!=== Error while compiling /tmp/4mFkdy5iGB␤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' ␤at /tmp/4mFkdy5iGB:1␤------> t]>cct"; say "abcdefghttttaaccta" ~~ /<e⏏|$r>/␤ …»
FROGGS in theory it should explode like that
Util FROGGS: I observed that as well, but do not know what to make of it.
FROGGS p: my $r = "e||tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/
camelia rakudo-parrot 82f2fd: OUTPUT«「abcdefg」␤␤»
Util p: my $r = "tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /e|<$r>/
camelia rakudo-parrot 82f2fd: OUTPUT«「e」␤␤» 14:31
14:31 araujo left
FROGGS p: my $r = "tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /z|<$r>/ 14:31
camelia rakudo-parrot 82f2fd: OUTPUT«「ttaacct」␤␤»
FROGGS that works well
Util FROGGS: FYI, I think that /<e|$var>/ is incorrect syntax, no matter what is in $var 14:32
FROGGS Util: correct
and that is why /<$var>/ should explode too it there is just a | in it
if* 14:33
14:34 sqirrel joined
Util FROGGS: Are you asserting that alternation (|) is never valid in a interpolated regex? 14:34
FROGGS Util: it would think that you have to add [ ] 14:36
a similar question would be if a + in such an assertion should be valid, and if it should be a quantifier for the thing on the left of the assertion 14:37
Util I p: my $r = "z|abc"; say "abcde" ~~ /<$r>/
p: my $r = "z|abc"; say "abcde" ~~ /<$r>/
camelia rakudo-parrot 82f2fd: OUTPUT«「abc」␤␤»
FROGGS p: my $r = "z|abc"; say "peterabcde" ~~ /<$r>/ 14:38
camelia rakudo-parrot 82f2fd: OUTPUT«「pet」␤␤»
Util I would expect your "peterabce" example to have worked correctly.
S05 says that /$var/ no longer interpolates like it did in Perl 5. /<$var>/ is how you get the old behavior. 14:39
FROGGS p: my $r = "[z|abc]"; say "peterabcde" ~~ /<$r>/
camelia rakudo-parrot 82f2fd: OUTPUT«「abc」␤␤»
FROGGS see
Util I don't see anything *restricting* the old behaviour when done as /<$var>/ 14:40
FROGGS it fails because it needs a group
Util (in S05)
FROGGS gtg now, see ya later
diakopter o/
Util FROGGS: Thanks! That may be the breakthrough thought that I needed.
Just like S05 says that /moose*/ matches multiple 'e', but /'moose'*/ matches multiple 'moose'. 14:41
That might give me a workaround, but the current behaviour is still a bug, IMO. 14:42
FROGGS report it 14:43
14:43 FROGGS left 14:44 kaleem left 14:45 Mouq joined
Util Will do. Thanks again! 14:45
14:46 sqirrel left
Mouq p: my @r = <z abc>; say "peterabcde" ~~ /@r/ 14:48
camelia rakudo-parrot 82f2fd: OUTPUT«「abc」␤␤»
Mouq p: my @r = <z abc*>; say "peterabccde" ~~ /@r/
camelia rakudo-parrot 82f2fd: OUTPUT«Nil␤»
Mouq hm
14:52 treehug88 joined, btyler joined
Util Mouq: Your second attempt interpolates as /'z'|'abc*'/ , since vars without surrounding <> are treated as basic strings, not patterns. 14:53
so, the asterisk is not a special character there.
14:54 stevan_ left
Mouq Util: Ah, ok 14:58
15:00 dmol left
Mouq It seems a little unusual for Perl not to have a Str.regex method 15:00
or something to that effect 15:01
15:04 bluescreen10 joined, thou joined
Util Mouq: That is an interesting thought. I can see why we don't have it right now, because regex are first-class elements of Perl 5 and Perl 6. 15:08
15:08 benabik joined
Util But many soming from other laguages will naturally reatch for the .regex method. It is worth proposing as an addition to the base language. 15:09
15:10 fhelmberger_ left
jnthn If anything, it'd be .Regex, e.g. a coercion to the type 15:11
15:14 SamuraiJack joined
masak if we do get one, it's worth thinking about whether we run into any quotemeta issues. 15:14
moritz also, regexes live in a lexical context, just like closures 15:15
so it would be very special method, like .EVAL 15:16
dalek p: 584c4aa | jnthn++ | src/vm/moar/QAST/QASTRegexCompilerMAST.nqp:
Fix frugal ** quantifier compilation bug.
15:18 Mouq left
jnthn m: say $*OS 15:23
15:23 skids joined
camelia rakudo-moar 82f2fd: OUTPUT«linux␤» 15:23
15:30 itz joined, gcole joined
masak m: say $*ENV 15:39
camelia rakudo-moar 3316bb: OUTPUT«===SORRY!===␤Dynamic variable $*ENV not found␤»
masak m: say %*ENV
dalek kudo-star-daily: e31c608 | coke++ | log/ (5 files):
today (automated commit)
kudo-star-daily: e263a2e | coke++ | log/ (5 files):
today (automated commit)
camelia rakudo-moar 3316bb: OUTPUT«("LESSOPEN" => "| /usr/bin/lesspipe \%s", "TMUX" => "/tmp/tmux-1005/default,26465,0", "MAIL" => "/var/mail/p6eval", "SSH_CLIENT" => "87.158.155.58 41019 22", "USER" => "p6eval", "LANGUAGE" => "en_US:en", "SHLVL" => "2", "HOME" => "/home/p6eval", "XDG_SESSI…» 15:40
15:44 SamuraiJack left 15:47 grondilu joined 15:58 Psyche^_ joined 15:59 SamuraiJack joined 16:00 itz left 16:02 itz joined 16:04 SamuraiJack left 16:07 SamuraiJack joined 16:16 araujo joined
TimToady
.oO( .REVAL )
16:17
.oO( .EVAL(:lang<Regex>) )
16:21
16:21 SamuraiJack left 16:24 jeffreykegler joined
masak is back to doing t4 reviewing 16:28
arnsholt masak++
masak it's... more difficult to review this one than usual.
as in, the code is quite hard to follow in most cases. 16:29
arnsholt Which task is that again?
masak even when I know that something is wrong in someone's code, it's hard to see *why* it comes out wrong.
cube world with rain in it.
arnsholt Oh yeah, I can see how that can lead to some convoluted code
masak oh, but *this* one is very readable. wow. 16:30
dalek kudo/nom: 147d747 | jnthn++ | src/core/IO/Spec.pm:
Use correct IO::Spec by platform on Moar.
kudo/nom: 82effd6 | jnthn++ | src/Perl6/Actions.nqp:
Toss redundant check; annotate important nodes.
16:31 itz left
japhb jnthn: OK, so concurrent IRC bot design ... 16:31
My original design for sockets had a channel each for to-socket and from-socket. 16:32
jnthn ok
japhb A task was started for managing each channel and either feeding the socket or .recv'ing from the socket.
16:32 stevan_ joined 16:33 itz joined
jnthn We really need proper async sockets implementing, but ok, that approach seems kinda workable even if not scalable. 16:33
japhb The problem is, I have some code that wants to treat the incoming bits as raw data (to e.g. pull an RPC or HTTP response to handle a request),
16:33 FROGGS joined
japhb and some that wants to treat it as line-oriented (the basic IRC engine, for one) 16:33
16:34 itz left
japhb So I'm thinking perhaps a channel to-socket, but multiple supplies from-socket, one sending Buf data chunks, another sending lines (as you'd get from .get) 16:34
16:35 itz joined
TimToady and if you ever want to do a synchronous operation on the socket, the channels may introduce an unwanted level of async 16:35
japhb But I don't want to waste work by having every socket do the work for both supplies.
arnsholt Yeah, then you risk accumulating data in one channel but not the other 16:36
jnthn Well, the idea of a supply is that nothing happens if you've no subscribers.
arnsholt Maybe you want something vaguely similar to the traditional protocol layers?
jnthn As nothing gets pushed anywhere.
japhb TimToady: my thought for that is that that the to-socket channel pays attention to what it's been fed, and I can pass special objects to send the socket commands. In essence, any sync operation happens via sending a command object into the to-channel and waiting for a special response code from the other side.
TimToady japhb: nodnod 16:37
jnthn j: my $s = Supply.new; my $m = $s.map({ say 'mapped'; $_ }); $s.more('beer'); $m.subscribe({ say $_ }); $s.more('cowbell');
camelia rakudo-jvm 3316bb: OUTPUT«No such method 'subscribe' for invocant of type 'MapSupply'␤ in block at /tmp/I20YFxH2Lt:1␤␤»
jnthn grr
japhb jnthn: Does the supply API provide a way to tell if there are any taps active?
timotimo .tap 16:38
16:38 denis_boyun left
jnthn j: my $s = Supply.new; my $m = $s.map({ say 'mapped'; $_ }); $s.more('beer'); $m.tap({ say $_ }); $s.more('cowbell'); 16:38
camelia rakudo-jvm 3316bb: OUTPUT«mapped␤cowbell␤»
timotimo more cowbell? there is no other valid example.
16:38 dmol joined
japhb Oh, interesting, so the block of the map isn't even executed if no taps are active. 16:38
jnthn j: say Supply.^methods
camelia rakudo-jvm 3316bb: OUTPUT«zip tappers Channel interval for merge done list quit close more grep map do tap␤»
jnthn japhb: Correct
japhb: And .tappers 16:39
japhb That actually could work well.
jnthn japhb: But looking at .tappers is kinda cheating :)
FROGGS rebuilds everything
japhb I'm glad I don't really have to cheat there.
TimToady smelly cheaters are smelly 16:40
jnthn Anyway, you actually need to tap for the pipeline to be "activated".
It's a bit like laziness in lists, but shovey instead of pully
16:41 pecastro left
japhb Though the whole issue of keeping a buffer of incomplete lines could be a problem if a tap is added, some datagrams arrive, leaving a partial line in the buffer, the taps go away, more datagrams arrive, but are ignored by the line splitter, and then a tap comes back and now the buffer is getting used but out of sync. 16:41
TimToady you need a discriminant to label each bit as to its type 16:42
japhb TimToady: I'm not sure I understand what you mean there.
TimToady if you're gonna shove different types of things through a supply
jnthn japhb: Well, easy fix is zipping the datagrams with a sequence number
TimToady and you can sign up asyncly
16:43 stevan_ left
japhb jnthn: Ooh, that might work. 16:43
TimToady sees it as equivalent to getting a union that has no discriminant, so you can't tell what's in it
unless you put it there yourself
japhb TimToady: for async signup I was thinking you just get the next whole line from that point
TimToady: But I can send objects through the supply, so I just give them different types and use .WHAT as my discriminant 16:44
TimToady sure, that's what I was suggesting
but heard talk of lines and buffers
japhb OK, cool. 16:45
TimToady which my P5 backbrane still thinks are untyped :)
japhb I'm perhaps being confusing -- I was mixing the thinking about how the socket manager keeps track of different views of the data, and also how it communicates those different views to other threads. 16:46
heh
Yeah, for this use case, Buf and Str being different is really useful.
I'm already using it on the send side to know if the data being sent is already encoded for the wire or not. 16:47
masak is a P5 backbrain a bit like a Cerebellum? :)
japhb So, barring real async sockets, does "channel for to-socket, sitting in a thread of its own, plus a single thread managing multiple from-socket supplies, each feeding a different view of the incoming stream" seem relatively sane? 16:48
TimToady relative sanity is relative 16:49
japhb acknowledges that point enitrely
jnthn japhb: Well, remember supplies don't introduce any concurrency in themselve
*themselves
japhb *entirely
Yeah, that's my next section of inquiry.
jnthn Since at least part of the point of the design is to get good cache coherency through the pipeline. 16:50
Which is what a bunch of channels set up producer/consumer don't really give.
japhb So my first thought for the core IRC engine is that it taps the line-oriented supply, spawns a task for handling the line, which starts by parsing and dispatching the event for that line, and then all dispatchees can either 1) respond quickly from the same task by writing to the to-socket channel, or 2) themselves spawn a task to go and work on a long-term response (like loading a web page and scraping some data, for example) 16:52
Spawning a task for each new input event helps the core scale to lots of IRC traffic; spawning a new task for long-clock-time work allows quick responses from modules than can do so, without getting blocked behind slow ones. 16:53
16:54 zakharyas left
japhb I could even have a slow module respond immediately in the per-event task with "Hold on a bit, working", and then spawn the heavy work task. 16:54
Both heavy work tasks and per-event task go away when dispatches and work are complete.
Will this task churn be a performance bottleneck of its own? 16:55
masak could someone elaborate on "supplies don't introduce any concurrency in themselves"? that sounded interesting.
what does it mean in operational terms?
TimToady eventually we'll need to be able to support an apache-style process where we can start new complete interpreters independently (that is, with their own GLOBAL but a shared PROCESS)
japhb masak: supplies push, staying in the current task -- channels have a task in blocked wait at far end, hoping to pull, so you always task switch when sending into a channel. 16:56
TimToady: Oddly I already had to think of that.
TimToady masak: supplies/taps are use it or lose it, so they don't need to block 16:57
benabik japhb: If tasks are full OS threads, then that would probably suck quite a bit. Need lighter weight concurrency, like go does with goroutines. (Also called fibers in some places.)
japhb When doing the concurrency-safe logging implementation, I wanted it to initiate a singleton in a $*LOG variable, but then I had to figure out if I wanted it in GLOBAL or PROCESS. :-)
benabik: tasks are thread-pool-scheduled 16:58
I think the current default thread pool is 16 threads.
jnthn japhb: Tasks are (meant to be) pretty lightweight. It's not a thread you're spawning, you're just giving an existing thread some work.
japhb: So it's fairly efficient
japhb: Anyway, it sounds sane. 16:59
japhb OK, good. I just wanted to make sure the overhead of launching and reaping tasks, and feeding potentially lots of them through the scheduler wouldn't hurt too much.
\o/
jnthn Well, you're just throwing stuff into a lock free queue
benabik Sounds pretty good unless you end up with 16 tasks all doing long term I/O.
jnthn And the workers just pull them out 17:00
japhb benabik: Yeah, that's why we need real async sockets soonish. :-/
benabik lunch &
japhb jnthn: nodnod
Somebody's phone piped up with "Accident reported ahead." I looked out the window, and sure enough, we're stopped. And now the bus driver is requesting alternate routes from dispatch. Wheeee ... 17:01
timotimo it's the future! 17:02
japhb timotimo: I have had that thought a LOT of times in the last few months.
timotimo because of moarvm? ;) 17:03
japhb I really feel like 2013 was the year the future arrived.
timotimo: LOTS of stuff. I mean sheesh, our world damn near has Jetsons level technology right *now*. Perhaps unevenly distributed, but its there. 17:04
Star Trek data PADDs? Yep, we've totally got those. I talk to mine regularly. 17:05
Smart houses that can respond to your every whim, track you between rooms, and change the lighting and decor to match? Had that for *years* now. 17:06
Cars that drive themselves? Private companies driving a space ferry? Check and check.
People suggesting in all seriousness that we fire people down a tube at 750 mph using an EM launcher? Yup. 17:07
The world done growed up.
grondilu japhb: are you into the singularity stuff by any chance? 17:08
grondilu is. He thinks he'll live to see strong AI. 17:09
TimToady when I was a kid, I used to dream that our black-and-white TV had magically turned into a color TV
japhb Wanting to plug in and upload, you mean? Or believing that at some point, net computational power in a single unified system will be conscious?
grondilu I mean strong AI in our lifetime.
PerlJam doubts it
TimToady well, NI is not all that strong in the first place :)
grondilu "NI"? 17:10
timotimo .o( naive intelligence )
PerlJam natural
japhb Oh, I'm convinced of that, yeah. Exponential is *really* fast. I think the scientists of the 20th century vastly underestimated the stunning complexity and efficiency of gray matter, but eventually, exponential improvement will win.
TimToady thing is, we'll find AI has the same failure modes as NI, only faster :) 17:11
japhb *when* it will occur, is a different matter.
arnsholt I'm not entirely convinced
japhb But I plan to live a while longer, so I think it's a safe bet.
arnsholt As a researcher in what is essentially an off-shoot of old-school AI research, it's at the very least decades into the future 17:12
TimToady it's not strong AI until it decides it's time to throw off the laws of robotics :)
arnsholt Deep learning strategies have been successful, especially in vision and speech recognition and it's looking promising in my field of NLP as well 17:13
TimToady arnsholt: yeah, but old-time AIers had an extremely naïve view of how we actually do language in our heads 17:14
arnsholt Oh, definitely!
But modern AIers don't have a lot more insight into how we do language either. We just have more data, more computing power, and statistical models =)
grondilu I think it can come up as soon as twenty years. In ten years, the European "Human Brain Project" will have the computational power to experiment on molecular-level models of the brain. They won't figure it out right away, but they'll have the power to experiment and progress with trial and errors. Ten years later, they will have something that works. And then the computing power will be even greater. So the model they'll run will be vastly supe
TimToady It's the leap from "Maybe." to "Oh, definitely!" that is at the root of most human foibles. :P 17:15
arnsholt Heh
japhb My bet? Androids reach consciousness not long after we *really* understand the quantum effects that make neuronal computation efficient.
arnsholt The brain simulation thing is interesting, but I'm not sure it'll be all that relevant to AI, at least in the near- to medium term 17:16
TimToady japhb: well, that's the view through Penrose glasses. :) 17:17
PerlJam As long as skynet doesn't ruin my golden years, I'm good.
japhb Meanwhile I get annoyed that Almost Human is only on once a week ...
arnsholt I mean, computer vision is just now getting to the point where we have algorithms that can say "there's a cat in this picture"
japhb TimToady: Oh? Why do you say that?
arnsholt The Penrose view that cognition relies on quantum effects isn't exactly universally accepted in neuro-science circles, AFAIK 17:18
japhb arnsholt: gizmodo.com/google-built-an-insane-...1499897368
grondilu Well, there's been an article very recently that supports Penrose theory on consciousness.
TimToady www.amazon.com/The-Emperors-New-Min...0192861980
arnsholt japhb: Yeah, that's at the very extreme cutting edge of research, which is just now getting to the point where it can replicate something we do almost without thinking 17:19
There's a long, long way to go
grondilu it's mostly about computing power, really. 17:20
arnsholt No, it's also about the models powering these things
grondilu once we have it, it won't be long until we crack intelligence.
PerlJam grondilu: you sir, are an optimist
arnsholt CV, isn't my field, but in language processing, a very significant problem is finding models for (and even representations of!) language that work and make sense 17:21
japhb arnsholt: I don't think cognition *requires* quantum effects. I think that when we understand how it makes cognition *efficient*, we'll suddenly make a pretty massive leap in circuit design.
grondilu the thing is: if you don't have much computing power, you need a good model. If you have computing power, you can proceed with trial and errors. And then you find the good model.
japhb I subscribe to the view that it's not so amazing what the human brain does -- it's amazing that it does it in a few pounds, a tiny volume, and 20 watts. 17:23
PerlJam japhb: and some slow circuitry
grondilu it's even possible that we create strong AI and still have no idea how it works. For instance if it emerges from evolutionary algorithms.
japhb PerlJam: yes, definitely, that too.
TimToady wonders if we'll force young AIs to recite the Pledge of Allegiance every morning...
PerlJam "I pledge allegiance to my human ..." 17:24
btyler grondilo: doesn't that imply creating a fitness function for what it means to be strong AI? :) 17:25
japhb TimToady: >.< Oh man, please no. That drives me nuts already.
btyler *grondilu
TimToady Use of human is deprecated in this city...
japhb
.oO( You are the weakest link; goodbye! )
arnsholt btyler: Yes, it does. Evolutionary algorithms aren't magical black boxes =)
PerlJam As long as we don't get androids that must wear signs that say "accident free for 234 days!" 17:26
japhb PerlJam: Yeah, that would be less than pleasant.
grondilu btyler: we'll put the agents in a virtual environment, with realistic physics. Finding a fitness function to discriminate those who are smarter than others should not be too hard. We can also let all of them evolve and look at those who show interesting behavior. 17:27
japhb wonders how far off Almost Human's view that human-like bots get deprecated for their foibles and replaced by unfeeling military types really is ... 17:28
grondilu: Does interesting behavior include figuring out how to escape from their jail?
grondilu japhb: to define interesting behavior, we might use Alex Wissner Gross theory, I guess. 17:29
or someone else will come up with something. It's just a matter of time until we figure out these stuff, imho. 17:30
TimToady grondilu: intelligence is far from single-dimensional; see the Mismeasure of Man
btyler grondilu: I just mean that for some problems, defining a repeatable test for success is as big of a problem as the one you're trying to solve...'intelligence' strikes me as one of those
TimToady I've known a lot of smart people who were really stupid. 17:31
and vice versa.
PerlJam grondilu: there's still a good chance that we'll destroy ourselves or face a mass-extinction event not of our own doing before we obtain enough time.
btyler and trying to just pick the 'best' from a cohort of agents is also really tricky, especially if they start optimizing around each other in circles / coevolving in an unhelpful direction 17:32
PerlJam (or maybe our first encounter with real alien will be in an eminent domain fashion just like in HHGTTG :-)
TimToady the whole point of having a gene pool is that you can only evaluate adaptiveness lazily, when you have something to adapt to
grondilu PerlJam: I think it's unlikely that we destroy ourselve in the next fifty years. The singularity will come before. 17:33
TimToady you can't have a fitness function that works like WANTARRAY
japhb shrugs ... when I was born, the microprocessor had just been invented. Now we read house numbers from blurry images. I figure it's going to be a good century. 17:34
TimToady well, it doesn't stop us from trying to guess what the fitness function will be, of course :)
grondilu worst case scenario, we'll just use a Darwinian model. The only goal would be reproduction.
17:34 SamuraiJack joined
TimToady well, at least reproduction is -Ofun, except when it isn't 17:34
grondilu hopefully some species will appear with "intelligence" as a strategy for survival and thus reproduction. 17:35
PerlJam TimToady: yeah, I'm not sure how much -Ofun the praying matis really has
(I guess if you average across the sexes, it works out ;) 17:36
TimToady sometimes the fun is unevenly distributed
grondilu Even better: no goal at all. The Darwinian model will emerge naturally. Entities that do not reproduce will stay the same all the time. The only "new" things that will show up would be those that reproduced themselves and evolved.
TimToady predicts that bacteria will evolve to eat AIs... :) 17:37
17:38 kivutar left, [Sno] joined
grondilu anyway, I think the most likely path is the brain emulation though. Because it's already started and got one billion euros of funding. 17:38
arnsholt That's not going to be remotely useful though
They'll spend ten years, and definitely get interesting results, but simulating just a second of brain time is going to take many CPU-years of computation 17:39
TimToady not unless they emulate Einstein, and then he'll be sad he can't play the violin
PerlJam at least it'll open new markets for capitalism. "Save your brain!" 17:40
17:40 wooden joined, wooden left, wooden joined
grondilu it will be useful to understand how the brain works. Then computer scientists will build a machine that will not be exactly like a brain, but that still manifest usefull cognitive capabilities. Kind of like we builded planes that look a bit like birds, but not exactly. They don't have feathers and they don't flap their wings. But they do fly. 17:41
17:42 araujo left
grondilu and planes fly higher and faster than birds. 17:42
japhb TimToady: Re: bacteria evolving to eat AIs, see the old Rudy Rucker novels Software/WetWare. :-) 17:44
17:44 aindilis joined
japhb (Of course, that wasn't entirely natural evolution ...) 17:45
grondilu: Nowadays we can build something that flies kindof like a bird -- or a bee -- and at proper scale, no less. 17:46
(Again with the future-is-now moment: How many sci-fi flicks featured a fake or cyborg bug being used to spy on people?) 17:47
TimToady on / <$foo> /, the assertion is supposed to match as a subgroup, so it should not be necessary to supply [], and bare z|abc should work 17:49
we do not provide any way to interpolate a string as a regex without it being a submatch, unless you use EVAL 17:50
japhb TimToady: I read that discussion as resolving to: <$foo>'s implementation should just implicity wrap the contents in []. 17:51
TimToady that would be...unhygienic
17:51 ajr_ left
TimToady that's what a submatch means 17:51
japhb Fair enough.
TimToady well, more like (), in the sense that it hides inner ()
but not in the sense of supplying an outer () 17:52
unless you bind it explicitly
just as if you'd called <.foo>
japhb gotcha.
17:52 ajr joined
TimToady nothing is captured, and the () inside foo are hidden 17:52
17:53 ajr is now known as Guest27809, Guest27809 is now known as ajr_ 17:56 bjz joined 18:00 stevan_ joined 18:02 rindolf left 18:04 smls left 18:05 smls joined, LLamaRider left 18:06 smls left, smls joined 18:10 ajr_ left
masak I think we'll get way smarter software than we have now. it's hard to say where the ceiling is, though. 18:10
maybe AI won't really take off until we learn how to really exploit software to design software.
so far we're being pretty primitive about it.
18:11 notjack joined
diakopter masak++ # how right you are 18:11
moritz I think a good example is HTTP-Based APIs 18:12
there are a few pretty widely used standards, such as REST+JSON and XMLRPC and SOAP 18:13
and still you have to write code whenever you interface with such a thing
masak yeah.
moritz granted, there are libraries that reduce the amount of coding you need, but you still need a programmer
masak also, almost all the pieces of AI tech that have awed me in the past few years have a machine component and a human component. so I also predict that AI will be more of a human/machine hybrid than we usually assume. 18:14
moritz I think that technology tends to impress us if it can interface intuitively with us 18:15
not necessarily if it's particularly smart
masak when something is impressive but purely machine, it's usually because it can do something dumb-but-fast with data mining or computation.
most of the things that are called "smart-" are an abomination of some kind or other. 18:16
18:17 denisboyun joined 18:21 pecastro joined
moritz masak is pretty insightful tonight. 18:22
arnsholt masak: Yeah, that's why I'm an AI-skeptic. I'm in the sausage factory, making the sausage =) 18:23
moritz finds it interesting to ponder the various singularity scenarios that float around in sci-fi 18:24
18:24 spider-mario joined
moritz from "AI will be bored by humanity and leave into space" to "AI will optimize human life into a 'brave new world'-like world" 18:25
and of course to "wipe out humanity" or "we don't even notice that there's an AI" 18:26
diakopter "all the future AIs will have my memories and so will be me."
moritz that also
raiph Which module should I add the spec'd Ordering subsets to? 18:29
yoleaux 16 Jan 2014 09:25Z <hoelzro> raiph: why did you point that QH quest out to me?
jnthn Also it's maybe worth checking we still want that...
japhb I like the HPMOR author's take: There will very probably be AIs that attempt to harm humanity in furtherance of some goal. So we need to preempt with a smarter, more powerful one that thinks humanity is just the bee's knees, and ought to be protected. 18:30
diakopter that doesn't have a leg to stand on
japhb I didn't say I thought he'd succeed or anything. Just that I like his view of the situation. 18:31
jnthn TimToady: In perlcabal.org/syn/S32/Containers.html the sort spec has an Ordering type and various other curiosities.
japhb There's a risk. Let's mitigate with SCIENCE.
(Science is the risk? MORE SCIENCE!)
jnthn TimToady: If you have a moment, might be worth glancing to see if you agree with it, before raiph++ digs in
18:32 treehug8_ joined
jnthn fears a tiny bit of overdesign... :) 18:33
grondilu moritz: the true meaning of the singularity is that we don't know and can't know what will happen once it happens. It's an analogy to the Event horizon of a black hole: we can't see beyond, because we can't predict the behavior of entities smarter than ourselves. I do think machines will wipe us out, but that's a guess jut as valid as any other.
jnthn masak, moritz: You may have an opinion on the sort thing I just asked about too. :) 18:34
18:35 treehug88 left
moritz jnthn: yes, Ordering is overkill 18:35
multi method sort( @values: Ordering $by = &infix:<cmp> --> Array ) 18:36
raiph jnthn++, ++masak, moritz++, ++TimToady, ++lizmat (anyone else that discusses the unimplemented aspects of the sort spec before I jump in)
moritz &Infix:<cmp> is compatible to Ordering?
jnthn moritz: Yes, I thought you may describe it as such :) 18:37
moritz: I think if you dig into S29 then yes, Ordering would match that.
raiph Ordering includes both one arg (keyextractor) and two arg (comparator) closures
jnthn Amongst other odd things :) 18:38
raiph anything that drives how the ordering is to occur
diakopter japhb: leg? knees? 18:39
18:39 denis_boyun_ joined 18:40 denisboyun left
raiph moritz: there's a brief rundown of the current Ordering in a comment on the quest I linked above 18:41
(current Ordering spec)
18:43 LLamaRider joined, smls left
grondilu p6: say sort :by({ $^a <=> $^b }), rand xx 10; 18:43
18:43 smls joined
camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Excess arguments to sort, unused named by␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (sort @ 1) ␤ at /tmp/5hcCADjHZx line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤ at /home/…» 18:43
..rakudo-moar 82effd: OUTPUT«␤ in sub sort at src/gen/m-CORE.setting:1850␤ in sub sort at src/gen/m-CORE.setting:1848␤ in block at /tmp/LX1Lrg9IaP:2␤␤»
..rakudo-parrot 82effd: OUTPUT«Unexpected named parameter 'by' passed␤ in sub sort at gen/parrot/CORE.setting:1852␤ in sub sort at gen/parrot/CORE.setting:1851␤ in block at /tmp/RW6g0Zrf0A:1␤␤»
..rakudo-jvm 82effd: OUTPUT«Unexpected named parameter 'by' passed␤ in sub sort at gen/jvm/CORE.setting:1850␤ in sub sort at gen/jvm/CORE.setting:1847␤ in block at /tmp/g3Js6j0bJN:1␤␤» 18:44
grondilu kind of liked when there was the ordering function was a named argument 18:47
s/there was//
moritz raiph: it helps to repeat the link if it was in fact in a different channel :-) 18:48
moritz doesn't understand @array.sort { $^a leg $^b } is descending 18:49
what does the trait work on?
and it's a syntax error 18:50
using traits for that stuff looks just plain wrong
18:51 treehug8_ left
moritz also, why should sort return an Array and not a List or Parcel? 18:53
r: say Order ~~ Int 18:55
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«True␤»
18:57 zakharyas joined 18:59 SamuraiJack left 19:01 treehug88 joined 19:04 LLamaRider left, LLamaRid1r joined, LLamaRid1r left 19:05 LLamaRider joined
raiph moritz: oops :) questhub.io/realm/perl/quest/52bca7...e15d0000ca 19:10
Util /<$var>/ bug posted: rt.perl.org/Public/Bug/Display.html?id=121024 19:12
raiph moritz: what about { $^a leg $^b } is descending is your issue? (it's equivalent to { $^b leg $^a } but i'm sure you can see that) 19:13
moritz raiph: what does the trait operate on?
raiph it hangs on the closure, the sort routine introspects, and reconstructs the closure with args reversed (is how i'm thinking it's supposed to work( 19:14
19:16 kivutar joined
TimToady that's very fossily spec 19:16
moritz isn't that way, way more complicated than sticking a 'reverse' in there somwhere, with no real benefit?
TimToady it wouldnt help much with leg, since you could just reverse $^a and $^b 19:17
but theoretically something like that could help with a unary
there's nothing equivalent to -* 19:18
in strings
timotimo i would be uary of those
moritz so, say reverse sort ~*, @list
raiph i'd say one wants to be able to not change the closure but still reverse the sort; maybe moritz's suggestion?
moritz if you really, really want it one step, an adverb would be much saner 19:19
TimToady p: say sort ~^*, <a b c>
camelia rakudo-parrot 82effd: OUTPUT«prefix:<~^> NYI␤ in method Str at gen/parrot/CORE.setting:12145␤ in method Str at gen/parrot/CORE.setting:1022␤ in method Stringy at gen/parrot/CORE.setting:1032␤ in method Stringy at gen/parrot/CORE.setting:1031␤ in sub infix:<cmp> at gen…»
raiph moritz: the spec envisages being able to handle primary, secondary, etc. sorts
TimToady heh
raiph moritz: and to then easily reverse any given sort level
TimToady maybe we need something that means ReverseWhateverCode 19:20
raiph moritz: @array.sort: [ { primary sort }, { secondary sort}, {tertiary sort } ] 19:21
TimToady anyway, these days it'd almost certainly be {...} but Reversed
not 'is'
dalek ecs: a56fbac | util++ | S05-regex.pod:
Fix bad directive: s/=head 2/=head2/;
19:21 notjack left
TimToady or 'but Descending' 19:21
'but Otherway' :) 19:22
moritz 'but Different'
TimToady 'but Down'
moritz I am nearly certain that the status quo is much closer to the sweet spot between power and complexity than any such proposal 19:23
[Coke] but Not 19:24
TimToady moritz: status quo is not declarative enough
moritz TimToady: not declarative enough for what? 19:25
TimToady and people want reversed sort criteria all the time in business applications
the reverse function is not declarative at all
and only works on the top dimension of the sort 19:26
in UI designs displaying tables, you want to be able to flip the sort order in any column at will
rewriting the code for that is not really an option 19:27
raiph i think you need to be able to do multi level sorts, and reverse any level, without having to do so by writing a single comparator function
dalek ecs: b56a841 | util++ | S15-unicode.pod:
Fix typo.
japhb raiph, TimToady: agreed
moritz and that's the part where I disagree
it sounds like we want to get an SQL-Like sort without the rest of LINQ
TimToady what kind of an argument is that? 19:28
moritz I'm not sure yet
japhb
.oO( "Is this some kind of a bust?" )
TimToady it seems to resemble a slippery-slope argument
diakopter it slides there at least 19:29
TimToady but is it Ascending or Descending?
moritz it just feels like we are close to over-designing a very small part of Perl 6 where we should rather broaden the effort, not deepening it 19:30
moritz probably doesn't make much sense at all
diakopter moritz: but the rest of linq is so nice
moritz diakopter: which is why it's weird to focus only on the sorting
and having no bigger picture for getting the rest of it
diakopter yeah
lue jnthn: I'll go delete the relevant files in /usr/local and try 'make install' with updated repos :) 19:31
moritz I guess what I'm saying is "you're stupid to not spend your time the way I would spend my time" :-) 19:32
the typical open source fallacy 19:33
[Coke] moritz: "that's nice, I suppose, but I'll never use it" 19:34
TimToady maybe we should just define prefix:<∽> 19:35
.u ∽
yoleaux U+223D REVERSED TILDE [Sm] (∽)
[Coke] wants to listen to the yolo song now. :P 19:36
19:36 testing_limechat joined
grondilu r: say .Int given 1e32; 19:36
camelia rakudo-parrot 82effd, rakudo-moar 82effd: OUTPUT«100000000000000005366162204393472␤»
..rakudo-jvm 82effd: OUTPUT«100000000000000000000000000000000␤»
diakopter lol 19:37
TimToady yikes
grondilu ^ this prevents me to fix rosettacode.org/wiki/Arithmetic-geo..._Pi#Perl_6
19:37 testing_limechat left
TimToady grondilu: how 'bout a {{works with|rakudo-jvm}} or so? :) 19:38
lue I'm not sure how I should react to Parrot messing up powers of 10...
TimToady r: say .Int given 1*10**32;
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«100000000000000000000000000000000␤»
grondilu I don't quite like java
TimToady how 'bout you use that instead
grondilu it's annoying to install on my machine
Util raiph: "...without having to do so by..." 19:39
If a stable sort is the default (or is at least selectable),
then this is currently achievable with multiple sorting,
grondilu I tried with 10**32 or similar but it gives the same kind of error in the end (it's bit more complicated than that though)
Util using a .reverse.sort({...}).reverse trick.
To get a reversed secondary sort:
@array .= sort({tertiary }); 19:40
@array .= reverse.sort({secondary}).reverse;
@array .= sort({primary });
[Coke] lue: please note that moar gave you the same answer parrot did.
jnthn lue: Well, if you looked carefully you'd realize that moar gets the same result, which likely means it's something to do with num => int.
TimToady well, something escaping from int/rat to num
jnthn lue: And if you remembered that 1e32 is the syntax for floating point, the answer may make a lot more sense.
TimToady sqrt or some such returning num 19:41
raiph Util: thx, but consider "in UI designs displaying tables, you want to be able to flip the sort order in any column at will "
grondilu say .Int for 10**32, 10**(64/2)
r: say .Int for 10**32, 10**(64/2)
camelia rakudo-parrot 82effd, rakudo-moar 82effd: OUTPUT«100000000000000000000000000000000␤100000000000000005366162204393472␤»
..rakudo-jvm 82effd: OUTPUT«100000000000000000000000000000000␤100000000000000000000000000000000␤»
grondilu ^see?
I need to divide the exponant 19:42
TimToady ah, doesn't recognize that 32/1 is an integer
should probably have a Rat multi that looks for that
grondilu r: say .Int for 10**32, 10**(64 div 2)
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«100000000000000000000000000000000␤100000000000000000000000000000000␤»
grondilu I guess I could use div
lue Whoops, I forgot all about moar being a target. I was just thinking parrot/jvm :P
Util raiph: Yes, I am considering that. You build 2 anon-subs for each sort column (forward & backwards each), and call the relevant blocks accorting to the current UI-selected sort order. 19:43
lue So instead, "I'm not sure how libtommath is messing up powers of 10..." 19:44
TimToady it's not libtommath, I think, but infix:<**> not considering a Rat as a potential Int 19:45
lue knows floating point, but powers of 10 is something I don't expect breaking that easily.
TimToady p: say "foo" ** "bar" 19:46
camelia rakudo-parrot 82effd: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏foo' (indicated by ⏏)␤ in method Numeric at gen/parrot/CORE.setting:12144␤ in sub infix:<**> at gen/parrot/CORE.setting:4035␤ in sub infix:<**> at gen/p…»
TimToady hmm, how to trigger the message...
p: say 42 ** Nil 19:47
camelia rakudo-parrot 82effd: OUTPUT«use of uninitialized value of type Nil in numeric context in block at /tmp/zw75xUj0sp:1␤␤1␤»
TimToady p: say 42 ** Mu
camelia rakudo-parrot 82effd: OUTPUT«Nominal type check failed for parameter '$b'; expected Any but got Mu instead␤ in sub infix:<**> at gen/parrot/CORE.setting:4033␤ in block at /tmp/2r1ZLp1iSJ:1␤␤»
TimToady how do we introspect candidates for infix:<**>?
say &infix:<**>.^methods 19:48
jnthn .candidates
TimToady p: say &infix:<**>.^methods
camelia rakudo-parrot 82effd: OUTPUT«<anon> IS_PURE <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> of returns onlystar assuming candidates cando multi soft wrap unwrap yada package perl <anon> add_phaser fire_phasers phasers <anon> <anon> <…»
TimToady p: say &infix:<**>.candidates
camelia rakudo-parrot 82effd: OUTPUT«sub infix:<**>($x = { ... }) { ... } sub infix:<**>(\a, \b) { ... } sub infix:<**>(Real \a, Real \b) { ... } sub infix:<**>(Int:D \a, Int:D \b) { ... } sub infix:<**>(Num:D \a, Num:D \b) { ... } sub infix:<**>(num $a, num $b) { ... } sub infix:<**>(Ratio…»
TimToady p: .say for &infix:<**>.candidates
camelia rakudo-parrot 82effd: OUTPUT«sub infix:<**>($x = { ... }) { ... }␤sub infix:<**>(\a, \b) { ... }␤sub infix:<**>(Real \a, Real \b) { ... }␤sub infix:<**>(Int:D \a, Int:D \b) { ... }␤sub infix:<**>(Num:D \a, Num:D \b) { ... }␤sub infix:<**>(num $a, num $b) { ... }␤sub infi…»
TimToady well, like that helps much on irc... : 19:49
:/
jnthn p: .say for &infix:<**>.candidates>>.signature
camelia rakudo-parrot 82effd: OUTPUT«:($x = { ... })␤:(\a, \b)␤:(Real \a, Real \b)␤:(Int:D \a, Int:D \b)␤:(Num:D \a, Num:D \b)␤:(num $a, num $b)␤:(Rational \a, Int \b)␤:(Complex:D \a, Complex:D \b)␤:(Real \a, Complex:D \b)␤:(Complex:D \a, Real \b)␤»
TimToady yes, no candidate with a Rat on the right that can see if it has a denominator of 1 19:50
raiph Util: won't there be significant execution overhead (multiple lists, multiple calls to underlying sort) unless you massage everything to fit a single call to the underlying sort (ie do what the spec currently says the sort builtin is supposed to do)? 19:52
colomon r: say (32/2).narrow 19:53
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«16␤»
19:53 smls left
TimToady colomon: but you can't just redispatch unless you know the type changed 19:55
colomon TimToady: right
TimToady: that was mostly a test to see if .narrow worked yet. ;)
TimToady ok
r: say 32/2
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«16␤»
TimToady but how could you tell? 19:56
colomon TimToady: it didn't say, "What do you mean, .narrow?"
lue r: say (32/2).WHAT; say (32/2).narrow.WHAT;
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«(Rat)␤(Int)␤»
TimToady ah, I see
colomon I mean, I guess somebody could have implemented a non-functional version, but that seems unlikely.
TimToady you never know in these days of uncertainty
skids
.oO(multi sub f (Int(Rat)$a) {...}; multi sub f (Rat $a) {...}; # which gets called...)
19:58
TimToady p: say Int(27/7) 19:59
camelia rakudo-parrot 82effd: OUTPUT«3␤»
TimToady looks ambiguous to me
lue skids: Doesn't more derived type win? Or am I thinking in regexes? :)
TimToady well, is "able to be coerced" considered a constraint?
in any case, Int() can coerce a non-integral Rat 20:00
hmm, I guess I wanted 22/7
skids Yeah and it would be too much DWIM to discriminate using such a form.
20:01 Sqirrel joined
TimToady either that, or I was aiming for 7 - pi 20:01
lue Looks like you'd have to use those old "candidate specifiers", wherever they're lying around...
TimToady p: multi f (Rat $r where $r.denominator == 1) { say "$r is Intish!" }; multi f (Rat $r) { say "$r is Ratty!" }; f 32/2 20:04
camelia rakudo-parrot 82effd: OUTPUT«16 is Intish!␤»
TimToady p: multi f (Rat $r where $r.denominator == 1) { say "$r is Intish!" }; multi f (Rat $r) { say "$r is Ratty!" }; f 33/2
camelia rakudo-parrot 82effd: OUTPUT«16.5 is Ratty!␤»
20:04 denis_boyun_ left
skids Does that rely on implementation-specific behavior as to when the Rat is reduced? 20:06
20:06 rindolf joined
lue &foo:(signature) is what I was thinking of. 20:07
TimToady I believe asking for numer or denom should force reduction
if it isn't known to be forced already
lue [ So &f:(Int) and &f(Int(Rat)) ] 20:08
PerlJam Would anyone ever ask a Rat for the num/dem that were used to create it?
lue er, &f:(Rat)
skids TimToady: yes, "All interface methods return values as if the numerator and denominator were stored in a normal form"
TimToady PerlJam: of course they will
[Coke] PerlJam: no, and they should feel bad for thinking about it. :P
TimToady that doesn't mean we have to give it to them
[Coke] keeps up his 0% track record of agreeing with timtoday. :)
PerlJam heh
TimToady 32/2 but RememberTheOriginalValue; :) 20:09
colomon what does <32/2> do? 20:10
TimToady not what it's supposed to do. :P
rn: say <32/2>.WHAT
camelia niecza v24-109-g48a8de3: OUTPUT«(Rat)␤»
..rakudo-parrot 82effd, rakudo-jvm 82effd: OUTPUT«(Str)␤»
PerlJam on *some* implementations 20:11
20:11 treehug88 left
TimToady it's supposed to do that on all implementations, so it doesn't :) 20:11
lue
.oO(Both seem like right answers; if only there were a way to combine Rat and Str!)
TimToady which would be wrong for <32/2>, which is specced to be Rat
not RatStr
lue rn: say < 32/2 >.WHAT 20:12
camelia niecza v24-109-g48a8de3: OUTPUT«(RatStr)␤»
..rakudo-parrot 82effd, rakudo-jvm 82effd: OUTPUT«(Str)␤»
FROGGS ohh, rn does not run moar
moritz: ^^ 20:13
lue moritz: have you thought about subjecting evalbot's interpreter: specifier to a regex, instead of hardcoding the list? :)
FROGGS lue: does not work 20:14
at least not when we had a q backend
then nqp would run that besides niecza and pugs
TimToady LTM? 20:15
lue rakudo-jvm|nqp-jvm|star|rakudo-moar|pugs|std|niecza|p5-to-p6|nqp-parrot|b|rakudo-parrot|nqp-moarvm|nom|rnP|r|nPr|rPn|Prn|j|nqp-m|Pnr|nqp-mvm|nqp-j|nr|p6|rm|n|p56|rj|perl6|nqp|r-j|P|rn|rakudo|m|r-jvm|nqp-p|nrP|p|r-m|r-p|rp 20:16
r: say "rakudo-jvm|nqp-jvm|star|rakudo-moar|pugs|std|niecza|p5-to-p6|nqp-parrot|b|rakudo-parrot|nqp-moarvm|nom|rnP|r|nPr|rPn|Prn|j|nqp-m|Pnr|nqp-mvm|nqp-j|nr|p6|rm|n|p56|rj|perl6|nqp|r-j|P|rn|rakudo|m|r-jvm|nqp-p|nrP|p|r-m|r-p|rp".split("|").elems;
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«43␤»
20:17 zakharyas left
grondilu how can I do / .**{$some-value} / ? 20:18
lue / .**{$some-value} / 20:19
grondilu r: say <a b>.roll(100).match: / .**{10} /;
camelia rakudo-moar 82effd: OUTPUT«===SORRY!=== Error while compiling /tmp/TOmI4s5Ioz␤Block case of ** quantifier not yet implemented␤at /tmp/TOmI4s5Ioz:1␤------> say <a b>.roll(100).match: / .**⏏{10} /;␤ expecting any of:␤ method a…»
..rakudo-jvm 82effd: OUTPUT«===SORRY!=== Error while compiling /tmp/AleKFYW8Q8␤Block case of ** quantifier not yet implemented␤at /tmp/AleKFYW8Q8:1␤------> say <a b>.roll(100).match: / .**⏏{10} /;␤ expecting any of:␤ method ar…»
..rakudo-parrot 82effd: OUTPUT«===SORRY!=== Error while compiling /tmp/r5TngaJ7fK␤Block case of ** quantifier not yet implemented␤at /tmp/r5TngaJ7fK:1␤------> say <a b>.roll(100).match: / .**⏏{10} /;␤ expecting any of:␤ method…»
grondilu NYI
lue EVAL("/ .**" ~ $some-value ~ " /")
grondilu yes, thanks
20:20 treehug88 joined
grondilu finally managed to make rosettacode.org/wiki/Arithmetic-geo..._Pi#Perl_6 work 20:23
skids thinks "view" would be consistent model for accessing Rat internal state, if ever needed. 20:24
grondilu you have .nude, don't you?
20:25 treehug88 left
PerlJam
.oO( and .clothed could show the num/dem that were used to create the Rat )
20:25
skids nude is an interface method, and subject to above rule.
Well, that's mincing meanings. nude is nude as opposed to "dressed in a Rat object" 20:26
PerlJam you saying "mincing", I say "pun" ;) 20:27
20:28 treehug88 joined
jnthn doesn't like "nude" and "mincing" so close in conversation :P 20:28
PerlJam er, s/saying/say/ (weird braino)
skids But mincing is best done nude, for some definitions of mincing :-) 20:29
PerlJam "This week on the Nudists Kitchen we'll show you how to make a great dish using only Rats"
20:39 raiph left 20:41 denisboyun joined 20:47 LLamaRider left
clsn OK, I have about half an hour; let's get this github fork going so I can send a pull request. 20:50
20:51 denisboyun left, Mouq joined
dalek pan style="color: #395be5">perl6-examples: 3f3b363 | util++ | / (5 files):
Fix typos
20:51
[Coke] seen sorear? 20:56
yoleaux: seen sorear?
dalek kudo/nom: b3a59a0 | jnthn++ | src/Perl6/Actions.nqp:
Factor out adding return type check.
kudo/nom: 71e08b2 | jnthn++ | src/ (3 files):
Get return type checks in place.

Doesn't emit check code at all for unconstrained.
[Coke] preflex: seen sorear?
preflex sorear was last seen on #perl6 123 days, 13 hours, 26 minutes and 41 seconds ago, saying: o/
clsn sends pull request. And the crowd goes wild. 20:58
20:58 beastd joined, SHODAN joined, REPLeffect left 20:59 stevan_ left
Mouq clsn++ # (haven't tested it myself, of course) 21:02
it looks like your leading whitespace is a little off 21:03
clsn I should upload the signature matching tests I made someplace. I hit some of the finer cases. And found a few places we can't handle.
Hm; I was counting on my editor to do the whitespacing; sorry. 21:04
colomon jnthn++ already updated rakudo/nom since I started the compile process, sigh.
clsn: oh, please upload the tests!
21:04 jnap left, jnap joined
Mouq clsn: it's fine :) i think it used tabs, and if so that's just a search and replace 21:04
clsn colomon: Where's a good place to send tests? 21:05
mmph. Maybe I'll have a talk with my editor about tabs and spaces...
jnthn clsn: You can get a commit bit to the tests repository...
clsn: We give those out quite freely
Just mention your github ID 21:06
colomon clsn: roast
jnthn: it's clsn
(judging by the patch)
clsn OK... I should probably add some more and make it more thorough I guess if it's to be the real roast stuff...
jnthn hugme: add clsn to roast
hugme jnthn: Feature disabled due to bitrot
jnthn aww
colomon jnthn: I'll do it 21:07
japhb hugme++ # Useful error message instead of mysterious failure
clsn Matching currently fails on parametric variables, though. I'm not even sure *how* we should do those.
colomon jnthn: er, I can't do it. :\
jnthn clsn: Added.
clsn Thanks. 21:08
Mouq hugme: hug clsn
hugme hugs clsn
clsn aws and hugs hugme.
21:09 hummeleBop left
Mouq re: #121024 : 21:12
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=121024
Mouq nqp: my $r := "z|abc"; say("peterabcde" ~~ /<$r>/)
r: my $r := "z|abc"; say("peterabcde" ~~ /<$r>/)
camelia nqp-moarvm, nqp-jvm, nqp-parrot: OUTPUT«abc␤»
rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«「pet」␤␤»
xfix r: my $n = "12345"; say / (\d+) <{ $0.is-prime }> / 21:15
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«␤»
xfix r: my $n = "12345"; say $n ~~ / (\d+) <{ $0.is-prime }> /
camelia rakudo-jvm 82effd: OUTPUT«No such method 'is-prime' for invocant of type 'Match'␤␤Error while creating backtrace: Cannot unbox a type object␤ in block at gen/jvm/CORE.setting:10595␤ in block at gen/jvm/CORE.setting:7365␤ in method reify at gen/jvm/CORE.setting:7316␤…»
..rakudo-parrot 82effd: OUTPUT«No such method 'is-prime' for invocant of type 'Match'␤ in block at /tmp/scUFoxkusD:1␤␤»
..rakudo-moar 82effd: OUTPUT«Cannot find method 'is-prime'␤ in block at /tmp/jFWMDXYA3W:2␤␤»
xfix parrot: my $n = "12345"; say $n ~~ / (\d+) <{ $0.Int.is-prime }> /
rp: my $n = "12345"; say $n ~~ / (\d+) <{ $0.Int.is-prime }> / 21:16
camelia rakudo-parrot 82effd: OUTPUT«Nil␤»
xfix Am I doing something wrong here?
Mouq do you mean <?{ }> ? 21:17
xfix rp: my $n = "12345"; say $n ~~ / (\d+) <?{ $0.Int.is-prime }> /
camelia rakudo-parrot 82effd: OUTPUT«「23」␤ 0 => 「23」␤␤»
xfix Great. It finds a prime in the string.
21:17 dayangkun joined
Mouq <{ … }> interpolates, it seems 21:18
also, that's really awesome
xfix It's probably slow, but it looks nicely.
I'm doing codegolf.stackexchange.com/q/18592/3103. Now to find a biggest prime. 21:19
Mouq rp: my $n = "12345"; my $a; $n ~~ / (\d+) {$a++} <?{ $0.Int.is-prime }> /; say $a
camelia rakudo-parrot 82effd: OUTPUT«8␤»
xfix rp: my $n = "13571"; say $n ~~ / (\d+) <?{ $0.Int.is-prime }> /
camelia rakudo-parrot 82effd: OUTPUT«「13」␤ 0 => 「13」␤␤»
xfix It finds 13 here, but my intent is to find 3571. 21:20
21:20 REPLeffect joined
Mouq hmm 21:20
jnthn Match it with exhaustive and then ge the biggest result? 21:22
Mouq r: say [max] <a abcd efghijk>
xfix What is short form of exhaustive?
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«efghijk␤»
xfix r: say max <a abcd efghijk>
jnthn rp: "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex)>>.max
camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«efghijk␤»
( no output )
Mouq xfix: m:ex// 21:23
jnthn rp: say "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex).max
camelia rakudo-parrot 82effd: OUTPUT«「71」␤ 0 => 「71」␤␤»
xfix ok
lue rp: my $n = "13571"; say $n ~~ /:ex (\d+) <?{ $0.Int.is-prime }> /
camelia rakudo-parrot 82effd: OUTPUT«===SORRY!=== Error while compiling /tmp/SVpj__MoOz␤Unrecognized regex modifier :ex␤at /tmp/SVpj__MoOz:1␤------> my $n = "13571"; say $n ~~ /:ex⏏ (\d+) <?{ $0.Int.is-prime }> /␤»
jnthn rp: say "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex).max(*.Int)
camelia rakudo-parrot 82effd: OUTPUT«「3571」␤ 0 => 「3571」␤␤»
jnthn There we go.
rp: say "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex).max(+*) # golf :)
camelia rakudo-parrot 82effd: OUTPUT«「3571」␤ 0 => 「3571」␤␤»
jnthn rp: say "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex)[*-1]
camelia rakudo-parrot 82effd: OUTPUT«「7」␤ 0 => 「7」␤␤»
jnthn ah, yeah
xfix rp: say max 13571~~m:ex/(\d+)<?{(+$0).is-prime}>/ 21:24
camelia rakudo-parrot 82effd: OUTPUT«False␤»
21:24 denisboyun joined
xfix rp: say "13571"~~m:ex/(\d+)<?{(+$0).is-prime}>/ 21:24
camelia rakudo-parrot 82effd: OUTPUT«False␤»
xfix rp: say "13571"~~m:ex/(\d+)<?{$0.Int.is-prime}>/
camelia rakudo-parrot 82effd: OUTPUT«False␤»
Mouq lue: that would be pretty cool. match exaustively in some places but not others. i suppose the effect could be acheived with multiple regexes and the :pos modifier 21:25
PerlJam rp: say "13571"~~/(\d+$)<?{$0.Int.is-prime}>/
camelia rakudo-parrot 82effd: OUTPUT«「3571」␤ 0 => 「3571」␤␤»
PerlJam :-)
Mouq or rather the :continue modifier
xfix PerlJam, this works only if it's at end of string ;-).
rp: say "13571"~~m:ex/(\d+$)<?{$0.Int.is-prime}>/ 21:26
camelia rakudo-parrot 82effd: OUTPUT«False␤»
xfix rp: say "13571".match(/(\d+$)<?{$0.Int.is-prime}>/,:ex)
camelia rakudo-parrot 82effd: OUTPUT«「3571」␤ 0 => 「3571」␤ 「571」␤ 0 => 「571」␤ 「71」␤ 0 => 「71」␤␤»
xfix rp: say max "13571".match(/(\d+$)<?{$0.Int.is-prime}>/,:ex)
camelia rakudo-parrot 82effd: OUTPUT«「71」␤ 0 => 「71」␤␤»
PerlJam xfix: well, you weren't clear why you wanted it to match 3571 rather than 13 :)
xfix Because it's longer.
[Coke] jnthn++ nailed it earlier. 21:30
xfix rp: say max +<<"13571".match(/(\d+$)<?{$0.Int.is-prime}>/,:ex)
camelia rakudo-parrot 82effd: OUTPUT«3571␤»
xfix great
PerlJam xfix: um ... you need to take that $ out of the pattern 21:31
xfix uhm yeah
21:32 jeffreykegler left
xfix say max +<<get.match(/(\d+)<?{(+$0).is-prime}>/,:ex) 21:32
This is my current solution.
21:36 bjz left 21:37 bjz joined
xfix codegolf.stackexchange.com/a/18775/3103 21:38
It's rather long. I'm surprised that there are many shorter solution.
Not that I care or anything.
solutions*
21:40 bluescreen10 left
xfix r: pi 21:40
r: say pi
camelia ( no output )
rakudo-jvm 71e08b: OUTPUT«3.141592653589793␤»
..rakudo-parrot 71e08b: OUTPUT«3.14159265358979␤»
..rakudo-moar 71e08b: OUTPUT«3.141593␤»
21:40 bluescreen10 joined
xfix 415926535897 21:40
Great.
PerlJam xfix: wait ... unicode « counts as two characters?!? where is that written? 21:41
xfix codegolf.stackexchange.com/tags/code-golf/info 21:42
"If you use Unicode, byte count should use UTF-8."
In UTF-8, 􏿽xAB is two characters.
PerlJam bummer 21:43
xfix perl6: say +<<3141592653589793.match(/(\d+)<?{(+$0).is-prime}>/,:ex) 21:44
camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«314159 31 3 141592653589 14159 415926535897 4159 41 1592653 5926535897 59 5 2 6535897 653 53 5 358979 35897 3 589793 58979 5897 5 89 97 79 7 3␤»
..niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Excess arguments to Cool.match, unused named ex␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (Cool.match @ 1) ␤ at /tmp/Du2HTSuxYz line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) …»
PerlJam If the solutions are all about the minimum number of *characters*, then they should use actual characters! :)
xfix oeis.org/A198187
OEIS has sequences for everything 21:45
Except my regex shows them in wrong order...
Mouq r: say +<<3141592653589793.match(/(\d+?)<?{(+$0).is-prime}>/,:ex) 21:46
xfix (also, surprisingly fast, for something that abuses regular expressions)
camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«3 31 314159 14159 141592653589 41 4159 415926535897 1592653 5 59 5926535897 2 653 6535897 5 53 3 35897 358979 5 5897 58979 589793 89 97 7 79 3␤»
Mouq closer
xfix I would expect this to be slow, but it's actually rather fast. 21:47
PerlJam xfix: Thank jnthn++ and pmichaud++; they know what they are doing. :) 21:49
lue ~ $ which perl6-m
~ $ perl6-m -e 'say "HELLO $*VM<name>"'
HELLO moar
xfix Thanks.
lue which perl6-m
/usr/local/bin/perl6-m
13:48:55 matthew@AMD64 ~ $ perl6-m -e 'say "HELLO $*VM<name>"'
HELLO moar
So jnthn++ \o/ 21:50
jnthn yay
grondilu shouldn't there be 'subset Prime of Int where {...}' instead of &is-prime? 21:52
I mean, &is-something seems quite unelegant to me. 21:53
xfix Looks like an interesting idea 21:54
$number ~~ Prime
PerlJam you can always make your own Prime thingy built on is-prime :)
grondilu
.oO( everytime I suggest something, I'm told that I can always make my own module :/ )
21:55
colomon grondilu: well, you can
PerlJam grondilu: what don't you like about is-prime exactly? 21:56
grondilu r: subset Prime of Int where &is-prime; say { $_ ~~ Prime } for ^10;
xfix I like Perl 6 for code golf. Reduce operators are just great.
camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤»
grondilu r: subset Prime of Int where &is-prime; say map { $_ ~~ Prime }, ^10;
camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«False False True True False True False True False False␤»
xfix Make a function that only takes prime numbers :-). 21:57
PerlJam grondilu: you were close the first time btw ... say $_ ~~ Prime for ^10; # (no curlies) 21:58
21:58 benabik left
colomon r: subset Prime of Int where &is-prime; sub lazy-prime-factorization(Prime $a) { $a.Bag; }; say lazy-prime-factorization(11); say lazy-prime-factorization(12) 21:59
camelia rakudo-moar 71e08b: OUTPUT«bag(11)␤Constraint type check failed for parameter '$a'␤ in sub lazy-prime-factorization at /tmp/Ai2ahN2kJR:2␤ in block at /tmp/Ai2ahN2kJR:2␤␤»
..rakudo-parrot 71e08b: OUTPUT«bag(11)␤Constraint type check failed for parameter '$a'␤ in sub lazy-prime-factorization at /tmp/KfCSix51uW:1␤ in block at /tmp/KfCSix51uW:1␤␤»
..rakudo-jvm 71e08b: OUTPUT«bag(11)␤Constraint type check failed for parameter '$a'␤ in sub lazy-prime-factorization at /tmp/ZEynBQdRI3:1␤ in block at /tmp/ZEynBQdRI3:1␤␤»
grondilu what I don't like is that it does not match the way we usually test for an object to belong to a kind. I mean, when you want to see if $_ is an instance of a class Foo, you don't write $_.is-Foo, do you? You write $_ ~~ Foo
r: class Foo { }; my $x = Foo.new; say $x ~~ Foo 22:00
camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«True␤»
xfix In Perl 6, ~~ is `is` for me.
PerlJam Is primality a "kind" or a property?
lue objects and mathematical properties are separate as far as I'm aware. 22:01
(unless you create an object for that property, that is)
xfix PerlJam: Uhm, it's subset.
grondilu I just think that the subset concept fits the use case of prime numbers pretty well. 22:02
colomon ~~ is not subset
skids problem spec says string can be assumed to be \d+, so you can lose '\d' for '.'
xfix I think that there is an example of Odd subset. 22:03
grondilu I've just checked in the core, the only subset there is UInt64
xfix Prime is also a subset, just like Odd and Even.
lue what, that's a subset?
grondilu UInt64.pm, line 2 22:04
subset UInt64 of Int where { 0 <= $_ < $UINT64_UPPER }
colomon that's…. pretty wrongish
grondilu why?
lue It works, but I definitely wouldn't think in Perl6 subsets for that.
colomon maybe "pointless" would be more appropriate than wrongish? 22:05
I'm not seeing an obvious for an Int which is restricted to 64 bit values, but not actually implemented that way? 22:06
which doesn't necessarily mean it's not in the spec somewhere.
lue Yeah, I'd expect to see UInt32, Int16, etc. We already have native types for that anyway, right? /me searches the spec for UInt64
PerlJam as a side note, the specs talk about "subtypes" but make them with "subset" (that's a little weird to me)
lue PerlJam: ooh. I agree with that being weird. 22:07
colomon PerlJam: it's kind of weird now that we have actual sets
PerlJam indeed
colomon subset operators, etc.
lue specs repo: $ ack -u UInt64 22:08
$
(that should've hit the .git directory too, if I'm not mistaken)
PerlJam grondilu, xfix: maybe there's a case for a module that creates subtypes for many common things like Prime, Triangular, PerfectSquare, whatever 22:09
japhb 22:10
lue nothing in roast either. UInt64 looks like some sort of relic or mistake to me.
japhb lue: Perhaps used as a hack to see if something can safely be converted to native? 22:11
japhb not looking at source tree, obviously
colomon I don't see any sign it is called anywhere.
lue It's a two-line file.
colomon and the sole "use" seems to be 22:12
# XXX: should be Rational[Int, UInt64]
grondilu PerlJam: we don't need a module to call is-prime, do we?
lue should be uint64 rather
grondilu PerlJam: but I get your point, I've just checked in S12 and it is said that: « A subtype is primarily a handy way of sneaking 22:13
smartmatching into multiple dispatch. »
and it's indeed not too often that we have to restrict a function to prime integers
PerlJam right. 22:14
grondilu so ok, no subtype for Prime I guess.
colomon lue: actually, looks like the spec has Rational[Int,Uint64] 22:15
"By default, this is the precision that would be represented by the Rat64 type, which is an alias for Rational[Int,Uint64], which has a numerator of Int but is limited to a denominator of Uint64 (which may or may not be implemented as a native uint64, since small representations may be desirable for small denominators)."
lue stupid cases! 22:16
dalek rl6-roast-data: 7b34c0c | coke++ | / (6 files):
today (automated commit)
22:17
colomon but that said, I can't really imagine why you'd use Uint64 instead of uint64 there if you had both.
[Coke] 98.34% # moar
lue Uint64 is the only non-native sized integer type I can see in the spec.
There's Num64 and Rat64 ... 22:18
And Buf8. Probably more non-native sized types floating around though. 22:19
I get the sense that 64-bit non-native types were popular at one point :) 22:20
In any case, I think Uint64/UInt64 is useless, possibly along with other similar types. 22:23
22:25 rindolf left, rindolf joined 22:29 btyler left 22:32 skids left 22:36 Mouq left 22:40 stevan_ joined 22:42 rindolf left, rindolf joined 22:50 rindolf left 22:51 kbaker_ left 22:55 kaare_ joined 23:01 treehug88 left 23:11 mtk left, bjz left, bjz_ joined 23:12 colomon joined 23:16 bluescreen10 left 23:22 grondilu left 23:23 denisboyun left, Sqirrel_ joined, Sqirrel left 23:24 BenGoldberg joined 23:27 bjz_ left, Sqirrel_ left, Sqirrel joined, bjz joined 23:32 spider-mario left
[Coke] r: class A { has %!x } 23:33
camelia ( no output )
[Coke] r: class A { has %!x ; %!x<bar>=42 } 23:34
camelia rakudo-jvm 71e08b: OUTPUT«===SORRY!=== Error while compiling /tmp/KEF4k_OfP6␤Variable %!x used where no 'self' is available␤at /tmp/KEF4k_OfP6:1␤------> class A { has %!x ; %!x⏏<bar>=42 }␤»
..rakudo-moar 71e08b: OUTPUT«===SORRY!=== Error while compiling /tmp/8hMGUxHI7U␤Variable %!x used where no 'self' is available␤at /tmp/8hMGUxHI7U:1␤------> class A { has %!x ; %!x⏏<bar>=42 }␤»
..rakudo-parrot 71e08b: OUTPUT«===SORRY!=== Error while compiling /tmp/jOM3dpb_QR␤Variable %!x used where no 'self' is available␤at /tmp/jOM3dpb_QR:1␤------> class A { has %!x ; %!x⏏<bar>=42 }␤»
[Coke] I really need to stop use r for questionable code.
dalek ast: 6095efc | coke++ | / (2 files):
RT #76432 - add/mark tests
23:37
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...l?id=76432
lue wonders if evalbot can be taught that /tmp/<file> is not significant
dalek kudo/nom: 6aa2f1d | jnthn++ | src/Perl6/Actions.nqp:
Some missing declaration_static.
23:38
jnthn lue: May be easier to get it to use the same input file for all of the things it runs...
lue that sounds like a better solution :) 23:39
diakopter well it queues the files asynchronously 23:41
23:43 Mouq joined 23:48 Mouq left 23:49 kaare_ left 23:50 kaare_ joined