🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
00:01 Tirifto left
timotimo i think that'll enforce parsing as an array of words (because that's what angle brackets do) followed by stringification by joining on a single space by from-json 00:09
so not very fast :) 00:10
00:18 lucasb left 00:23 sarna left, sarna joined 00:27 xinming_ left 00:29 xinming_ joined
rypervenche Oh, that was for my example :/ In my actual script, I've got a grammar that captures the entire json. 00:40
Geth ¦ problem-solving: vrurg assigned to jnthn Issue Provide better interface for dispatchers github.com/Raku/problem-solving/issues/170 00:44
00:51 patrickz joined
timotimo oh, if you're already using a grammar to capture JSON, maybe try JSON::Tiny::Grammar as a base 00:52
00:55 patrickb left 00:59 Aukai joined
rypervenche timotimo: I'll give that a shot, thanks. 01:05
01:06 patrickz left 01:10 rypervenche joined 01:33 Doc_Holliwould left 01:49 sftp joined 01:52 aborazmeh joined 01:53 aborazmeh left, aborazmeh joined 02:07 aborazmeh left
vrurg m: say "10.".Rat; 02:23
camelia Cannot convert string to number: radix point must be followed by one or more valid digits in '0310.⏏' (indicated by ⏏)
in block <unit> at <tmp> line 1
vrurg This doesn't feel right... 02:24
02:24 helit joined
Geth doc: d9671fb439 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/classtut.pod6
Use preferred syntax
02:28
linkable6 Link: docs.raku.org/language/classtut
02:38 upupbb-user3 left 03:03 upupbb-user3 joined 03:10 upupbb-user3 left 03:45 oodani left, xinming_ left 03:46 oodani joined, Sgeo joined 03:47 xinming_ joined 03:49 gdonald left 03:51 gdonald joined 04:48 Actualeyes left, Actualeyes joined, wamba joined 04:56 orinthe joined 05:14 upupbb-user3 joined 05:29 rindolf joined 05:30 xinming_ left 05:33 xinming_ joined 06:00 upupbb-user3 left 06:04 xinming_ left 06:07 xinming_ joined
Geth doc: c5b97ad97d | Tinmarino++ | doc/Language/regexes.pod6
Feature: Index regex interpolation tokens

