🦋 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.
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
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
timotimo oh, if you're already using a grammar to capture JSON, maybe try JSON::Tiny::Grammar as a base 00:52
rypervenche timotimo: I'll give that a shot, thanks. 01:05
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
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
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
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
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
lizmat /^ <:Script<Latin>>* $/ 08:53
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
samcv MasterDuke, let me check 09:11
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
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
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
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
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
chloekek What is an example where you have to use $¢ and cannot use $/ instead? 11:04
lizmat chloekek: I believe you need this when you add methods to grammars, but I have never done so myself 11:19
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
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
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
cpan-raku New module released to CPAN! Data::Record (0.0.1) by 03KAIEPI 12:45
Kaiepi ^ big if you like strictly typed code or have data sanitization needs! 12:46
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
Geth doc/improve-wording: 03e41c23dd | (Stoned Elipot)++ | doc/Type/Any.pod6
Improve wording
14:30
doc: stoned++ created pull request #3297:
Improve wording
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
Geth doc: uzluisf++ created pull request #3298:
Perl 6 extensions -> Raku extensions
15:09
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
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
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
chloekek Programming in Raku again, what a joy. :) 16:53
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?
chloekek For some reason I was getting it from GitHub. 17:04
Oh I know why, nevermind.
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
Altai-man_ Anyone with OSX or Windows to try out github.com/sergot/openssl/pull/78 around? :) 19:50
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
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
Altreus Yes, except it's recursive :) 20:29
I'll show you
github.com/shuppet/p6-api-discord/...#L183-L189 20:30
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/
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
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
cpan-raku New module released to CPAN! Data::Record (0.0.2) by 03KAIEPI 22:26