Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-10-25

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 AlexDaniel commitatble6: 2015.07.2 my @a = 'a'..'c'; say lazy @a;
00:00 committable6 AlexDaniel, ¦«2015.07.2»: a b c
00:01 AlexDaniel BenGoldberg: the change happened somewhere between 2015.07 and 2015.09, but can't tell when exactly
00:01 AlexDaniel would've been nice to know because the answer is sometimes in the commit message
00:02 jackc2 joined #perl6
00:02 BenGoldberg Also, the Nil vs Any thing is a bit wierd.
00:02 ggherdov joined #perl6
00:03 gfldex_ AlexDaniel: Nil may be a dd artifact
00:03 AlexDaniel BenGoldberg: ↑
00:05 bjz joined #perl6
00:05 * BenGoldberg wonders what would happen if whatever is creating those Nil values were to instead return Empty.
00:05 BenGoldberg m: say +eager 'a'..'c';
00:05 camelia rakudo-moar aaec51: OUTPUT«3␤»
00:05 BenGoldberg m: say +lazy 'a'..'c';
00:05 camelia rakudo-moar aaec51: OUTPUT«Cannot .elems a lazy list␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
00:06 BenGoldberg m: say +eager lazy 'a'..'c';
00:06 camelia rakudo-moar aaec51: OUTPUT«3␤»
00:06 BenGoldberg m: .say for lazy 'a'..'c';
00:06 camelia rakudo-moar aaec51: OUTPUT«a␤b␤c␤»
00:10 pierre_ joined #perl6
00:15 mcmillhj joined #perl6
00:26 bartolin_ joined #perl6
00:26 Bucciarati_ joined #perl6
00:35 mcmillhj joined #perl6
00:44 pierre_ joined #perl6
00:46 pierre_ joined #perl6
01:05 aborazmeh joined #perl6
01:05 aborazmeh joined #perl6
01:08 pierre_ joined #perl6
01:12 pierre_ joined #perl6
01:22 snowman_ joined #perl6
01:41 FROGGS_ joined #perl6
01:46 Jesmaybe joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:02 stigo joined #perl6
02:07 pierre_ joined #perl6
02:24 Actualeyes joined #perl6
02:28 cpage joined #perl6
02:28 john51 joined #perl6
02:33 john51 joined #perl6
02:38 john51 joined #perl6
02:38 pierre_ joined #perl6
02:43 john51 joined #perl6
02:48 seatek oh my god grammars now - one thing keeps leading to another. my head's going to explode. i need to set up a webcam so someone could call an ambulance. like it would matter. oh, my poor monitors!
02:48 seatek these are looking pretty fun and interesting though
02:49 seatek ugh. so much to rewrite now, though, if i use them. and then if i do, i'll be addicted, unable to use anything else ever again.
02:50 seatek so good it must be evil
02:51 noganex_ joined #perl6
02:52 seatek i feel like i've had this dream before
02:54 pierre_ joined #perl6
02:59 itaipu joined #perl6
03:02 andrzejku_ joined #perl6
03:04 seatek this ».ast stuff feels like voodoo, like something tacked-on as an extra nifty feature. but this is how the language itself is composed?
03:05 seatek have feeling learning grammars is going to make me learn about lot more in p6 than i can suspect right now
03:05 mcmillhj joined #perl6
03:11 cognominal joined #perl6
03:11 _28_ria joined #perl6
03:13 dj_goku joined #perl6
03:16 Jesmaybe joined #perl6
03:22 itaipu joined #perl6
03:28 itaipu joined #perl6
03:38 jackc2 \HELP
04:01 cibs joined #perl6
04:02 andrzejku_ joined #perl6
04:08 BenGoldberg m: dd gather take 42;
04:08 camelia rakudo-moar aaec51: OUTPUT«(42,).Seq␤»
04:16 xyf joined #perl6
04:16 xyf hello.
04:17 pierre_ joined #perl6
04:30 vendethiel joined #perl6
04:33 Cabanossi joined #perl6
04:34 canopus joined #perl6
04:35 brillenfux joined #perl6
04:52 wamba joined #perl6
05:16 vendethiel- joined #perl6
05:46 ufobat joined #perl6
05:52 RabidGravy joined #perl6
06:03 zacts joined #perl6
06:05 abraxxa joined #perl6
06:19 neuraload joined #perl6
06:22 wamba joined #perl6
06:23 firstdayonthejob joined #perl6
06:27 nine seatek: yes, grammars are just awesome :)
06:38 cpage_ joined #perl6
06:41 broquaint joined #perl6
06:42 Actualeyes joined #perl6
06:42 literal_ joined #perl6
06:58 dalek Inline-Perl5: b6bc0fc | niner++ | p5helper.c:
06:58 dalek Inline-Perl5: Fix warning due to unset return value in p5_init_callbacks
06:58 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/b6bc0fc366
07:02 wamba joined #perl6
07:03 bjz joined #perl6
07:11 CIAvash joined #perl6
07:13 domidumont joined #perl6
07:14 darutoko joined #perl6
07:18 domidumont joined #perl6
07:24 Actualeyes joined #perl6
07:31 bjz joined #perl6
07:34 * lizmat clickbaits https://p6weekly.wordpress.com/2016/10/24/2016-43-shining-star/
07:42 hchienjo joined #perl6
07:44 dakkar joined #perl6
07:45 aries_liuxueyang joined #perl6
07:55 nadim joined #perl6
07:57 aries_liuxueyang joined #perl6
08:01 jonas3 joined #perl6
08:08 pierre__ joined #perl6
08:12 dj_goku_ joined #perl6
08:14 FROGGS joined #perl6
08:24 aries_liuxueyang joined #perl6
08:27 pierre_ joined #perl6
08:38 f3ew_ .win 15
08:46 moritz lizmat++
08:51 wamba joined #perl6
08:56 bjz_ joined #perl6
08:59 andrzejku_ joined #perl6
09:05 wamba joined #perl6
09:07 andrzejku_ joined #perl6
09:09 grondilu joined #perl6
09:09 grondilu m: say log(8) %% log(2)
09:09 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
09:10 grondilu weird, I get false in local
09:10 grondilu $ perl6 --version
09:10 grondilu This is Rakudo version 2016.10-37-g127b3be built on MoarVM version 2016.10-15-g715e39a
09:11 grondilu implementing Perl 6.c
09:11 grondilu m: print $*VM<version>
09:11 camelia rakudo-moar 84b4c8: OUTPUT«Type VM does not support associative indexing.␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
09:11 grondilu m: print $*VERSION
09:11 camelia rakudo-moar 84b4c8: OUTPUT«Dynamic variable $*VERSION not found␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
09:11 grondilu m: print $?VERSION
09:11 camelia rakudo-moar 84b4c8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$?VERSION' is not declared. Did you mean 'Version'?␤at <tmp>:1␤------> 3print 7⏏5$?VERSION␤»
09:11 grondilu I never ever can remember how to get that
09:12 grondilu m: say $*PERL
09:12 camelia rakudo-moar 84b4c8: OUTPUT«Perl 6 (6.c)␤»
09:12 grondilu m: say $*PERL.^methods
09:12 camelia rakudo-moar 84b4c8: OUTPUT«(BUILD VMnames DISTROnames KERNELnames Str gist compiler name auth version signature desc)␤»
09:12 grondilu m: say $*PERL.version
09:12 camelia rakudo-moar 84b4c8: OUTPUT«v6.c␤»
09:12 grondilu m: say $*PERL.compiler
09:12 camelia rakudo-moar 84b4c8: OUTPUT«rakudo (2016.10.53.g.84.b.4.c.83)␤»
09:15 rindolf joined #perl6
09:22 grondilu m: say log(8) % log(2)
09:22 camelia rakudo-moar 84b4c8: OUTPUT«0␤»
09:22 grondilu I get 0.693147180559945 in local
09:23 grondilu m: say log(8) % log(2) - log(2)
09:23 camelia rakudo-moar 84b4c8: OUTPUT«-0.693147180559945␤»
09:23 grondilu I get -1.11022302462516e-16
09:24 grondilu p6: say log(8) %% log(2)
09:24 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
09:24 grondilu star: say log(8) %% log(2)
09:24 camelia star-m 2016.04: OUTPUT«True␤»
09:24 grondilu jvm: say log(8) %% log(2)
09:24 grondilu j: say log(8) %% log(2)
09:24 camelia rakudo-jvm 8d357a: OUTPUT«True␤»
09:25 * grondilu tries on his Pi
09:25 * grondilu gets the correct result there
09:26 aries_liuxueyang joined #perl6
09:28 grondilu m: say map .log %% 2.log ?? '.' !! '!', 1..10;
09:28 camelia rakudo-moar 84b4c8: OUTPUT«No such method 'log' for invocant of type 'Any'␤  in block <unit> at <tmp> line 1␤␤»
09:28 grondilu m: say map *.log %% 2.log ?? '.' !! '!', 1..10;
09:28 camelia rakudo-moar 84b4c8: OUTPUT«Cannot resolve caller map(Str, Range); none of these signatures match:␤    (&code, + is raw)␤  in block <unit> at <tmp> line 1␤␤»
09:29 grondilu m: say join map { .log %% 2.log ?? '.' !! '!' }, 1..10;
09:29 camelia rakudo-moar 84b4c8: OUTPUT«␤»
09:29 grondilu m: say join '', map { .log %% 2.log ?? '.' !! '!' }, 1..10;
09:29 camelia rakudo-moar 84b4c8: OUTPUT«..!.!!!.!!␤»
09:29 grondilu am I missing something here?
09:29 grondilu m: say join '', map { .log %% 2.log ?? '.' !! '!' }, 1..20;
09:29 camelia rakudo-moar 84b4c8: OUTPUT«..!.!!!.!!!!!!!.!!!!␤»
09:31 grondilu m: say join '', map { (.log %% 2.log) ?? '.' !! '!' }, 1..20;
09:31 camelia rakudo-moar 84b4c8: OUTPUT«..!.!!!.!!!!!!!.!!!!␤»
09:32 grondilu m: say join '', map { (1 +< .msb == $_) ?? '.' !! '!' }, 1..20;
09:32 camelia rakudo-moar 84b4c8: OUTPUT«..!.!!!.!!!!!!!.!!!!␤»
09:32 grondilu oh man, I'm so dumb
09:33 grondilu m: say join '', map { (.log %% 2.log) ?? '.' !! '!' }, 2 <<**<< 1..20;
09:33 camelia rakudo-moar 84b4c8: OUTPUT«.!.!!!.!!!!!!!.!!!!␤»
09:33 grondilu m: say join '', map { (1 +< .msb == $_) ?? '.' !! '!' }, 2 <<**<< 1..20;
09:33 camelia rakudo-moar 84b4c8: OUTPUT«.!.!!!.!!!!!!!.!!!!␤»
09:33 grondilu jeez
09:34 grondilu m: say 2**3 == 1 +< 3
09:34 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
09:34 grondilu m: say 2**6 == 1 +< 6
09:34 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
09:34 grondilu m: say (2**7).msb
09:34 camelia rakudo-moar 84b4c8: OUTPUT«7␤»
09:35 grondilu m: say (1 +< .msb == $_) given 2**2
09:35 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
09:35 grondilu m: say (1 +< .msb == $_) given 2**3
09:35 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
09:35 grondilu m: say (1 +< .msb == $_) given 2**4
09:35 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
09:36 grondilu m: say (1 +< .msb == $_) for  2 <<**<< 1..5
09:36 camelia rakudo-moar 84b4c8: OUTPUT«True␤False␤True␤False␤»
09:36 grondilu m: say (1 +< .msb == $_) for  2 <<**<< 2..4
09:36 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
09:36 grondilu ??
09:37 grondilu m: say (1 +< .msb == $_) for  2 <<**<< [2..4]
09:37 camelia rakudo-moar 84b4c8: OUTPUT«True␤True␤True␤»
09:37 grondilu ????
09:37 grondilu m: say join '', map { (1 +< .msb == $_) ?? '.' !! '!' }, 2 <<**<< [1..20];
09:37 camelia rakudo-moar 84b4c8: OUTPUT«....................␤»
09:37 grondilu m: say 2 <<**<< 1..20
09:37 camelia rakudo-moar 84b4c8: OUTPUT«2..20␤»
09:37 grondilu wat?
09:38 grondilu *
09:39 grondilu m: say join '', map { .log %% 2.log ?? '.' !! '!' }, 2 <<**<< [1..20];
09:39 camelia rakudo-moar 84b4c8: OUTPUT«....................␤»
09:40 grondilu anyway in local I get ..!.!!!.!!!!!!!.!!!!
09:46 aries_liuxueyang joined #perl6
09:48 maybekoo2 joined #perl6
10:01 pierre_ joined #perl6
10:12 pierre_ joined #perl6
10:20 grondilu m: my num64 $x = log(8); say $x %% log(2)
10:20 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
10:20 grondilu m: my num64 $x = log(8); say $x %% my num64 $ = log(2)
10:20 camelia rakudo-moar 84b4c8: OUTPUT«True␤»
10:20 * grondilu gives up
10:22 itaipu joined #perl6
10:30 perlawhirl joined #perl6
10:34 viki grondilu: True is the correct result. ln(8)/ln(2) is 3, so there's no remainder
10:39 viki I don't know how you get ..!.!!!.!!!!!!!.!!!! locally, considering all of those would be powers of 2 and ln(n)/ln(2) would be log₂(n), giving you the original power and no remainder. Are you sure you're escaping shell characters right, if you're running it in the shell?
10:40 viki m: say 2 <<**<< (1..20)
10:40 camelia rakudo-moar 84b4c8: OUTPUT«(2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576)␤»
10:41 aries_liuxueyang joined #perl6
10:41 pierre_ joined #perl6
10:44 moritz viki: well, ln is a floating point operation, with all the caveats attached
10:44 moritz m: say map { .log / 2.log }, 2 X** 1..20
10:44 camelia rakudo-moar 84b4c8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing comma after block argument to map␤at <tmp>:1␤------> 3say map { .log / 2.log }, 2 X** 1..207⏏5<EOL>␤»
10:45 moritz m: say map({ .log / 2.log }, 2 X** 1..20)
10:45 camelia rakudo-moar 84b4c8: OUTPUT«Cannot resolve caller map(Seq); none of these signatures match:␤    (&code, + is raw)␤  in block <unit> at <tmp> line 1␤␤»
10:45 * moritz too stupid today
10:45 moritz m: say map(*.log / 2.log, 2 X** 1..20)
10:45 camelia rakudo-moar 84b4c8: OUTPUT«Cannot resolve caller map(Seq); none of these signatures match:␤    (&code, + is raw)␤  in block <unit> at <tmp> line 1␤␤»
10:45 viki moritz: then log($n, $b) would be entirely broken. The caveats cancel out
10:46 moritz viki: having numerical errors != entirely broken
10:46 moritz m: say log(2**$_, 2) for 1..20
10:46 camelia rakudo-moar 84b4c8: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤»
10:46 moritz m: say log(2**$_) / log(2) for 1..20
10:46 camelia rakudo-moar 84b4c8: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤»
10:46 moritz m: say log(2**$_) / log(2) for 21..50
10:46 camelia rakudo-moar 84b4c8: OUTPUT«21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤31␤32␤33␤34␤35␤36␤37␤38␤39␤40␤41␤42␤43␤44␤45␤46␤47␤48␤49␤50␤»
10:48 moritz m: say log(2**$_) / log(2) for 51..80
10:48 camelia rakudo-moar 84b4c8: OUTPUT«51␤52␤53␤54␤55␤56␤57␤58␤59␤60␤61␤62␤63␤64␤65␤66␤67␤68␤69␤70␤71␤72␤73␤74␤75␤76␤77␤78␤79␤80␤»
10:48 moritz m: say log(2**$_) / log(2) for 100..119
10:48 camelia rakudo-moar 84b4c8: OUTPUT«100␤101␤102␤103␤104␤105␤106␤107␤108␤109␤110␤111␤112␤113␤114␤115␤116␤117␤118␤119␤»
10:49 viki m: say log(666**$_) / log(666) for 100..119
10:49 camelia rakudo-moar 84b4c8: OUTPUT«100␤101␤102␤103␤104␤105␤106␤107␤108␤109␤Inf␤Inf␤Inf␤Inf␤Inf␤Inf␤Inf␤Inf␤Inf␤Inf␤»
10:49 moritz m: say log(2**$_) / log(2) for 150, 200, 250, 300
10:49 camelia rakudo-moar 84b4c8: OUTPUT«150␤200␤250␤300␤»
10:49 moritz m: say log(2**$_) / log(2) == $_ for 150, 200, 250, 300
10:49 camelia rakudo-moar 84b4c8: OUTPUT«True␤True␤False␤True␤»
10:49 moritz hah
10:49 moritz stringification rounds off small errors
10:49 d^_^b joined #perl6
10:50 viki I see
10:50 viki m: say log(τ**$_) / log(τ) for 100..119
10:50 camelia rakudo-moar 84b4c8: OUTPUT«100␤101␤102␤103␤104␤105␤106␤107␤108␤109␤110␤111␤112␤113␤114␤115␤116␤117␤118␤119␤»
10:50 viki m: say log(τ**$_) / log(τ) == τ for 100..119
10:50 camelia rakudo-moar 84b4c8: OUTPUT«False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤»
10:50 viki m: say log(τ**$_) / log(τ) %% τ for 100..119
10:50 camelia rakudo-moar 84b4c8: OUTPUT«False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤»
10:50 * viki stands corrected
10:51 viki m: say (log(τ**$_) / log(τ)) %% τ for 100..119
10:51 camelia rakudo-moar 84b4c8: OUTPUT«False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤False␤»
10:51 bjz joined #perl6
10:52 viki m: say (log(τ**$_) / log(τ)).round(10) %% τ.round(10) for 100..119
10:52 camelia rakudo-moar 84b4c8: OUTPUT«True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤»
10:52 viki m: say (log(τ**$_) / log(τ)).round(1e10) %% τ.round(1e-10) for 100..119
10:52 camelia rakudo-moar 84b4c8: OUTPUT«True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤»
10:52 viki bah
10:52 * viki &
10:52 Actualeyes joined #perl6
10:57 pierre_ joined #perl6
11:10 grondilu the weirdest thing to me is that log(8) / log(2) %% 1 is true on my machine
11:11 grondilu and yet log(8) %% log(2) isn't
11:12 moritz does %% coerce its arguments?
11:13 moritz m: say &infix:<%%>.candidates
11:13 camelia rakudo-moar 84b4c8: OUTPUT«(sub infix:<%%> () { #`(Sub|53188128) ... } sub infix:<%%> ($) { #`(Sub|53188280) ... } sub infix:<%%> (\a, \b) { #`(Sub|53188432) ... })␤»
11:13 moritz m: say 1.001e0 %% 1
11:13 camelia rakudo-moar 84b4c8: OUTPUT«False␤»
11:17 * grondilu suspects nqp is to blame
11:18 pierre_ joined #perl6
11:19 grondilu m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(log(8)), nqp::unbox_n(log(2))))
11:19 camelia rakudo-moar 84b4c8: OUTPUT«0␤»
11:19 grondilu I get log(2) locally
11:19 grondilu m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(nqp::log(8)), nqp::unbox_n(nqp::log(2))))
11:19 camelia rakudo-moar 84b4c8: OUTPUT«===SORRY!===␤No registered operation handler for 'log'␤»
11:20 grondilu m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(nqp::log(8e0)), nqp::unbox_n(nqp::log(2e0))))
11:20 camelia rakudo-moar 84b4c8: OUTPUT«===SORRY!===␤No registered operation handler for 'log'␤»
11:20 grondilu m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(nqp::log_n(8)), nqp::unbox_n(nqp::log_n(2))))
11:20 camelia rakudo-moar 84b4c8: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
11:20 grondilu m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(nqp::log_n(8e0)), nqp::unbox_n(nqp::log_n(2e0))))
11:20 camelia rakudo-moar 84b4c8: OUTPUT«0␤»
11:20 grondilu hum
11:20 grondilu sorry that's ok
11:21 grondilu I still get log(2) locally
11:21 grondilu $ nqp --version
11:21 grondilu This is nqp version 2016.10-5-gb7335a9 built on MoarVM version 2016.10-15-g715e39a
11:22 grondilu is there a way to know which nqp version Perl 6 is using with "use nqp;"?
11:23 grondilu like nqp::version() or something?
11:24 timotimo well nqp::backendconfig()<version> is the moar version at least
11:24 grondilu m: use nqp; nqp::backendconfig()<version>
11:24 camelia rakudo-moar 84b4c8: ( no output )
11:24 grondilu m: use nqp; say nqp::backendconfig()<version>
11:24 camelia rakudo-moar 84b4c8: OUTPUT«2016.10-15-g715e39a␤»
11:24 timotimo but really, with "use nqp" you're not actually using nqp
11:24 timotimo like, you're not using the nqp compiler
11:25 timotimo you're just asking for nqp::foo ops from the perl6 compiler
11:25 tbrowder ref docs and modules: is this valid in p6: "use Foo 'bar'" where bar is a subroutine in module Foo?
11:25 grondilu yeah but I just want to check I'm using the same locally as in the bot here
11:25 grondilu turns out I do
11:25 timotimo then you'll want to know the moar version
11:25 tbrowder if so, how should it be exported?
11:25 timotimo tbrowder: needs to be '&bar' at the very least
11:26 tbrowder ok, didn't think of the sigil, thanks!
11:27 g4 joined #perl6
11:27 g4 joined #perl6
11:55 tbrowder timtimo: hm, i cannot find any way to do "use Foo <&bar>;". i can't see that it's possible: proof otherwise would be beneficial!
11:57 zakharyas joined #perl6
11:58 tbrowder and the reason it's not may be that a subroutine exported by default in a module is not actually used unless it is explicitly called in a using program--which is a 'good thing' IMHO.
12:00 timotimo it would be kind of weird if your program would use all the subs you're not calling for you after exporting
12:00 timotimo "hey, you forgot to use this rm-rf sub, i'll just invoke it for you real quick"
12:01 grondilu lol
12:09 tbrowder agreed, but i'm trying to look at the case of the module distributor: what is the best practice for a module with miscellaneous types of subroutines?  export all by default? or try to group them with tags?  tag each one individually? what if i export sub foo and the user wants his own sub foo, but he wants all the other subs in my module?
12:11 tbrowder or at least he wants to use a subset of all...
12:16 viki There's a ticket for use Foo <&bar>; IIRC that only works with require right now
12:18 tbrowder viki: ok, some progress!  do you know how &bar is exported in that ticket?
12:18 viki What do you mean "how"?
12:18 viki It's not implemented yet.
12:18 viki And proposed syntax is exactly that; you give it a list of symbols to export
12:19 viki And IIRC ATM that'd clash with EXPORT sub args
12:20 tbrowder well, inside the module itself. is it "sub bar()  is export {" or "sub bar() is export(:sometag) {" or ???
12:20 viki tbrowder: the whole idea is for the user of the module to control what's imported into their namespace.
12:21 viki Right now that's controlled by the module's author and they're free to crap into user's namespace as they wish, which isn't great.
12:22 viki tbrowder: and I guess all symbols marked OK for export can be asked by user individually
12:22 viki tbrowder: there's something in the speculation about it. And I'm sure the ticket references that portion
12:23 tbrowder ok, so that has been the concern i've tried to express, and I'll add that to the docs. got a ticket number?
12:23 viki nope
12:24 bjz joined #perl6
12:24 tbrowder "asked" by user meaning "called" by user?
12:24 viki I'd think the mechanism can be implemented by module author right now. Just take symbols via EXPORT and return a Map with them
12:25 viki tbrowder: asked by use Foo <&bar>;
12:26 viki tbrowder: basically the way Perl 5 does it.
12:27 tbrowder hm, i can't see that's currently (as least as described in the docs) any different than marking each sub with "export...", but i'll try to test it.
12:27 tbrowder thanks
12:29 viki tbrowder: marking each sub with export would import it on module's use
12:29 Khisanth joined #perl6
12:29 pierre_ joined #perl6
12:30 viki tbrowder: and you end up with problems like this: http://fpaste.scsys.co.uk/537887
12:31 rurban joined #perl6
12:31 viki tbrowder: I did not ask for `say` to be imported. And sure someone might not do this for `say` but it's easy to accidentally mess up some rare built in no one heard of, but your code actually uses.
12:32 viki And now you have a bug in your code and you don't know why. And it's hard to track it down to one of the dozen of used modules that modified a core built in you were using
12:33 tbrowder well i'm glad the problem is recognized, i have been nervous about use of export in my ecosystem modules.  what do you recommend for current practice, something like "export(:ALL)" so at least the user has to knowingly import all?
12:34 dalek doc: 5b70244 | (Francis Grizzly Smit)++ | doc/Type/Str.pod6:
12:34 dalek doc: fixed sprintf doc missing $a in order of arguments example
12:34 dalek doc: review: https://github.com/perl6/doc/commit/5b70244ff8
12:34 viki m: SLICE_HUH 42, [], %, %
12:34 camelia rakudo-moar 84b4c8: OUTPUT«(signal SEGV)»
12:35 dalek doc: 763aa8b | (Francis Grizzly Smit)++ | doc/Type/Str.pod6:
12:35 dalek doc: fixed sprintf doc missing $a in order of arguments example
12:35 dalek doc: review: https://github.com/perl6/doc/commit/763aa8b39b
12:35 viki tbrowder: to me that looks like asking the user to do extra typing to get the same behaviour as without it
12:35 viki Don't think I have any recommendations :)
12:36 tbrowder okay, thanks, hope a smart person or persons fix this soonish!
12:37 tbrowder but i could tag EVERY sub with a unique tag to force the user to use them explicitly...
12:39 tbrowder what would you as a user of my module think? i think i could even tag them with the subroutine name itself!
12:40 viki Depends on the module. And as I've said, you can implement the use Foo <&bar &ber>; with EXPORT sub: https://github.com/zoffixznet/perl6-SPEC-Func/blob/master/lib/SPEC/Func.pm6#L7-L12
12:40 viki well that module almost does it; it doesn't require the &: https://github.com/zoffixznet/perl6-SPEC-Func#synopsis
12:41 viki My pet peeve in Perl 5 land is module that provide a single function but require you to explicitly import it.... That's where "best practice" trumps common sense.
12:41 * viki &
12:42 tbrowder but as i read the docs "*@wanted" is the same as marking a sub "export(:wanted)"
12:42 tbrowder i agree with the single-sub complaint...
12:45 tbrowder ok, in current rakudo land: i distriube a module where each of 1..N subs is marked "is export(:s1)",..."is export(:sN)"
12:46 harrison_ joined #perl6
12:46 perlpilot What I want to know is how to explicitly *not* export something that may conflict locally.
12:48 tbrowder well, that would be cool, but it seems that's not possible at the moment. maybe you could make that comment on the ticket i found RT #127305
12:48 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127305
12:54 gfldex lizmat: i wrote you a blogpost so you don't have to go and hunt down something unrelated for the next weekly :-> https://gfldex.wordpress.com/2016/10/25/you-have-to-take-what-you-an-get/
12:55 lizmat an get ?
12:55 lizmat :)
12:55 gfldex i didn't proveread that part it seams :)
12:55 lizmat nice blog :-)
12:55 lizmat keep them coming  :-)
13:00 TheovdH joined #perl6
13:01 lizmat gfldex: re caching "subset C where $ //= ::('M::C');"
13:02 lizmat isn't a bare sigil in that context a state var, so "subset C where $ = ::('M::C')" is maybe enough ?
13:04 gfldex lizmat: i believe so but it's hard to test. Also, I like //= better because it clearly shows my intend. Code golfs are neat, not necessary. :)
13:05 lizmat okidoki
13:09 tbrowder timotimo:, viki: and perlpilot: i added a comment to that ticket 127305, please critique it when you get a chance
13:10 cdg joined #perl6
13:10 cdg joined #perl6
13:10 lizmat tbrowder: if you want to refer to a discussion, you can refer to it in a URL
13:11 perlpilot tbrowder: you said what I meant better than I did :)
13:12 lizmat tbrowder: you mean: https://irclog.perlgeek.de/perl6/2016-10-25#i_13461499 ?
13:12 TheovdH Hi, is there a way to get consecutive members (i.e. named and unnamed subpatterns) from a Match object? Or do I need to create an explicit action for each rule if I want such a  list?
13:12 lizmat if the match object is in $/, you can use $0, $1  and $<named>   or is that not what you mean?
13:13 perlpilot TheovdH: if you put them in (), then it's just $/[0], $/[1], $/[2], etc.
13:13 lizmat $/[0,1,2]   # as a slice
13:13 lizmat $/<foo bar baz>   # named captures as a slice
13:14 jnthn m: say ('bcd' ~~ /(.)$<x>=.(.)/).caps
13:14 camelia rakudo-moar 364e67: OUTPUT«(0 => 「b」 x => 「c」 1 => 「d」)␤»
13:14 bjz_ joined #perl6
13:14 perlpilot jnthn++
13:15 tbrowder lizmat: thanks, i'll add that
13:16 lizmat tbrowder: you know how to create such a link ?
13:16 tbrowder um, no...
13:17 tbrowder but i think i can look at the logs and figure it out
13:20 viki tbrowder: the time stamps in the logs are the links to those lines
13:21 moritz TheovdH: .caps might be what you want
13:22 moritz TheovdH: and .chunks if you want non-captured text too
13:24 TheovdH limat: perlpilot: moritz: Thanks.  I need to experiment some more to access elements deeper in the Match object.
13:25 moritz TheovdH: if you try to go more than a few levels deep, it might be easier to use action methods that reduce it to a more managable data structure
13:27 pierre_ joined #perl6
13:35 pmurias joined #perl6
13:35 dalek doc: 9eaf716 | coke++ | xt/aspell.t:
13:35 dalek doc: add notes on how to make tests pass
13:35 dalek doc: review: https://github.com/perl6/doc/commit/9eaf716e9c
13:38 aborazmeh joined #perl6
13:38 aborazmeh joined #perl6
13:46 khw joined #perl6
13:47 TheovdH lizmat: moritz: What's wrong with something like $/<path><in><parse><tree>[3] ?
13:48 lizmat nothing
13:48 lizmat conceptually  :-)
13:48 moritz TheovdH: coupling
13:48 * DrForr waves at TheovdH .
13:48 lizmat moritz: elaborate ?
13:49 moritz lizmat: I like to structure my code to be structured in weakly coupled units, where unit A doesn't need to know about the inner workings of unit B
13:49 arnsholt If you ever want to change the grammar, it'll suck
13:50 lizmat ah, ok, yes, agree
13:50 arnsholt Since you'll have to change all over the code, rather than localized
13:50 moritz lizmat: but if the parser for a table needs to know how each cell type is parsed internally, they are tightly coupled, changes become a PITA
13:51 moritz shoving a well-defined data structure into $/.ast aka $/.made is a very natural mini-API that prevents such tight coupling
13:54 TheovdH moritz: building such an API still requires me to write an action that processes the members consecutively, which is the essence of my  problem.
13:55 TheovdH moritz: I am aware that I am struggling with Perl6 more than with the concept of parsing.
13:55 colomon joined #perl6
13:55 grondilu joined #perl6
13:56 arnsholt TheovdH: Wait, you want to extract a list of *unrelated* captures?
13:58 moritz TheovdH: you don't need actions for all named regexes, fwiw
13:59 TheovdH arnsholt: consecutive. the members of rule in their original order.
13:59 arnsholt Sure, but not related by anything other than being siblings in the parse tree
14:00 TheovdH arnsholt: correct.
14:00 arnsholt That seems like a smell to me. Why do you need to do it that way?
14:00 jnthn TheovdH: Do you have a small example of the rule?
14:01 jnthn If it's something like [<foo> | <bar> | <baz>]* then you may find it neater to factor it as a protoregex
14:01 TheovdH jnthn: silly example:   token chars() { <char> $<xyzzy>=':' <char> <char> $<xozzy>='!' }
14:02 jnthn Did you mean for xozzy to be xyzzy (e.g. they're overlapping in name)?
14:02 arnsholt If you need to sequence side-effects, that's a pretty clear case for action methods for the subrules invoked
14:03 TheovdH jnthn: no
14:03 jnthn OK, just checking
14:04 jnthn But I don't see why $/.caps in the action method won't give you what's needed
14:04 TheovdH This is probably just my deplorable grasp of Perl 6, but how would I just join the members?
14:04 Upasaka joined #perl6
14:04 jnthn What, you just want the whole string that this rule matched?
14:04 moritz that's ~$/
14:04 DrForr D*mn, if I weren't in a meeting I'd be able to make some suggestions...
14:05 arnsholt But *why*? What is it that makes it important to process siblings in order of mention in the rule?
14:07 TheovdH jnthn: Aaah. I think you are right.
14:07 skids joined #perl6
14:08 dmaestro joined #perl6
14:09 TheovdH jnthn: moritz: Yes. It was my struggle with Perl6 operators.
14:09 tbrowder lizmat and viki: thanks, i see the link in the logs
14:11 TheovdH ansholt: I am working on systematic conversion of some input. By default everything is maintained in order.
14:14 dmaestro Is there another channel for rakudo-specific user experience questions, or is this the right place?
14:14 lizmat dmaestro: this is the right place
14:15 dmaestro Thank!
14:16 dmaestro I tried to upgrade to the latest rakudo star on my MacBook, and the downloadable .dmg is for Mac OS X 10.12 - any chance of providing an El Capitan build (10.11), since Sierra is pretty new and I may not upgrade real soon.
14:17 dmaestro Here's what I get:
14:17 dmaestro its-MacBook-Pro-DLS:~ douglasschrag$ perl6 -v dyld: lazy symbol binding failed: Symbol not found: _clock_gettime   Referenced from: /Applications/Rakudo/lib/libmoar.dylib (which was built for Mac OS X 10.12)   Expected in: /usr/lib/libSystem.B.dylib  dyld: Symbol not found: _clock_gettime   Referenced from: /Applications/Rakudo/lib/libmoar.dylib (which was built for Mac OS X 10.12)   Expected in: /usr/lib/libSystem.B.dylib  Trace/BPT
14:17 viki stmuk_: ping ^
14:17 tbrowder 6 ref  RT #127305: the IRC thread-start link was added to the ticket
14:17 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127305
14:22 pierre_ joined #perl6
14:28 viki dmaestro: stmuk_ is the Rakudo Star release manager, maybe when they're around they can help out.
14:28 dmaestro Thanks, I'll keep looking.
14:30 dalek doc: 8970224 | (Tom Browder)++ | doc/Language/modules.pod6:
14:30 dalek doc: add some more info on module import vs. export
14:30 dalek doc: review: https://github.com/perl6/doc/commit/8970224819
14:36 rindolf joined #perl6
14:37 snowman_ joined #perl6
14:38 CIAvash joined #perl6
15:04 Ulti dmaestro: Sierra isn't much of a change FYI, if you update XCode to the latest version under 10.11 you are in for a world of hurt if you dont also upgrade to 10.12
15:04 Ulti dmaestro: in fact you have that error
15:05 Ulti I couldnt even build Rakudo on 10.11 with the latest XCode because of that linking error
15:05 Ulti I gave up fixing it because there are so many other reported issues
15:07 geekosaur you can download the xcode 7 clt from developer.apple.com downloads area and reinstall them over the xcode 8 tools
15:07 geekosaur that's the official workaround until xcode 8.1 ships
15:14 Ulti lame
15:14 * skids wonders how apple devs pronounce "clt" :-)
15:14 Ulti but yeah I have had nothing go wrong just moving to Sierra, I haven't even rebuilt my homebrew stuff
15:20 dalek doc: 2d88020 | (Tom Browder)++ | doc/Language/modules.pod6:
15:20 dalek doc: correct errors after trying actual code
15:20 dalek doc:
15:20 dalek doc: Seems as if module import/export is very flexible, but a little tedious on the export side (which can be easily automated) by the user until rakudo does it for you).
15:20 dalek doc: review: https://github.com/perl6/doc/commit/2d88020a15
15:21 FROGGS[mobile] joined #perl6
15:21 viki skids: "silt" :)
15:28 rudolfochrist joined #perl6
15:32 dmaestro Ulti: Thanks for the info. It's just really disruptive to _require_ a MacOS X upgrade to install Rakudo Star. It's not that hard for me, but I do need to schedule IT assistance on my work MacBook; and I've used XCode and could do what's needed, but I can't see the worth - how many other users might be turned off by that? The best alternative for most users of El Capitan would be just to stick with *2016.07
15:33 dmaestro But I _want_ the concurrency fixes Jonathon worked so hard on :-)
15:34 viki .oO( there's always sauce... )
15:34 viki As in monthly compiler releases: http://rakudo.org/downloads/rakudo/
15:34 bsk_ joined #perl6
15:34 mst dmaestro: we don't require an OS X upgrade
15:35 mst dmaestro: however, you have upgraded to a version of XCode that will not work without an OS X upgrade
15:35 mst dmaestro: if you downgrade XCode to a working version I'd expect it to build fine
15:35 bsk_ left #perl6
15:36 dmaestro Well, only to install from the Rakudo* .dmg !! No, I'm not using XCode to install. Anyway, if I have to work at the build level, I'll be doing it on Linux.
15:36 mst hm?
15:36 mst oh, sorry, hmmm
15:36 mst it may be possible to re-rev the dmg with an older version of XCode or whatever
15:36 mst but we're now into "too much mac specific stuff" for me to have a good opinion
15:37 mst so my apologies for the noise
15:37 dmaestro I want it on my work laptop only to facilitate learning, not really a need.
15:37 dmaestro mst: no problem :-)
15:37 dalek doc: 7eef1f4 | (Tom Browder)++ | doc/Language/modules.pod6:
15:37 dalek doc: clarify tag separator comments in the example
15:37 dalek doc: review: https://github.com/perl6/doc/commit/7eef1f453e
15:59 cognominal joined #perl6
16:15 wamba joined #perl6
16:16 rurban joined #perl6
16:29 nicq20 joined #perl6
16:29 nicq20 Hello! o/
16:30 viki \o
16:34 [Coke] dmaestro: if you're willing to install xcode, we can step you through a build from source, which doesn't solve the original problem, but would get you something to play with; also, if you have docker installed, you can run perl6-in-docker.
16:35 canopus joined #perl6
16:49 cdg joined #perl6
16:56 dmaestro Coke: Thanks for the offer, I'm interested in trying since I do have XCode installed already.
16:58 dmaestro That's if v7.3.1 isn't too out-of-date.
17:00 Actualeyes joined #perl6
17:15 rurban joined #perl6
17:19 [Coke] I'm on 8.0 on 10.11.6
17:43 rurban joined #perl6
17:43 domidumont joined #perl6
18:01 dalek doc: 0ce48fe | (Tom Browder)++ | doc/Language/modules.pod6:
18:01 dalek doc: capitalize first word in a sentence
18:01 dalek doc: review: https://github.com/perl6/doc/commit/0ce48febfb
18:12 dmaestro Coke: Looks like I need to update to get a better 'tar' - so I'll go with 8.0
18:17 lostinfog joined #perl6
18:21 dmaestro joined #perl6
18:22 RabidGravy joined #perl6
18:23 cibs joined #perl6
18:27 FROGGS joined #perl6
18:33 andrzejku joined #perl6
18:39 wamba joined #perl6
18:41 viki mst: what's considered a distro for PSIXDISTS? ( re https://github.com/perl6/ecosystem/issues/255 )
18:42 viki mst: like, what's blowing up? Is it making automatic releases from each git repo commit or what?
18:43 viki DrForr!
18:43 mst viki: you'd want to ask ranguard about that, I just got involved because he was about to stop trying after your original responses suggested nobody cared :P
18:44 viki :(
18:45 mst I think he may be on holiday at the moment though, so what I'd suggest is that you ask questions on the ticket
18:45 mst and then I'll kick him to have a look when he's got sufficient internet
18:46 labster joined #perl6
18:46 viki mst: but what's amusing is he proved my point. Here he's added the "mandatory" meta test but never actually ran it so the repo still contains a META error: https://github.com/drforr/perl6-Perl6-Parser/pull/1
18:46 setty1 joined #perl6
18:49 mst viki: well, yes, but that point was nothing to do with what we were actually discussing
18:51 viki Considering the ticket is titled "Module list should check modules META.info is correct" I thought it did.
18:52 viki Or rather, considering the poposition was to make it a requirement that a module that's added to ecosystem has Test::META as prepres, I thought it id.
18:52 viki DrForr's module has Test::META as prereq, yet has broken META, ergo making Test::META a mandatory requirement for ecosystem membership doesn't solve any problems.
18:52 viki </grumpy>
18:52 [Coke] I love the word "poposition", and we have to make that mean something
18:54 mst viki: no, the Test::Meta-as-requirement was nothing to do with ranguard or I
18:54 mst viki: it was when you started going on about that as if ranguard had proposed it that he noped out
18:54 gfldex [Coke]: see http://dict.leo.org/ende/index_de.html#/search=popo&amp;searchLoc=0&amp;resultOrder=basic&amp;multiwordShowSingle=on&amp;pos=0
18:55 girafe joined #perl6
18:55 gfldex so it's basically where you bum is
18:55 mst viki: you inventned a 'proposition to make Test::META a requirement' - that was the problem. nobody ever wanted that, it made no sense, and then you shouted at other people for it making no sense :P
18:55 mst viki: meanwhile, what we *actually* want is a modulelist that is *probably* uploadable
18:56 TheovdH arnsholt: as a first exercise I created a routine that takes a Match object and writes a parse tree. Example of a projection where order is relevant.
18:56 viki mst: well, that's what I see from this. RabidGravy said there's Test::META and ranguard says can ecosystem-team make it a requirement to META.list: http://i.imgur.com/3QcjvPD.png
18:57 nicq20 joined #perl6
18:57 nicq20 Hello o/
18:57 viki \o
18:57 mst viki: oh, yes, sorry, RabidGravy suggested it
18:58 mst viki: I'm sorry that the ecosystem team proposed a solutioln the ecosystem team didn't like, but that still isn't ranguard's fault
18:58 viki I'll wait for ranguard to comment on the ticket. I suspect modules.perl6.org dist builder can generate a list of modules that "probably upload"
18:59 viki It already has a JSON validator. Needs a checker that source URL actually has source... not sure what else.
18:59 mst viki: point, basically, is that for us it was us: "here's a problem" you: "ok, here's the solution" us: "ok, could you require the solution then" you: "THAT ISN'T A SOLUTION" us: "wtf?"
18:59 viki :}
18:59 mst can you see how it reads like that from outside?
18:59 viki Yes.
19:00 mst anyway, now we've established that we're all idiots, hopefully we can get somewhere :)
19:02 toolforger1 joined #perl6
19:02 * El_Che in his best Dr Phil's voice: so, mst, when did you discovered you were an idiot? Did it hurt?
19:07 mst I find it's the sort of thing one doesn't so much discover as remember, repeatedly
19:07 [Coke] OW! (oh, right)
19:08 breinbaas (IQ is an imaginary number)
19:08 RabidGravy so what data is it the PSIXDIST is trying to consume?
19:09 toolforger1 \o/
19:10 toolforger1 Anybody got an idea how to best wrap one's mind around the rakudo-for-jvm buildchain?
19:10 psch toolforger1: what do you mean?  the chain is quite a bit shorter than the one for rakudo-moar :)
19:11 toolforger1 Well, I am having trouble understanding the makefile
19:12 dalek modules.perl6.org: 64878f9 | (Zoffix Znet)++ | lib/ModulesPerl6/DbBuilder/Dist/Source/GitLab.pm:
19:12 dalek modules.perl6.org: Mark GitLab dists as always fresh
19:12 dalek modules.perl6.org:
19:12 dalek modules.perl6.org: We need a proper check for when new commits arrive, but for now,
19:12 dalek modules.perl6.org: mark each dist fetch as fresh so postprocessor run properly.
19:12 dalek modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/64878f9f45
19:12 toolforger1 I find it difficult to combine the information from Configure.pl, makefile.in, and the various scripts that Configure calls
19:12 viki toolforger1: what are you trying to accomplish?
19:13 toolforger1 Oh... wait... I'm wrangling NQP, not Rakudo
19:13 toolforger1 I want to extract the regex part of NQP so it becomes useful to Java guys
19:14 viki ooooooh
19:14 psch toolforger1: oh, that was on the ml recently i think?
19:14 toolforger1 (maybe that's foolish)
19:14 toolforger1 :-)
19:14 toolforger1 Yeah, I talked about it there
19:14 toolforger1 Patrick was helpful but obviously code is better than words :-)
19:15 psch toolforger1: i'd start from the other end.  as in, try to load a CompUnit containing only QRegex from Java
19:15 psch toolforger1: the EvalServer should give at least a rudimentary how to load CompUnits, although i suspect that QRegex doesn't have an entryQbid
19:15 toolforger1 Issue is that the Java class name is some hex thing - looks like an SHA hash or something
19:15 toolforger1 so the interface is going to be 100% unstable
19:16 psch $ find . -iname 'QRegex*jar'
19:16 psch ./install/share/nqp/lib/QRegex.jar
19:16 toolforger1 Oh, it's in a jar already?
19:16 psch yeah
19:16 psch might still be you have that same problem you mentioned when loading it though :)
19:17 toolforger1 How does the NQP runtime find the right class name?
19:17 psch i think that's bootclassloader shenanigans..?
19:18 toolforger1 Being a Java guy myself, I can answer that with a solid "no"
19:19 toolforger1 Class loaders are just another namespace hierarchy, essentially
19:19 psch well, QRegex.jar is a basically a compilation unit for nqp
19:20 toolforger1 plus the ability to load stuff from whatever bytestream source you want, be it files, URLs, or zip file elements
19:20 psch so it's, in a way, nqp bytecode wrapped in java bytecode
19:20 toolforger1 so I'd need the bytecode interpreter as well, but that's easy to find out
19:21 psch yeah, that's how i hacked together a half-backed attempt for perl6-in-a-jar
19:21 toolforger1 These jars consist of a class plus something serialized, NQP bytecode I've been assuming
19:21 psch as in, wrap the whole rakudo interpreter into a single jar, make that interpret the precompiled .class that was output by rakudo before...
19:22 Ulti dmaestro: well I always just use rakudobrew personally.. building Rakudo doesnt take very long and that way you can play with the latest perf improvements everyone here delivers weekly
19:23 toolforger1 I wanted to try and cut down; a full Perl6 interpreter in a .jar just to get new-style regexes seemed a bit over the top
19:23 acrussell joined #perl6
19:23 psch yeah, i'd agree with that
19:23 psch i'm not sure how much you can get around the concept itself though, considering lots of the regex engine is written in nqp
19:24 psch as in, you might have to at least ship a (potentially stripped) nqp runtime
19:24 toolforger1 Yeah, you'd need as much of the NQP runtime as necessary to run regex
19:25 toolforger1 Looking at the NQP docs, there's quite a lot of bytescodes that are definitely unnecessary. I don't know how easy it would be to strip the unneded bytecodes out though
19:25 toolforger1 btw I am seeing a whole slew of QRegex jars
19:25 DrForr viki: I'm working on some talk proposals, but /msg me what's going wrong and I'll fix it tomorrow.
19:26 viki DrForr: just a trailing comma that isn't valid JSON. I sent a PR
19:26 psch from the rakudo build dir i have 6, 4 of which are build artifacts
19:26 psch or, well, bootstrap
19:26 DrForr Thanks, which module?
19:26 viki DrForr: https://github.com/drforr/perl6-Perl6-Parser/pull/2
19:27 DrForr Ah. Glad to know people are actually looking at that :)
19:27 viki FWIW, I found it by looking at http://modules.perl6.org/update.log :}
19:27 toolforger1 four in gen/jvm/stage[12], two in src/vm/jvm/stage0, and (NQPP[56])?QRegex.jar in the nqp directory itself
19:27 DrForr Done.
19:28 viki \o/
19:28 psch toolforger1: well, QRegex is the base regex language, the prefix should be self-explanatory
19:28 DrForr I'll keep that in mind, but gotta get these proposals out the door.
19:28 psch toolforger1: so you'd need QRegex and NQPP6Regex i think
19:29 toolforger1 Yeah - P5 regexes are already covered via PCRE, it's the P6 ones that I find awesome
19:29 viki :D
19:30 toolforger1 Ah... the ones in stage2 are identical to the ones in gen/jvm/stage2
19:30 psch stage0 and stage1 are bootstrap steps
19:31 psch well, i suppose technically stage2 is too :)
19:32 toolforger1 hehe
19:33 toolforger1 Eek. Main class is in default package.
19:34 toolforger1 Best practice is to put it in a package that you own the domain name for, so this should go to org.perl, or org.rakudo, or org.perl6
19:35 toolforger1 Fortunately there are tools that can take a class file and its dependencies, and move everything to a different package
19:35 psch org.perl6.nqp
19:36 psch is where everything else should sit
19:36 toolforger1 Changing the package name would probably be easier :-)
19:36 psch well, minus org.objectweb.asm
19:36 psch and other deps too of course vOv
19:36 toolforger1 Yeah, the pulled-in libraries should stay where they are
19:36 psch i think this is the appropriate moment for "patches welcome", isn't it? :)
19:37 toolforger1 Well, I'd need to know where the code is that writes these classes :-)
19:37 psch grepping for ClassWriter instances should narrow it down significantly
19:38 psch it's probably not org.perl6.nqp.sixmodel.P6Opaque though :)
19:38 [Coke] I would recommend rakudo.org if we have to pick one.
19:40 toolforger1 perl6.org or rakudo.org is essentially a question of who's responsible for managing the namespace
19:40 psch [Coke]: well, the rakudo-jvm specific java files for the perl6 binary sit in org.perl6.rakudo
19:40 psch namespace that is
19:40 [Coke] ok.
19:40 psch s/binary/runtime/
19:41 * [Coke] dusts off his java for work.
19:41 toolforger1 If NQP's usefulness is restricted to Rakudo, then it should be org.perl6.rakudo.nqp
19:41 psch it's not
19:42 psch there's a somewhat working python implementation on nqp
19:42 El_Che the parrot dream is alive, it seems
19:42 FROGGS *g*
19:43 samcv has anybody had issues with vim's perl6 syntax highlighting? i notice it being pretty slow, so for larger files i'm using the 'perl' syntax highlighting instead
19:43 dalek ecosystem: c98e552 | RabidGravy++ | META.list:
19:43 dalek ecosystem: Add Monitor::Monit
19:43 dalek ecosystem:
19:43 dalek ecosystem: See https://github.com/jonathanstowe/Monitor-Monit
19:43 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/c98e552fcd
19:43 toolforger1 Is there a chance of any other perl6 subproject to be named NQP?
19:43 samcv there may be nothing i can do about this, but was wonering your experiences
19:43 toolforger1 If no, org.perl6.nqp would be fine
19:43 FROGGS org.perl6.nqp is correct, aye
19:44 toolforger1 Okay, that goes into the patch
19:44 toolforger1 (assuming I manage to write one)
19:44 FROGGS toolforger1++
19:44 viki samcv: BTW, you gave me an email address to add to book mailing list... I'm no longer writing one. Contact moritz isntead.
19:44 samcv ok thanks for letting me know
19:45 dalek modules.perl6.org: 960c08c | (Zoffix Znet)++ | lib/ModulesPerl6/DbBuilder/Dist/PostProcessor/METAChecker.pm:
19:45 dalek modules.perl6.org: Add METAChecker postprocessor
19:45 dalek modules.perl6.org:
19:45 dalek modules.perl6.org: Add extra checks to validate distributions in the Ecosystem.
19:45 dalek modules.perl6.org:
19:45 dalek modules.perl6.org: Part of the PSIXDISTS indexing issue
19:45 dalek modules.perl6.org: https://github.com/perl6/ecosystem/issues/255
19:45 dalek modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/960c08c928
19:45 toolforger1 I am seeing ClassWriter references in nqp/runtime, nqp/sixmodel, and nqp/jav2bc - where should I look first?
19:46 psch sixmodel is the object model, so that writes nqp and rakudo level classes
19:47 psch jast2bc is the compilation step after we turn a QAST into a JAST
19:48 psch well, runtime is only interop, to C and Java respectively
19:48 psch so, probably jast2bc i think? :)
19:48 toolforger1 looking...
19:49 toolforger1 "public static JavaClass buildClass()" seems pretty spot on
19:50 toolforger1 goes down to JastCompiler.compileJast
19:51 arnsholt Yeah, jast2bc is what you want
19:52 arnsholt sixmodel is to generate Java classes backing 6model classes at compile-time
19:52 arnsholt Not sure what's in runtime off-hand
19:52 psch NativeCallOps and BootJavaInterop
19:53 arnsholt Right, so some bits of NativeCall and JVM interop in there too
19:53 toolforger1 I hope that these aren't necessary for Regex :-)
19:53 arnsholt Ah, right. The NativeCall bits are for callbacks
19:53 dmaestro Ulti: Thanks, I took the opportunity to try out the basic toolchain and (with [Coke]'s help) was able to build rakudo.
19:53 toolforger1 the NativeCall stuff I mean
19:53 arnsholt Nope =)
19:54 toolforger1 Yeah, I'd leave out callbacks initially; maybe add callbacks into Java later
19:54 dmaestro I learned that upgrading XCode does not automatically install the command-line tools ;-)
19:54 toolforger1 JVMInterop is probably for converting between Perl and  Java strings
19:55 arnsholt Not quite. It's for calling Java code from Perl 6 code
19:55 cdg joined #perl6
19:55 arnsholt Like NativeCall is for C
19:56 psch j: use java::lang::System:from<JavaRuntime>; System.get_out.println("hi")
19:56 camelia rakudo-jvm 8d357a: OUTPUT«hi␤»
19:56 toolforger1 Hmm... seems like it is useful for callbacks
19:56 girafe joined #perl6
19:56 psch ^^^ that's a lot BootJavaInterop and some RakudoJavaInterop
19:57 toolforger1 Most of the work is probably packaging everything so it interoperated with the Java ecosystem
19:57 toolforger1 I.e. upload to Maven Central, use dependencies instead of the 3rdparty directory
19:57 psch RakudoJavaInterop mostly matters to not have to write "method/println/(Ljava/lang/String;)V"
19:57 psch oh, and probably some marshalling from rakudo Str to java.lang.String
19:58 toolforger1 Yeah, this needs to be somewhere, maybe in a common subpackage
19:58 canopus joined #perl6
19:58 toolforger1 That's easy to figure out
19:58 toolforger1 It's the entry points that are hard to find
19:59 toolforger1 The call graph inside Java is easy with the right Eclipse tooling
19:59 itaipu joined #perl6
19:59 toolforger1 finding the dependencies from NQP bytecode would be hard again
20:00 toolforger1 Heh. I most definitely want a Maven or Gradle build instead of the 3rdparty stuff. Eclipse will then automagically retrieve the sources from Maven Central with the right tooling.
20:01 toolforger1 (not just Eclipse, every Java-capable IDE can do this)
20:01 arnsholt Yeah, making the JVM build use more Java standard tools is on my list of things I'd like to do
20:02 psch that would be nice
20:02 toolforger1 I can definitely lend a hand with this
20:02 psch although i'm pretty used to doing it the way i've been doing it... :)
20:02 arnsholt But just integrating stuff into the extant Makefile was *so* much easier when the JVM backend landed =)
20:02 toolforger1 ;-P
20:02 toolforger1 You know how programmers acquire bad karma :-P
20:02 DrForr Proposal 1 for OSCON Austin going out...
20:03 toolforger1 (not that I'd have done it very differently if I weren't intimately familiar with the toolchains in question)
20:03 arnsholt Yeah, none of us are
20:03 arnsholt Thus the Makefile =)
20:04 arnsholt And it's complicated by the fact that only *part* of the build is in Java-land
20:04 toolforger1 I can contribute that knowledge
20:04 arnsholt Excellent!
20:04 arnsholt This is how open source progresses =)
20:04 toolforger1 :-)
20:04 toolforger1 You add a dependence on the build tool
20:05 toolforger1 There are two that I am familiar with, Maven and Gradle
20:05 arnsholt Anyways, I suspect what we'll want is an incantation that builds the Java bits, and then that invocation can be called from the Makefile to build that part of the project
20:05 toolforger1 Maven is probably unsuitable, it is extremely strict in how to set up the build, and essentially requires you set up your own Maven repository on a well-known server
20:06 arnsholt Yeah, that might be a bit of an obstacle
20:06 arnsholt The strictness can probably be dealt with though, since we mostly only care about the output JARs
20:06 toolforger1 Gradle, you can package a stub that will automatically download the Gradle tool, all declared dependencies, put them into a local cache so they won't get downloaded again (cache is SHA1-secured), and runs the buildscript
20:07 toolforger1 Maven's main strictness is that you have a lifecycle with a fixes set of steps
20:07 DrForr From gradle to crave?
20:07 toolforger1 *fixed
20:07 arnsholt (Another thing I've been wanting to look into is making the compiler JARs fat JARs, so that they can be invoked as just "java -jar nqp.jar @args" rather than the classpath hackery we have today)
20:07 toolforger1 so if you want to insert an extra step, you need to contort everything with Maven
20:07 psch arnsholt: fwiw, i've ripped bootclasspath out of rakudo
20:07 toolforger1 Fatjars are easy with both Gradle and Maven
20:08 psch arnsholt: not sure how that'd go with nqp though
20:08 toolforger1 well, sort of - fatjars offer unique challenges
20:08 ufobat joined #perl6
20:09 toolforger1 i.e. you need a good fatjar tool, then you invoke it fr
20:09 toolforger1 the application integrator simply invokes that tool as a plugin
20:09 toolforger1 If you upload the jars to Maven Central, then both Maven and Gradle can download and use the thing
20:10 arnsholt Yeah, that's the bits I haven't figured out =)
20:10 toolforger1 so you can leave it to the application integrator whether they want a fatjar, a bunch of class files, a bunch of jars, jars-packages-into-war, or whatever packaging option there is
20:10 arnsholt I just know that the current state of affairs annoys me =)
20:11 toolforger1 I.e. the good news is that you do not need to worry about fatjars in Java land, you just need to upload to Maven Central
20:11 toolforger1 Maven Central will archive all old versions that are not marked as SNAPSHOT, so callers can use whatever old version they need for build stability
20:12 arnsholt toolforger1: Oh, if you want to look at the build process without actually building all of the things, make -n does a dry run
20:12 toolforger1 or if they hunt a bug, they can always reproduce an old build, without having to archive the old jars themselves
20:12 arnsholt That should give you an idea of what goes on
20:12 toolforger1 Been there, done that, went into MEGO mode :-D
20:12 arnsholt Good, good
20:12 arnsholt Anyways, bedtime here for me
20:13 toolforger1 I think the best approach would be to use a "gradle build" call inside the makefile
20:13 arnsholt If you prod me during business-ish hours CET tomorrow I'll probably respond without too much delay
20:13 arnsholt In case of more questions
20:13 toolforger1 CET time here myself
20:14 arnsholt (But psch has more up-to-date info than me. It's been a while since I worked on the JVM code)
20:14 toolforger1 1:30 commute time, so I tend to be on late-ish and not too quick doing stuff (unfortunately)
20:14 toolforger1 will be back tomorrow - g'night arnsholt
20:14 arnsholt No rush, this is open source after all
20:14 psch ehh, my brain's learning objective c currently
20:15 arnsholt Just so that you know when you have the best probability of catching me =)
20:15 psch so i'd have to look for most in-depth things
20:15 toolforger1 @arnsholt ok, that's what I meant to communicate, too :-)
20:15 toolforger1 Good luck with ObjC, psch... you have my sympathy
20:16 psch well, at least it's a job i guess :)
20:16 toolforger1 Heh. I am currently doing Appway.
20:17 TEttinger joined #perl6
20:17 toolforger1 "Full-fleged BPMN tool", but not really enterprise-ready - does not integrate with any sane SCM because sources are saved as SHA1-identified XML
20:17 toolforger1 I.e. XML files that have SHA1 hashes as filename
20:17 psch why does corp like xml so much..?
20:18 toolforger1 It's standard.
20:18 psch right.  it also does everything i suppose
20:18 psch so it always works!
20:18 toolforger1 An extensible one - if you sh*tty customer sends you XML with nonstandard fields, you can easily identify and ignore them
20:18 psch anyway, gonna get bedwards too, CET waits for no one o/
20:18 toolforger1 \o/
20:19 toolforger1 I'd still prefer YAML, but ah well I'm not going to be asked
20:19 toolforger1 off to bed for me, too
20:19 toolforger1 g'night all!
20:20 toolforger1 left #perl6
20:22 andrzejku__ joined #perl6
20:25 dalek Inline-Python: 981960c | (Brock Wilcox)++ | / (3 files):
20:25 dalek Inline-Python: Add an option to EVAL to differentiate eval vs file mode. Python!!!
20:25 dalek Inline-Python: review: https://github.com/niner/Inline-Python/commit/981960cf93
20:25 dalek Inline-Python: 5bb1d89 | (Brock Wilcox)++ | / (5 files):
20:25 dalek Inline-Python: Merge remote-tracking branch 'origin/master' into fix-EVAL
20:25 dalek joined #perl6
20:28 dalek Inline-Python: 3588530 | parabolize++ | / (2 files):
20:28 dalek Inline-Python: Explicitly call python2 in installation
20:28 dalek Inline-Python:
20:28 dalek Inline-Python: Some environments have python point to python3. In these
20:28 dalek Inline-Python: environments the installation fails.
20:28 dalek Inline-Python: review: https://github.com/niner/Inline-Python/commit/358853060a
20:28 dalek Inline-Python: 82c41f0 | niner++ | / (2 files):
20:28 dalek Inline-Python: Merge branch 'explicit-path' of https://github.com/parabolize/Inline-Python
20:28 dalek Inline-Python: review: https://github.com/niner/Inline-Python/commit/82c41f0bd8
20:35 masak how likely is `python2` to be available on a system?
20:35 masak it's on mine, but I had never heard of it before :)
20:37 pmurias psch: what do you mean by nqp bytecode?
20:37 samcv i have python2 on my system, and python is python 3
20:37 samcv @masak
20:37 samcv depends on the distro though
20:37 geekosaur https://www.python.org/dev/peps/pep-0394/
20:37 geekosaur so I expect it will be fairly reliable
20:38 samcv usually doing python2 is more catchall than 'python'
20:38 samcv i'm pretty sure even distros where 'python' uses python2 still have a symlink called python2 pointing to it
20:39 bjz joined #perl6
20:39 rurban joined #perl6
20:39 * grondilu has 'python2' on his debian/stretch
20:42 dalek Inline-Python: cf7956e | (Brock Wilcox)++ | README.md:
20:42 dalek Inline-Python: Update README with EVAL example and fixed travis link
20:42 dalek Inline-Python: review: https://github.com/niner/Inline-Python/commit/cf7956e572
20:42 dalek Inline-Python: 0660c00 | niner++ | README.md:
20:42 dalek Inline-Python: Merge pull request #13 from awwaiid/master
20:42 dalek Inline-Python:
20:42 dalek Inline-Python: Update README with EVAL example and fixed travis link
20:42 dalek Inline-Python: review: https://github.com/niner/Inline-Python/commit/0660c00cb9
20:54 masak today's autopun spotting: https://twitter.com/nixcraft/status/662040529362784256
20:54 timotimo "trick or syncookie" <3
20:57 Zoffix joined #perl6
20:57 Zoffix
20:57 vendethiel- timotimo: but cookies are for the dark side :o
20:57 timotimo ohai ven
20:58 masak vendethiel-! \o/
20:58 vendethiel- o/
20:59 inra joined #perl6
21:01 andrzejk1 joined #perl6
21:09 grondilu oh that's interesting.  Remember how I got False in local with log(8) %% log(2) ?  I've tried compiling MoarVM with clang instead of the default gcc, turns out with that version I get true.
21:09 grondilu so maybe gcc is to blame
21:09 grondilu I'm using gcc (Debian 5.4.1-3) 5.4.1 20161019
21:10 Zoffix grondilu, is floating point noise supposed to be deterministic?
21:11 vendethiel- Zoffix: yeah, hardware specific
21:11 vendethiel- maybe UB
21:12 Zoffix Ah
21:13 kurahaupo__ joined #perl6
21:14 timotimo something might have shuffled the order of floating point calculations around
21:14 timotimo grondilu: i'd be interested to know if the result changes when you execute the same code enough that it gets jitted
21:14 timotimo though i'm not sure if we have jit-implementations of much of the floating point arithmetic
21:15 timotimo addition and subtraction for sure, but maybe not logarithms
21:15 bjz_ joined #perl6
21:15 Zoffix m: log(8) %% log(2) or die for ^1000_0000
21:15 camelia rakudo-moar 4829f1: ( no output )
21:15 colomon why would you expect log(8) %% log(2) to work?
21:15 Zoffix ?
21:16 Zoffix What does "to work" mean in this context?
21:16 colomon it’s an int/rat operator and you’re passing it floats?
21:16 vendethiel- grondilu: I'm interested in knowing if it changes depending on gcc/clang's optimization level :P
21:17 Zoffix Yeah, that's the issue. We get different results for same input
21:17 Zoffix On different builds of the same versions of rakudo/moar
21:18 * colomon stops asking questions and pulls up the source
21:18 Zoffix :D
21:19 perlpilot colomon: maybe the expected it result is to complain  :)
21:19 perlpilot s/it//
21:19 mcmillhj joined #perl6
21:19 firstdayonthejob joined #perl6
21:20 Zoffix m: say gather { take $_ unless log(2**$_) %% log(2) for ^100 }
21:20 camelia rakudo-moar 4829f1: OUTPUT«(33 35 37 39 51 55 59 66 70 74 78 81 85 89 95)␤»
21:20 colomon hmm, there’s an explicit infix:<%> for Num
21:20 grondilu I'm using debian/stretch on a VirtualBox VM, so it should be easily reproducable.
21:21 colomon … and you’ve got to dive into NQP to figure out what it does
21:22 colomon off the top of my head, I’m thinking infix:<%> makes sense for Nums, but infix:<%%> (which is defined in terms of infix:<%>) does not
21:23 Zoffix I get same results as camelia on two different jessie boxes, on Bodhi box based off ubuntu trusty, and a Windows 10 box
21:23 colomon because it amounts to checking a floating point operation for exact equality.
21:23 Zoffix with Bodhi running in Virtual Box
21:25 colomon m: for 1..10 -> $n { say log(2**$n) }
21:25 camelia rakudo-moar 4829f1: OUTPUT«0.693147180559945␤1.38629436111989␤2.07944154167984␤2.77258872223978␤3.46573590279973␤4.15888308335967␤4.85203026391962␤5.54517744447956␤6.23832462503951␤6.93147180559945␤»
21:25 colomon m: for 1..10 -> $n { say log(2**$n) / log(2) }
21:25 camelia rakudo-moar 4829f1: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
21:25 colomon m: for 1..10 -> $n { say log(2**$n) / log(2) - $n }
21:25 camelia rakudo-moar 4829f1: OUTPUT«0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤»
21:26 colomon hmm
21:26 masak m: for 1..10 -> $n { say log(2**$n) / log(2) == $n }
21:26 camelia rakudo-moar 4829f1: OUTPUT«True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤»
21:26 masak hmmmmm :)
21:26 * masak .oO( coincidence? I think not! )
21:27 colomon I’m inclined to think so
21:28 masak colomon: I'm torn on the infix:<%%> for Nums thing
21:28 masak colomon: on the one hand, I would never even think to do that
21:29 masak colomon: on the other hand, maybe it would make sense for some Nums; for example Nums that are sums of powers of 1/2
21:29 colomon m: for 1..10 -> $n { say log(3**$n) / log(3) }
21:29 camelia rakudo-moar 4829f1: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
21:30 masak I think what you're seeing for those really small numbers is simply double precision being more than enough to end up on the integer precisely
21:30 * perlpilot thinks there should be a different operator for %% on Num
21:30 masak m: say log(3 ** 100) / log(3)
21:30 camelia rakudo-moar 4829f1: OUTPUT«100␤»
21:30 masak perlpilot: why? it's doing the same numeric operation
21:30 colomon masak: isn’t log(2) an irrational number?
21:31 masak perlpilot: a lot of operations on Num are inexact by nature
21:31 perlpilot masak: I don't have a good rationale.  It just feels righter to me.
21:31 masak colomon: yes, but that likely all gets lost in the fuzz and froth of doubles
21:32 masak perlpilot: I think I only approve of an explosion of operators when the operators are actually spiritually different. Perl typically ends up doing a rather good job of using *the same* operator for things that are conceptually the same thing.
21:32 perlpilot masak: but, perhaps I'm still reeling from being surprised that it worked in the first place, so it still feels foreign to me.
21:33 Zoffix left #perl6
21:33 masak heh
21:33 colomon masak: but it’s really weird for the fuzz and froth of doubles to just cancel out and leave you nice integer answers.
21:33 masak well, I do agree that it working in the first place was probably to some extent lucky happenstance
21:33 masak colomon: yes, I can't fully explain that. but I don't mind much, either
21:34 masak m: say .1e0 + .2e0 == .3e0
21:34 camelia rakudo-moar 4829f1: OUTPUT«False␤»
21:34 masak there, better now? :P
21:35 perlpilot colomon: Maybe it's only really weird for those of us who were brought up learning the foibles of floating point ... maybe it's "natural" if you ignore the fact that computers are involved :)
21:35 masak objection. I was brought up learning the foibles of floating point.
21:36 masak I'm aware of the dangers of loss of precision. I would expect someone using infix:<%%> on Num to be similarly aware.
21:37 masak that's why I said it might still make sense if you limit yourself to Nums which are sums of powers of 1/2.
21:38 colomon_ joined #perl6
21:38 masak m: say 0.5e0 %% 0.125e0 # I would expect this to always be True, no matter how crappy the Num precision
21:38 camelia rakudo-moar 4829f1: OUTPUT«True␤»
21:44 colomon but it seems ill-advised to allow an operation that is only well-defined for a tiny percentage of the possible arguments to it.
21:47 grondilu FYI it would never have occurred to me to use %% with floating points, but TimToady used it on RosettaCode.
21:47 grondilu (not that I want to point fingers or anything :)  )
21:50 * colomon is guessing he wanted to know if any integer was a power of two
21:52 colomon m: for 1..200 -> $n { say log(2**$n) / log(2) == $n }
21:52 camelia rakudo-moar 4829f1: OUTPUT«True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤False␤True␤False␤True␤True␤True␤True␤True␤Tr…»
21:52 kurahaupo__ m: say 0.1 %% 0.01
21:52 camelia rakudo-moar 4829f1: OUTPUT«True␤»
21:52 colomon yeah, bad plan
21:53 inra joined #perl6
21:54 espadrine joined #perl6
21:56 colomon joined #perl6
22:10 grondilu colomon: it was for the Fractran example in RC, but possibly some places else as well.
22:10 grondilu I think testing for power-of-two-ness should rather be 2**.msb == $_
22:14 grondilu or maybe .base(2).comb.one == 1
22:15 grondilu m: say join "", map { .base(2).comb.one == 1 ?? '.' !! '!' }, 1 .. 10;
22:15 camelia rakudo-moar 4829f1: OUTPUT«..!.!!!.!!␤»
22:16 grondilu ouch
22:16 colomon joined #perl6
22:17 grondilu m: say join "", map { .base(2).comb.one == 1 ?? '.' !! '!' }, 2 <<**<< [1 .. 10];
22:17 camelia rakudo-moar 4829f1: OUTPUT«..........␤»
22:19 colomon m: sub is-power-of-two(Int $n) { 2 ** $n.msb == $n }; for ^200 -> $n { say is-power-of-two(2 ** $n); }
22:19 camelia rakudo-moar 4829f1: OUTPUT«True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True…»
22:20 bjz joined #perl6
22:22 colomon m: sub is-power-of-two(Int $n) { 2 ** $n.msb == $n }; (^200).map(-> $n { say is-power-of-two(2 ** $n) }).categorize-list.say
22:22 camelia rakudo-moar 4829f1: OUTPUT«No such method 'categorize-list' for invocant of type 'Seq'␤  in block <unit> at <tmp> line 1␤␤»
22:22 colomon m: sub is-power-of-two(Int $n) { 2 ** $n.msb == $n }; (^200).map(-> $n { say is-power-of-two(2 ** $n) }).List.categorize-list.say
22:22 camelia rakudo-moar 4829f1: OUTPUT«No such method 'categorize-list' for invocant of type 'List'␤  in block <unit> at <tmp> line 1␤␤»
22:23 * colomon needs to finish making noms rather than sort out what stupid thing he is doing wrong there
22:31 BenGoldberg joined #perl6
22:33 grondilu m: sub is-power-of-two(Int $n) { 2**$n.msb == $n }; (^200).map({ is-power-of-two(2**$_)}).bag
22:33 camelia rakudo-moar 4829f1: OUTPUT«No such method 'bag' for invocant of type 'Seq'␤  in block <unit> at <tmp> line 1␤␤»
22:33 grondilu m: sub is-power-of-two(Int $n) { 2**$n.msb == $n }; (^200).map({ is-power-of-two(2**$_)}).Bag
22:33 camelia rakudo-moar 4829f1: ( no output )
22:33 grondilu m: sub is-power-of-two(Int $n) { 2**$n.msb == $n }; (^200).map({ is-power-of-two(2**$_)}).Bag.say
22:33 camelia rakudo-moar 4829f1: OUTPUT«bag(True(200))␤»
22:42 bjz joined #perl6
22:46 dalek modules.perl6.org: 8f32095 | (Zoffix Znet)++ | lib/ModulesPerl6/DbBuilder/Dist/PostProcessor/METAChecker.pm:
22:46 dalek modules.perl6.org: Make METAChecker check source URL only for fresh dists
22:46 dalek modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/8f32095f1e
22:46 cibs joined #perl6
22:48 viki m: for 77..79 -> $n { say log(2**$n) / log(2) == $n }
22:48 camelia rakudo-moar 4829f1: OUTPUT«True␤False␤True␤»
22:48 viki masak: ^ yeah, it's a coincidence
22:49 viki s: &infix:<%%>, \(2e0, 2e0)
22:49 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/blob/4829f1c/src/core/Numeric.pm#L220
22:49 viki m: dd 2e0.Real
22:49 camelia rakudo-moar 4829f1: OUTPUT«2e0␤»
22:49 viki m: dd 2e0.narrow
22:49 camelia rakudo-moar 4829f1: OUTPUT«2␤»
22:51 skids joined #perl6
22:51 itaipu joined #perl6
23:00 viki .categorize-list is only available on Baggies and Maps
23:00 colomon viki++
23:03 sufrostico joined #perl6
23:06 viki m: sub is-power-of-two(Int $n) { (2 ** ($n.msb//0)) == $n }; (% .categorize-list: {is-power-of-two $_}, ^2000){True}.say
23:06 camelia rakudo-moar 4829f1: OUTPUT«[1 2 4 8 16 32 64 128 256 512 1024]␤»
23:07 viki m: sub is-power-of-two(Int $n) { (2 ** ($n.msb//0)) == $n }; ^2000 .categorize(*.&is-power-of-two){True}.say
23:07 camelia rakudo-moar 4829f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unexpected block in infix position (missing statement control word before the expression?)␤at <tmp>:1␤------> 3}; ^2000 .categorize(*.&is-power-of-two)7⏏5{True}.say␤    expecting any of:␤      …»
23:07 viki your mother
23:07 viki m: sub is-power-of-two(Int $n) { (2 ** ($n.msb//0)) == $n }; (^2000).categorize(*.&is-power-of-two){True}.say
23:07 camelia rakudo-moar 4829f1: OUTPUT«[1 2 4 8 16 32 64 128 256 512 1024]␤»
23:12 viki m: ^2000 .grep({$_ == 2 ** (.msb//0)}).say
23:12 camelia rakudo-moar 4829f1: OUTPUT«(1 2 4 8 16 32 64 128 256 512 1024)␤»

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

Perl 6 | Reference Documentation | Rakudo