Perl 6 language and compiler development | Logs at colabti.org/irclogger/irclogger_log/perl6-dev | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
Set by Zoffix on 27 July 2018.
00:01 ggoebel joined 00:03 MasterDuke joined, MasterDuke left, MasterDuke joined 00:06 lucasb left 00:32 Kaiepi left 00:38 vrurg left 00:39 vrurg joined 01:00 ggoebel left
Geth rakudo: MasterDuke17++ created pull request #2835:
Fix parsing of Unicode brackets in interpolation
01:46
02:27 Kaiepi joined 02:39 TimToady left 02:40 TimToady joined 03:17 vrurg left
Geth rakudo: ba07a62f2e | (Daniel Green)++ | src/Perl6/Grammar.nqp
Fix parsing of Unicode brackets in interpolation

Add them as a possibility in postcircumfix bracket ending check.
Will be a fix for #2825 when tests are added.
06:58
synopsebot RAKUDO#2825 [open]: github.com/rakudo/rakudo/issues/2825 Different behavior between Unicode and ASCII operators
Geth rakudo: 634c5de024 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | src/Perl6/Grammar.nqp
Merge pull request #2835 from MasterDuke17/fix_parsing_of_unicode_brackets_in_interpolation

Fix parsing of Unicode brackets in interpolation
07:21 robertle joined
lizmat m: sub a() { say "a" }; await start &a # why doesn't this say anything ? 08:03
evalable6
lizmat m: sub a() { say "a" }; say await start &a # aha!
evalable6 &a
lizmat this feels like a bug to me?
m: sub a() { say "a" }; say await Promise.start(&a) 08:04
evalable6 a
True
08:05 Xliff left
masak m: sub a() { say "a" }; say await start &a() 08:16
evalable6 a
True
masak lizmat: ^
lizmat masak: that runs &a and then uses the result to start ? 08:19
sub a() { sleep 1; say "a" }; my $a = await start &a(); say "b"; await $a
m: sub a() { sleep 1; say "a" }; my $a = await start &a(); say "b"; await $a
evalable6 (exit code 1) a
An operation first awaited:
in block <unit> at /tmp/OwfTD4mmtu line 1

