»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
lookatme o/ 00:13
wander \o 00:25
wander if I define "grammar G { token tok { ... } }", how can I refer tok outside G? 00:59
teatime G::tok ?
timotimo m: grammar G { token tok { . { say "hi!" } } }; grammar A { . <G::tok> { say "bye!"} } }; A.parse("fo") 01:00
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of . to concatenate strings; in Perl 6 please use ~
at <tmp>:1
------> 3tok { . { say "hi!" } } }; grammar A { .7⏏5 <G::tok> { say "bye!"} } }; A.parse("fo
timotimo m: grammar G { token tok { . { say "hi!" } } }; grammar A { token TOP { . <G::tok> { say "bye!"} } } }; A.parse("fo") 01:01
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3oken TOP { . <G::tok> { say "bye!"} } } 7⏏5}; A.parse("fo")
timotimo m: grammar G { token tok { . { say "hi!" } } }; grammar A { token TOP { . <G::tok> { say "bye!"} } }; A.parse("fo")
camelia hi!
bye!
timotimo wander: ^
wander It works. Thank you ^_^ 01:02
timotimo YW 01:03
piojo I'm getting this error again: "MoarVM panic: Memory allocation failed; could not allocate zu bytes" 04:30
I'm running Rakudo version 2017.12 built on MoarVM version 2017.12, and invoking as "perl6 --profile ./program.p6" 04:31
*on Windows, and with plenty of memory
The memory allocation is probably tricky, but the "zu bytes" is LTA 04:33
geekosaur looks to me like someone dropped a % 04:48
(%zu = (size_t) value as integer) 04:49
oh, windows. uh.
%zu is also glibc specific... 04:50
hm, guess freebsd picked it up too. or maybe the standards orgs finally got a clue about not handling size_t at all 04:53
but it's not portable to Windows 04:54
geekosaur ugh. I think this is not only known but was rejected in the past, because it's an impossible situation 05:04
in the absence of a supported %z modifier or some other way to specify that the corresponding value is a (size_t) or (ssize_t), there is *no* portable way to printf such values.
geekosaur of course. they'll be back with the same complaint, I'm sure. 05:06
"and solve the halting problem while you're at it" 05:07
piojo geekosaur: oh, thanks, that's unfortunate. Can we use a 64-bit format type and still have it work on 32-bit systems? 05:13
geekosaur no, and under certain conditions that can even cause a core dump
which is part of the reason why there's no portable way to do it 05:14
this was actually a widespread criticism of C99 and later standards, that they provided no standard way to handle this case
(unfortunately, real world standards tend to go with what vendors are willing to do... so just writing such into a standard does not mean e.g. Microsoft will adopt it. the ANSI C standard already has too many examples of that one as it is) 05:16
(...but the other ones are at least compile time errors) 05:18
piojo geekosaur: and there are two popular compilation toolchains for Windows 05:38
I'll file a MoarVM bug about this 05:39
geekosaur yes. I'd imagine this is MSC getting it wrong; msys2 would be using a modified glibc
MSVC
thing is, I seem to recall last time I ran into this was moarvm too, so I half expect any bug will be closed as WONTFIX / "get Microsoft to fix their damn toolchain" 05:40
piojo I compiled with GCC and strawberry perl
geekosaur don't know what that provides for a libc
gcc itself is not involved, it's a question of what printf library is used. and there are gcc ports that use msvcrt for libc 05:41
piojo geekosaur: A test program works, so it looks like a flub rather than an incompatibility 05:52
piojo I don't see anything wrong with the MoarVM code, and can't reproduce it even when I almost exactly copy the function. (I tried using varargs and vfprintf but that doesn't show any problem) 06:05
piojo Oh! I was testing in c++, not c. Oops 06:24
piojo geekosaur: it's already special-cased for MS, but only for Visual Studio. I added another #elif case, and it's fixed. PR made. 06:57
lizmat Zoffix: confusion around Mu ~~ * resolved 10:36
yoleaux 01:54Z <Zoffix> lizmat: why is the test wrong? (*) is Whatever:D and accepts everything, so it's True, while Whatever is Whatever:U and it's a type-check smartmatch, so it's False. Note, that along with the test there was a rakudo commit; you'll need it for test to pass
lizmat I was just in the middle of quite an extensive patch, when that test started to fail and it sent me on a goose chase for a bit 10:37
rightfold en.wikipedia.org/wiki/Industrial-grade_prime 11:12
is-prime ^ :’)
Also reminds me of i0.kym-cdn.com/photos/images/facebo...51/12e.png 11:13
tadzik eyy, that's an Engie! 11:15
rightfold Not even bothering to round e up 11:16
Just truncate it
huf e, pi and 10/3 are all = 3? :) 11:18
scimon Very interested in ValueObjAt sounds like it could be interesting. 13:57
lizmat scimon: its implementation was very difficult: class ValueObjAt is ObjAt { } :-) 14:23
timotimo the smiley at the end is what adds all the necessary magic 14:24
yoleaux 10:10Z <Zoffix> timotimo: Can this branch be merged/deleted? github.com/rakudo/rakudo/tree/micr...de_numbers I may have did something to DIVIDE_NUMBERS a month ago that'd cause a conflict tho
scimon :D 14:26
lizmat wow, that's a lot or rurban! 14:34
timotimo ? 14:35
lizmat timotimo: check entrance and leave message just now :-) 14:36
*messages
timotimo oh, now i see
i had the smart filter on
lizmat :-) 14:37
moritz opened github.com/stmuk/pl6anet.org/pull/8 17:24
stmuk_ moritz++ # thanks 17:59
mspo moarvm is a stack machine, right? 18:57
MasterDuke mspo: no, register 19:06
andrzejku hey 20:15
where can I find
Perl6 grammar
MasterDuke andrzejku: github.com/rakudo/rakudo/blob/mast...rammar.nqp 20:16
aeruder m: say ((1..4).race.map({sleep 1; 1;}).list); say now - INIT now; 20:51
camelia (1 1 1 1)
4.01273257
aeruder is there some reason why that isn't parallelized?
lizmat aeruder: the default value for :batch is 64 20:53
aeruder d'oh, that makes sense
lizmat m: say ((1..4).race(batch => 1).map({sleep 1; 1;}).list); say now - INIT now;
camelia (1 1 1 1)
1.0527615
aeruder perfect, thanks
timotimo twitter.com/sarah_edo/status/946091648773013504 - anyone want to steal this? 20:55
lizmat looks interesting :-) 20:58
moritz fwiw, in the last years, the Perl 6 advent calendar had a separate post with a table of contents/index of the posts of that year 21:46
if somebody has some time to spare, creating such a post would be nice 21:47
lizmat it would be just a matter of copy-pasting parts of the last 4 p6weeklies 22:04
mspo MasterDuke: interesting 22:33
Herby_ o/ 22:41
\o
timotimo o/ 23:02
Herby_ Rookie question: Has the LWP::Simple library that ships with Rakudo Star not been updated in 2 years? 23:12
Have there been improvements in p6 during that time that could improve a base library? 23:13
lizmat According to Matt Oates it has: perl6advent.wordpress.com/2017/12/16/ 23:14
Herby_ Thats what I was thinking
Herby_ Not that I have a strong enough base of knowledge to improve it, just seemed odd that a base library for a rapidly improving language hasn't been updated in a while 23:15
timotimo we do have multiple http clients 23:16
there's also WWW and Cro::HTTP
Herby_ yeah, was about to mention that
timotimo and more!
one based on libcurl, too
Herby_ do one of those server the rakudo star package better?
timotimo dunno. we'd better only add to it and not subtract too fast 23:17
bbiab
Herby_ o/
lizmat sleep& 23:39
AlexDaniel squashable6: next 23:46
squashable6 AlexDaniel, Next SQUASHathon in 8 days and ≈10 hours (2018-01-06 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
Perl6 How do I turn a string of numbers separated by commas into an array of those numbers? 23:46
yoleaux 25 Oct 2014 23:59Z <raiph> Perl6: to encourage someone to post a P6 version of the tiny reverse polish forthish "compiler" at www.reddit.com/r/perl/comments/2kb0...n_in_perl/ (I plan to have a go early next week if no one else gets to it and it's still in the top 10 on /r/perl)
12 Jan 2015 11:37Z <timotimo> Perl6: .new() isn't like __init__ or __new__, it's like python's .frob or .blubber or .yoink; also, new calls bless calls BUILDALL calls BUILD unlike what geekosaur said, and skids wrongly wrote bless(*, ...), but the * as first argument is wrong nowadays
geekosaur o.O 23:47
jnthn m: dd "1,2,5,42".split(",").map(+*)
camelia (1, 2, 5, 42).Seq
jnthn m: dd ["1,2,5,42".split(",").map(+*)]
camelia [1, 2, 5, 42]
Perl6 jnthn: Thanks! What does .map(+*) do by the way? 23:48
jnthn +* is a shorter way to write the closure { +$_ } 23:49
geekosaur the leading + coerces to a number
jnthn The + prefix operator means "numify" 23:50
geekosaur split gives you a Seq of Str-s, you then map numification over the Seq
jnthn And map is just "do this operation for each value and make a new sequence of the results"