Issue: #3220
  ```raku
  $variable
  $(code)
... (9 more lines)
06:18
linkable6 Link: docs.raku.org/language/regexes
linkable6 DOC#3220 [open]: github.com/Raku/doc/issues/3220 [docs] Index `<{ ... }>` and other missing regex interpolatives
Geth doc: ebbdc62a84 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Merge pull request #3295 from tinmarino/merge_index_regex

Feature: Index regex interpolation tokens
06:22 xinming_ left 06:24 xinming_ joined 06:28 pilne left
Geth doc: f5499d435e | (JJ Merelo)++ | doc/Language/grammars.pod6
Adds semicolon, closes #3296
06:29
linkable6 Link: docs.raku.org/language/grammars
DOC#3296 [closed]: github.com/Raku/doc/issues/3296 [RFE] Missing a semicolon in the statement
07:01 Doc_Holliwould joined 07:22 sjm_uk joined 08:05 stoned75 joined 08:12 xinming_ left 08:13 xinming_ joined
samcv Does anyone know if I can use Grammar::Profiler::Simple to profile standard regex's? I tried but maybe I'm using it incorrectly. The documentation only mentions grammars 08:27
MasterDuke samcv: no idea re your question, but i have one of my own. is there a quick way to tell if a string has any utf8 (i.e., non iso-8859-1) codepoints? 08:40
08:43 molaf joined
lizmat /^ <:Script<Latin>>* $/ 08:53
08:53 hungrydonkey joined
lizmat not "abcd".ords.first(* > 255) 08:55
MasterDuke hm. what about in pure nqp? 08:56
i.e., is this best github.com/Raku/nqp/blob/master/sr...2299-L2305 ? 08:57
lizmat that looks ok to me... and I forgot about CR 09:03
I would probably check for $g== 0x0d first, then >= xff then < 0 09:04
but that's really micro :-)
m: use nqp; my str $s = "abcd"; dd nqp::getcp_s($s,1) 09:05
camelia 98
lizmat he
I don't think nqp::getcp is documented
MasterDuke: in these types of loops, I always start at $i = -1 and use ++$i 09:06
also: you could do all of the checks inside the condition, make the body nqp::null, and check $i < $chars in the end as the flag 09:08
you wouldn't need the $utf8 variable then
stoned75 hum... dumb question may be but what's special about CR here ?
lizmat it's a synthetic codepoint
m: dd "\r\n".chars 09:09
camelia 1
stoned75 oh ok
thanks 09:10
09:10 upupbb-user3 joined
samcv MasterDuke, let me check 09:11
09:13 pecastro joined 09:14 natrys joined
samcv well i just found a bug in the REPL. so that's neat. If you put invalid utf-8 into the repl it will enter an infinite loop 09:19
MasterDuke, also. yes about the \r\n you should cache "\r\n"'s grapheme value and allow that as utf8. though tbh i don't have full background on WHY we care if $utf8 is set or not. like. are we trying to actually detect things that are ascii? 09:21
er. things that fit in 7-bit strings or whatever 09:22
MasterDuke well, github.com/Raku/nqp/blob/master/sr....nqp#L2307
09:24 leont joined
samcv so. are we really trying to find out if the result will have any graphemes containing more than 1 codepoint? 09:25
MasterDuke i guess, but nine++ would know for sure 09:27
09:27 sarna left
samcv i guess I still am confused about where the strings come from. And what format they are actually in. Is it actually latin-1, or are we just using latin-1 because it supports 8 bits? 09:27
MasterDuke i think the string come when compiling rakudo, e.g., method names 09:28
afk for a bit, will backlog
09:30 chloekek joined
samcv if i always try to encode as utf8 i get this error when trying to compile nqp: "Could not resolve lexical $¢" which is a bit weird. 09:32
'$¢'.encode('latin-1').decode => '$¢'. 09:34
09:40 kylese joined 09:57 Grauwolf left
samcv MasterDuke, i have fixed your problem github.com/Raku/nqp/pull/607 this PR is mostly a proof of concept, not in a fully finished form 10:13
but it fixes the bug (feature?) of our mast encoded strings
lizmat has commented on that PR 10:15
timotimo samcv: do you know about the #?if stage thingie i put in at some point? 10:17
samcv timotimo, no i don't 10:18
timotimo that could remove the need for the stage0 rebuilds
it's in gen-cat
samcv yeah. i probably did more rebuilds than i needed. but it's a quick proof of concept 10:19
as well so that only one thing happens between each commit as the other, so each commit can generate the one before it
timotimo ah, i put that in for confprog support, since it added an op confprogconfigure to HLL::Compiler or something
samcv you could easily do it all in one step
there's other places we do latin-1 encoding. but i'm guessing nowhere else is handling $¢ lexical. A full fix would probably remove any use of latin1 10:21
10:24 Grauwolf joined, Grauwolf left, Grauwolf joined 10:51 Altai-man_ joined 11:00 mowcat joined
chloekek What is an example where you have to use $¢ and cannot use $/ instead? 11:04
11:12 stoned75 left, stoned75 joined
lizmat chloekek: I believe you need this when you add methods to grammars, but I have never done so myself 11:19
11:22 Doc_Holliwould left
timotimo did this change when cursor and match were made the same thing? 11:29
Kaiepi releasable6, status 11:30
releasable6 Kaiepi, Next release will happen when it's ready. 3 blockers. 166 out of 256 commits logged (⚠ 3 warnings)
Kaiepi, Details: gist.github.com/cedf201085e1d34770...31e2bf39b3
Kaiepi i have some big stuff for the ecosystem once this next release happens :) 11:31
lizmat Kaiepi: unless we can fix the JIT issues and the performance loss real soon, I don't think we'll see a 2020.03 release :-( 11:34
Kaiepi ah man :( 11:35
lizmat sorry, I guess I shouldn't have merged the nextdispatcher stuff :-( 11:37
Kaiepi the updates to Trait::Traced depend on that, but i think my new module just depends on a fix to `is built` i made 11:40
if the release doesn't happen i think the new module is still releasable with some tweaks
lizmat Kaiepi: unless you have some dependency on MoarVM version in your code, you would still need to make those adjustments anyway? 11:46
Kaiepi i guess it'd make more sense not to have the v2020.03 requirement if that's the only reason it has it 11:47
12:02 mowcat left 12:07 Doc_Holliwould joined
lizmat m: dd Date.new(2020,3,24) cmp Date.new(2020.3,25) # this feels like an omission 12:07
camelia Cannot resolve caller new(Date:U: Rat:D, Int:D); none of these signatures match:
(Date: Int:D(Any):D $year, Int:D(Any):D $month, Int:D(Any):D $day, :&formatter, *%_ --> Date:D)
(Date: Int:D(Any):D :$year!, Int:D(Any):D :$month = 1, Int:D(A…
lizmat m: dd (Date.new(2020,3,24),Date.new(2020.3,25)).sort 12:08
camelia Cannot resolve caller new(Date:U: Rat:D, Int:D); none of these signatures match:
(Date: Int:D(Any):D $year, Int:D(Any):D $month, Int:D(Any):D $day, :&formatter, *%_ --> Date:D)
(Date: Int:D(Any):D :$year!, Int:D(Any):D :$month = 1, Int:D(A…
MasterDuke hm. don't think i would ever pass 2020.3 to a date function. maybe "2020.3", but even that is unlikely 12:10
lizmat yeah... :-(
argh :-)
I was referring to the omission of Date cmp Date 12:11
but it isn't omitted at all
note to self: read the error! 12:12
MasterDuke oh, ha
12:13 aborazmeh joined, aborazmeh left, aborazmeh joined
Geth doc: 8d5add817b | Tinmarino++ | doc/Type/Metamodel/Mixins.pod6
Fix URL mixin with absolute path
12:16
doc: da7fa89d5e | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Type/Metamodel/Mixins.pod6
Merge pull request #3291 from tinmarino/merge_mixins

Fix URL mixin with absolute path
linkable6 Link: docs.raku.org/type/Metamodel::Mixins
12:25 hungrydonkey left 12:26 kylese left 12:29 sena_kun joined 12:30 aborazmeh left, Altai-man_ left 12:31 hungrydonkey joined
cpan-raku New module released to CPAN! Data::Record (0.0.1) by 03KAIEPI 12:45
12:45 kylese joined
Kaiepi ^ big if you like strictly typed code or have data sanitization needs! 12:46
12:56 hungrydonkey left 13:16 upupbb-user3 left 13:36 molaf left 13:58 kensanata joined 14:05 lucasb joined
sena_kun NativeCall question: say I have a CStruct which doesn't have a field in one impl and has one in another, so in `is repr('CSTruct')` I have `has int32 $.foo` I am getting either library provided value or garbage. Doing `has int32 $.foo = -1` isn't helping, I think, because that's not how objects are initialized here. 14:16
Any bells? 14:17
timotimo don't really understand the question, but would writing your own accessor methods help here? 14:18
sena_kun timotimo, can I have them in CStruct repr? 14:19
timotimo yep
sena_kun another question is how do I differentiate if it was a real value provided by the library or garbage.
timotimo i believe every repr allows methods, because the metaobject is responsible for them
sena_kun timotimo, can giving a context help with understanding the question? :)
timotimo well, yeah, how *do* you know what it is?
whether it's garbage or not 14:20
sena_kun The problem is that in openssl implementation, ssl_method_st is defined this way: docs.huihoo.com/doxygen/openssl/1....tml#l00410 14:21
timotimo i don't know what "in one impl" vs "another impl" means %)
sena_kun and in libressl it is this - github.com/libressl-portable/openb...ssl.h#L403
so totally different structs. :(
and the second one doesn't provide `version`
timotimo oh
sena_kun I also see no calls to check what implementation that is, since it is designed to be a "drop in replacement" (oh yeah). 14:22
timotimo there's a vastly different amount of functions, even. or are you supposed to go through the internal pointer? 14:23
sena_kun timotimo, I am not sure I want to implement them. There are tests which test this particular `version` attribute and on libressl they fail. But if I --force them, the module just works fine. 14:24
timotimo how do you get the ssl_method_st struct in libressl in the first place?
sena_kun it is provided by its parent struct, ssl_ctx_st, I think
Geth doc/any-grep-undef-wording: b6e2cc3d53 | (Stoned Elipot)++ | doc/Type/Any.pod6
Imporove wording
14:25
sena_kun or, hmm, not really, it isn't
timotimo it seems to give the internal_st
but that's kind of not declared in that header 14:26
so probably not meant to be used by end users
sena_kun Probably that's why libressl folks just removed it.
timotimo what's the ssl/foo.h stuff that gets included around line 900 or so? 14:27
from openssl i mean
maybe you do get the same struct after all?
anyway, i need to go rest my eyes a bit 14:28
14:28 Altai-man_ joined
Geth doc/improve-wording: 03e41c23dd | (Stoned Elipot)++ | doc/Type/Any.pod6
Improve wording
14:30
doc: stoned++ created pull request #3297:
Improve wording
14:31 sena_kun left 14:43 xelxebar left 14:50 pecastro left
Altai-man_ anyone who have some free time and has ubuntu (or any other distro with openssl), macos or windows, can take a look at github.com/sergot/openssl/pull/78 ? :) 14:53
15:09 synthmeat left
Geth doc: uzluisf++ created pull request #3298:
Perl 6 extensions -> Raku extensions
15:09
15:12 pilne joined 15:15 Manifest0 joined 15:19 molaf joined 15:23 pecastro joined 15:31 sjm_uk left 15:32 synthmeat joined, stoned75 left 15:42 stoned75 joined 15:47 chloekek left 15:49 leah2 joined
Geth doc: 03e41c23dd | (Stoned Elipot)++ | doc/Type/Any.pod6
Improve wording
15:52
doc: a3f66fb721 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Type/Any.pod6
Merge pull request #3297 from Raku/improve-wording

Improve wording
linkable6 Link: docs.raku.org/type/Any
Geth doc: a20128a975 | (Luis F. Uceta)++ | doc/Language/modules.pod6
Perl 6 extensions -> Raku extensions
15:54
doc: a1de178828 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/modules.pod6
Merge pull request #3298 from uzluisf/master

Perl 6 extensions -> Raku extensions
linkable6 Link: docs.raku.org/language/modules 15:55
16:09 Black_Ribbon joined 16:15 thundergnat joined 16:16 cognominal joined
thundergnat Any regex experts about? or someone willing to offer an opinion? 16:16
m: gist.github.com/thundergnat/8c2135...ce58229d3f
camelia What's so Tom? That's so Tom. 'Tis tomish


XXXXXX so Tom? XXXXXX so Tom. 'Tis XXXXXX
What's so XXX? XXXX's so XXX. XXXX tomish
XXXXXX so XXX? XXXX's so XXX. XXXX XXXXXX
XXXXXX so XXX? XXXX's so XXX. XXXX XXXXXX
thundergnat I can't understand why the 4th word "That's" is being captured differently in the different circumstances 16:17
Sometimes it captures the trailing 's, other times it doesn't 16:18
It seems like a (pretty obscure) bug to me, but I'd like to get a second opinion before reporting it as such 16:19
16:29 sena_kun joined, kensanata left 16:31 Altai-man_ left, sena_kun left 16:34 veesh left, veesh joined
thundergnat Hmm. Ok, after explaining the problem to my Camelia plushie, it turns out that I am just very confused. No bug. 16:42
Altreus Is there a note without nl? 16:49
a print but defaults to $*ERR
16:52 chloekek joined
chloekek Programming in Raku again, what a joy. :) 16:53
16:54 sena_kun joined
chloekek Using the latest Rakudo. 16:54
thundergnat m: sub noted ($text) { $*ERR.print($text) }; .&noted for ^5; # <-- Altreus 16:57
camelia 01234
Altreus Ya I meant existing :) 17:01
Seems like there's an incomplete coverage 17:02
I guess in fact there's only note for $*ERR
The rest are just shortcuts to $*OUT.x
chloekek timotimo: do you recall when you added JSON::Fast to CPAN? 17:03
Has it always been on there?
17:03 rbt left
chloekek For some reason I was getting it from GitHub. 17:04
Oh I know why, nevermind.
17:04 rbt joined
thundergnat note is only a shortcut to to $*ERR because that is the way it is written. It's the whole point really. I guess there just hasn't much demand for a no new-line note. 17:04
Especially since it is so simple to code it up in the rare event you may need it.
chloekek p6: my $*OUT := $*ERR; .print for ^5
camelia 01234
Altreus :x 17:05
Honestly it's just a stand-in for a proper log object so I'm not too concerned :)
lizmat Altreus: $*ERR.print
Altreus lizmat: si I am doing this ^_^ 17:07
chloekek Just define “log object” as any object that has a method called print. :+1:
p6: enum Level <Info Warning Error>; $*ERR.print(Info, ‘Reticulating splines’); 17:08
camelia InfoReticulating splines
chloekek The default is kinda ugly but it does the job. :P
Altreus Well I figure I can put it in a special place 17:10
17:24 Actualeyes left 17:35 mowcat joined 17:36 lichtkind joined 17:38 xinming_ left 17:40 xinming_ joined 17:44 sjm_uk joined 17:53 sauvin left 17:57 abraxxa left 18:01 Exodist joined 18:05 thundergnat left 18:13 Black_Ribbon left 18:15 sauvin joined 18:28 Altai-man_ joined 18:31 sena_kun left 18:36 sjm_uk left 18:51 kylese left 19:03 MasterDuke left 19:13 MasterDuke joined 19:19 chloekek left 19:33 kensanata joined 19:49 mowcat left
Altai-man_ Anyone with OSX or Windows to try out github.com/sergot/openssl/pull/78 around? :) 19:50
19:54 zxcvz left
Altreus If I call done, does it stop execution of the current handler (like a return) or just turn off the supply? 20:00
Altai-man_ m: my $s = supply { say 1; done; say 2; }; react { whenever $s {} } 20:04
camelia 1
Altai-man_ m: my $s = supply { say 1; done; start { say 2 }; }; react { whenever $s {} }; sleep 2;
camelia 1
Altai-man_ Altreus, ^ 20:05
Altreus hmm
m: my $s = Supply.interval(1); react whenever $s -> $v { say $v; if $v == 3 { $s.done }; say $v }; sleep 4; 20:06
camelia 0
A react block:
in block <unit> at <tmp> line 1

Died because of the exception:
No such method 'done' for invocant of type 'Supply'. Did you mean any of these?
clone
do
does
none

in b…
Altreus m: my $s = Supply.interval(1); react whenever $s -> $v { say $v; if $v == 3 { done }; say $v }; sleep 4;
camelia 0
0
1
1
2
2
3
Altreus I guess that's my problem 20:07
hrm
I'm in an async tangle
jnthn Altreus: `done` finishes the supply or react block as a whole 20:11
tellable6 2020-03-29T19:38:24Z #moarvm <nwc10> jnthn there is also a Malformed DU chain in t/spec/S32-exceptions/misc2.rakdo.moar -- it's Spesh of 'EVAL' (cuid: 12669, file: SETTING::src/core.c/ForeignCode.pm6:27)
jnthn Altreus: Use `last` if you just want to unsubscribe from one thing
20:16 devmikey joined
Altreus I want to stop the supply but continue processing, but that smells like my design is wrong in the first place 20:18
my brain is a bit full for today 20:19
I can postpone the done I think, but I still feel like I've done it wrong 20:22
jnthn You want to turn off the timer, but after scheduling another piece of work that runs within the supply block? 20:25
whenver Supply.interval(1) { if should-stop() { whenever start the-other-processing() -> $result { ... }; last; } 20:26
20:29 sena_kun joined
Altreus Yes, except it's recursive :) 20:29
I'll show you
github.com/shuppet/p6-api-discord/...#L183-L189 20:30
20:30 Altai-man_ left
Altreus This bit of code handles when we didn't get an ACK since the last iteration 20:31
What it _should_ do is disconnect and reconnect - but "connect" involves setting up this heartbeat
So I need to kill the current heartbeat, then reconnect
I dunno if that's a problem but it feels like a problem :)
Also super hard to test so I want to get as much right as possible first go 20:32
jnthn If you reconnect, where does the new heartbeat supply come from? 20:34
Altreus line 181 creates one indiscriminately
I dunno what that will do with the previous
Also, I'm not sure whether the definedness of this supply is a good indication of stuff, so I'm not entirely sure I should be saving it into a private property at all 20:35
e..g
github.com/shuppet/p6-api-discord/...#L161-L163
This uses the existence of the heartbeat to skip making a new one but that might be the wrong thing to do 20:36
In fact, it only skips it because it would be doing it twice if it didn't... I really don't think I should worry about a second HELLO out of nowhere 20:37
jnthn In general, things that need recursion in a supply context are done by 1) having a sub inside of the supply or react block, 2) having a whenever inside of that sub, 3) calling it initially for the intial action (e.g. heartbeat of current connection), and 4) calling it again with the thing to work on subsequently (e.g. the next connection's stream of heartbeats)
I think Cro::HTTP::Client does a similar structure for following redirects 20:38
Altreus react { sub do-the-thing { ... } do-the-thing(); whenever something-happens { do-the-thing } }?
jnthn As does the example from my supply/react talk that keeps N tasks going at a time
Altreus hmm a supply/react talk would probably help me out 20:39
jnthn Well, maybe, but I'd expect a `whenever` inside the sub too
Altreus got it handy? I'll watch it later
as in tomorrow
as in arbitrary future point
jnthn Hm, where is the video I wonder...slides are just on the talks page of my site
jnthn.net/papers/2019-gpw-react-sup...enever.pdf
Altreus I might have to let my brain reboot from staring at it too long - fresh pair of eyes so I can actually understand it :D 20:40
jnthn www.youtube.com/watch?v=GdU5XUck8O...4&t=7s 20:41
Altreus \o/
20:46 lichtkind left
Aukai Good resource for a perl 5 developer to learn Raku/p6? 20:48
sena_kun Aukai, you can take a look at migration guides in official docs: docs.raku.org/language.html#Migration_guides 20:49
Aukai Is there pattern matching btw? 20:53
In the rust/erlang sense?
timotimo yeah, in multi-dispatch subs you can and do pattern match 20:55
Aukai ty 20:59
20:59 natrys left
Aukai And final question for now: are there any mature (or mature-ish) light web routing frameworks? 20:59
Oh actually, bonus question: is tail-call recursion optimized? :D 21:00
lizmat Aukai: cro.services to the final question
bonus question: no
Aukai Thanks <3 21:04
21:08 kensanata left 21:15 Kaiepi left 21:16 Kaiepi joined 21:17 Kaiepi left 21:18 Kaiepi joined 21:19 Kaiepi left, vike1 left 21:20 Kaiepi joined 21:21 Kaiepi left 21:31 Kaiepi joined 21:32 Kaiepi left, Kaiepi joined 21:34 cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined 21:35 Kaiepi left 21:38 Kaiepi joined 22:13 wamba left 22:14 aborazmeh joined, aborazmeh left, aborazmeh joined 22:18 sftp left 22:21 sftp joined 22:26 _jrjsmrtn joined
cpan-raku New module released to CPAN! Data::Record (0.0.2) by 03KAIEPI 22:26
22:28 Altai-man_ joined 22:29 __jrjsmrtn__ left 22:30 xkr47 joined 22:31 sena_kun left 22:35 lucasb left, xinming_ left 22:36 xinming_ joined, leont left, rindolf left 22:40 stoned75 left 22:55 benlittle left, Altai-man_ left 22:57 benlittle joined 22:59 vike1 joined 23:10 xinming_ left 23:12 xinming_ joined 23:15 rba[m] joined 23:23 benkolera joined 23:28 erdic left, telex left, erdic joined, b2gills joined, aborazmeh left 23:29 telex joined 23:34 xelxebar joined 23:50 pecastro left