Dā€¦
lizmat, Full output: gist.github.com/d5b19fab92a39b9fc3...b8e049e42c
masak m: start { sleep 1; say "a" }; say "b" 08:23
evalable6 b
masak m: my $a = start { sleep 1; say "a" }; say "b"; await $a
evalable6 b
a
masak pretty clear to me that `start` expects "immediate code", not a reference to code which it'll call 08:24
so if you do `start &a` without the parens, it'll go "yup, I just evaluated &a, it's a Sub" and consider itself done
it won't call &a
lizmat that feels LTA to me, as Promise.start(&a) *will* call the sub 08:32
and start { } is nothing but syntactic sugar for that
masak `start { }` is a phaser-like block, so I'd expect it to run the block immediately, like `BEGIN { }` 08:37
with `Promise.start(&a)`, I have to pass &a in indirectly, otherwise it'll run too early, before it even gets passed as an argument 08:38
I'm sorry, I don't see the LTA/inconsistency you do
I wouldn't consider `start &a` desugaring to `start a()` to be an improvement; not unless all the phasers started doing the same, and probably not even then 08:39
timotimo could also be awkward if something you "start ..." returns a callable (a closure over data that was legnthily evaluated for example) and immediately calls that 08:41
lizmat hmmm... ok 08:46
masak zooming out, it's common for built-in syntax and API routines to differ in this way. the built-in syntax can thunk things for you -- with a routine, it's "Bring Your Own Thunk" 08:59
masak waves from macro land
jnthn `start` is a statement prefix, meaning it implies a thunk if you don't follow it by a block 09:04
And that thunk is what is passed to Promise.start
So there's already a level of code implicitly there
lizmat it just feels to me that "start &a" silently is not doing a thing you'd expect 09:07
anyways, I get the thunkiness
m: say await start 42
evalable6 42
lizmat waterbed and all :-) 09:08
masak yes, that's what I mean. if you only have API for something, you have to thunk it yourself, with more syntax. if something is supported syntactically, the thunking can be done by the compiler. 09:24
lizmat m: dd sprintf("%-05.0f", 42.3) # this feels wrong 10:02
evalable6 "00420"
lizmat m: dd sprintf("%-06.1f", 42.3) # actually, an off by one it appears
evalable6 "042.30"
Guest16965 lizmat: perl -E 'say sprintf("%-05.0f", 42.3)' # 42 10:20
same with Ruby
Geth rakudo: e6cbbcc822 | (Elizabeth Mattijsen)++ | src/core/Rakudo/Internals/Sprintf.pm6
First stab at supporting %f
10:26
Guest16965 in your secont example, i.e. 'sprintf("%-06.1f", 42.3)' both P5 and ruby returns 42.3 10:27
ignore the crappy spelling :)
lizmat Guest16965++ # so the - is ignored in favour of the prefix 0 10:28
Guest16965: how about spaces ? 10:29
Guest16965 good question :) (dogbert17 in disguise)
lizmat $ 5 'say "---" . sprintf("%-08.1f", 42.3) . "---"' 10:31
---42.3 ---
6 'say "---" ~ sprintf("%-08.1f", 42.3) ~ "---"'
---00042.30---
so looks like Perl 5 favours the - over the prefix 0
Guest16965 wasn't the minus for left/right justification? 10:32
lizmat yes
for "d" the behaviour is the same:
$ 5 'say "---" . sprintf("%-08d", 42) . "---"'
---42 ---
$
$ 6 'say "---" ~ sprintf("%-08d", 42) ~ "---"' 10:33
---42 ---
need to go afk for quite a while&
well, today :-)
10:34 lizmat left
Guest16965 $ ruby -e 'puts "---" + sprintf("%-08d", 42) + "---"' 10:34
---42 ---
|Tux| Rakudo version 2019.03.1-187-ge6cbbcc82 - MoarVM version 2019.03-75-g9b1b60f66
csv-ip5xs0.689 - 0.691
csv-ip5xs-205.774 - 5.836
csv-parser22.160 - 22.267
csv-test-xs-200.432 - 0.448
test6.912 - 6.974
test-t1.772 - 1.861
test-t --race0.898 - 0.899
test-t-2029.833 - 30.928
test-t-20 --race10.199 - 10.931
11:44
12:00 llfourn left 12:11 AlexDaniel` left 12:12 tyil[m] left 12:33 ggoebel joined 12:35 llfourn joined 12:41 llfourn left 13:17 vrurg joined 13:33 lucasb joined 13:42 |Tux| left 13:48 |Tux| joined
lucasb m: sub foo { my $a=0; while $a++ < 5 { say ++(state $x) } }; foo() 14:06
evalable6 1
2
3
4
5
lucasb m: sub foo { my $a=0; while $a++ < 5 { say ++(state $x); LAST {} } }; foo()
evalable6 1
1
1
1
1
lucasb R#2836 14:07
synopsebot R#2836 [open]: github.com/rakudo/rakudo/issues/2836 `LAST` loop inside `sub` increments `$` for every iteration
lucasb m: while False { FIRST {} } 14:26
evalable6 WARNINGS for /tmp/eQp6tELmdO:
Useless use of LOOP_BLOCK_1 symbol in sink context (line 1)
lucasb m: my $a=0; while $a++ < 5 { LAST { say "a=$a" } } # ok 14:28
evalable6 a=6
lucasb m: sub foo { my $a=0; while $a++ < 5 { LAST { say "a=$a" } } }; foo() # inside sub?
evalable6 a=0
14:36 llfourn joined 14:41 llfourn left
lucasb m: while False { LAST { say 'ok' } } # this should not run, right? 14:49
evalable6 ok
lucasb m: sub foo { my $a=0; while ++$a < 5 { LAST say 'ok' } }; foo 14:51
evalable6 (exit code 1) ok
No such method '!capture_phasers' for invocant of type 'Code'
in block <unit> at /tmp/JtaFN8kX8Y line 1
14:58 llfourn joined 15:03 llfourn left 15:47 llfourn joined 15:50 vrurg left 15:52 llfourn left 15:58 llfourn joined 16:00 vrurg joined 16:03 llfourn left 16:11 robertle left 16:44 dogbert17 joined 17:54 robertle joined 17:59 llfourn joined 18:04 llfourn left
MasterDuke i get an odd error at the very end when doing a make install in rakudo. here's a gist gist.github.com/MasterDuke17/06c3a...b9fad9ce7f with some context, this is the actual error `cp: cannot create regular file '/home/dan/Source/perl6/install/bin/perl6-m': Text file busy` 19:00
oh, nm, looks like it was because some stray processes had it open 19:02
killed them and everything was fine
20:00 llfourn joined 20:05 llfourn left 20:17 lizmat joined
dogbert17 lizmat: gcc warns about (s)printf("%-05.0f\n", 42.3), "warning: '0' flag ignored with '-' flag in gnu_printf format" 20:49
21:02 vrurg left 21:15 vrurg joined, vrurg left 21:23 llfourn joined 21:28 llfourn left 21:57 vrurg joined
AlexDaniel hm, how come there are two Cro::WebSockets modules.perl6.org/search/?q=websocket 22:07
jnthn Beats me, I think I've only ever released it to CPAN... 22:09
timotimo good question, but one of them is a month older
AlexDaniel jnthn: both are on cpan :)
jnthn AlexDaniel: Yeah, just saying it's not the usual "in both ecosystems" situation
Also: the process of producing the tarballs has been scripted for a long while, so I dunno right off what mistake could have been made 22:10
timotimo haha
[Thu Apr 11 19:51:59 2019] [info] Using ModulesPerl6::DbBuilder::Dist::Source::CPAN to load cpan://id/J/JN/JNTHN/Perl6/Cro-WebSocket-0.8.0.1.meta 22:11
[Thu Apr 11 19:51:59 2019] [info] Loading META file from dists-from-CPAN/id/J/JN/JNTHN/Perl6/Cro-WebSocket-0.8.0.1.meta
[Thu Apr 11 19:59:30 2019] [info] Using ModulesPerl6::DbBuilder::Dist::Source::CPAN to load cpan://id/J/JN/JNTHN/Perl6/cro-websocket-0.8.0.meta
[Thu Apr 11 19:59:30 2019] [info] Loading META file from dists-from-CPAN/id/J/JN/JNTHN/Perl6/cro-websocket-0.8.0.meta
you see the difference? :)
AlexDaniel Cro-WebSocket and cro-websocket? 22:12
timotimo yeah
jnthn Oh...huh...
timotimo jnthn: you should be able to delete the all-lowercase variant from your cpan folder somehow
probably through the pause web interface?
or the module updater should learn about this
jnthn But uhh.... 22:13
Isn't that just about the tarball name?
timotimo no clue :(
jnthn I thought that wasn't important at all...
Just the META6.json content
timotimo you'd think that, yeah :D
jnthn goes to rest a bit 22:15
timotimo good rest
23:21 epony left, jdv79 left, b2gills left 23:24 llfourn joined 23:28 epony joined, jdv79 joined, b2gills joined 23:29 llfourn left