🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 8 June 2022.
00:06 reportable6 left 00:07 reportable6 joined 00:12 vrurg left 00:13 vrurg joined 00:32 wcs joined 00:40 frost joined 01:15 cbk joined 01:53 Kaiepi left 01:54 cbk left 02:13 cbk joined 02:47 wcs left 02:53 wcs joined 03:10 swaggboi left 03:21 swaggboi joined 03:40 Kaiepi joined 04:27 Guest83 joined 04:29 cbk left 04:30 cbk joined 04:31 Guest83 left, cbk_ joined 04:32 cbk__ joined 04:35 cbk left, cbk_ left 04:37 cbk__ left, cbk joined 04:59 cbk left 05:37 wcs left 06:07 reportable6 left 06:08 reportable6 joined 06:18 Kaiepi left 06:34 Sgeo left 06:54 abraxxa joined 07:01 abraxxa left 07:02 abraxxa joined 07:50 dakkar joined
El_Che I am not enough of a C programmer to appreciate make, but if your language's project need it, you are doing somethiung wrong :) twitter.com/jjmerelo/status/1541505956986724352 08:05
I have a few colleagues that used make to build go programs (a one liner), guess who put flames into that :) 08:06
guifa trying to convert ECMA Regex to Raku regex is more complex than it seems at first 08:14
Nemokosch Does it seem simple? 08:48
guifa Yeah, you'd think it'd be
but the most complicated one so far has been on the surface devilishly simple
how would you convert ECMA /(a(b))(c)/ to Raku? 08:49
08:50 linkable6 left, evalable6 left 08:52 linkable6 joined, evalable6 joined
guifa In ECMA, $0 = 'abc', $1 = 'ab', $2 = 'b', $3 = 'c'. In Raku, $0 = 'ab', $0[0] = 'b', $1 = 'c', 08:54
nine Just linearize the Match objects into a list using depth first search 08:57
guifa nine: yeah, I thought about that, but ultimately went the lazy route, and keep an @*positional and %*named index on hand, and at the end of the regex, apply a role that overrides the AT-POS and AT-KEY methods 🙃 09:00
ECMA /(?<a>a)(b)/ becomes 09:15
` /:my (@*POSITIONAL,%*NAMED);{@*POSITIONAL.push: $/}$<a>=(a{%*NAMED<a> = $/})(b{@*POSITIONAL.push: $/}){$/ does anon role ECMA-Match {method AT-POS($pos){@*POSITIONAL[$pos]};method AT-KEY($key){%*NAMED{$key}}}}/ `
admittedly, hideous, but since no end user will ever see it, meh :-) 09:16
09:21 melezhik joined
melezhik 0/ 09:21
El_Che big head today? 09:22
melezhik Yeah, I don't how to do the small one ))) 09:23
Don't know
Not an irc geek he-he )))
El_Che o/
~o|~ 09:24
help, I can' t swim
melezhik Need to copy paste )))
What's up
El_Che no "o" in a cyrillic keyboard?
melezhik o/ 09:25
Is it better?
... it is )))
Should have done lower case )))
What's actually up? Slowly preparing sparkyci + alpine packages for Raku modules integration 09:26
I have an idea that people would need fast installation of their modules system wide using alpine apk 09:29
Nemokosch Is the order of captures different? 09:31
guifa Nemokosch: Yeah. EMCA does flat ordering, and Raku nests 09:32
tellable6 guifa, I'll pass your message to Nemokosch
09:34 melezhik left 09:35 melezhik joined
melezhik . 09:35
09:37 melezhik left, sena_kun joined 09:41 melezhik joined, melezhik left 09:42 melezhik joined 09:43 melezhik left 09:46 melezhik joined 09:47 melezhik left
Nemokosch Huh 09:47
09:51 sena_kun left 09:52 sena_kun joined 09:55 frost left
guifa Just lots of little gotchas — like . in ECMA is equivalent to <-[\n]> in Raku 10:01
10:03 melezhik joined
melezhik So, I am testing a water with potential application of sparkyci for other languages , I raised a question on HN, a feedback would be appreciated - news.ycombinator.com/item?id=31998812 10:05
10:07 melezhik left 10:08 melezhik joined
melezhik . 10:08
10:11 melezhik left 10:14 melezhik joined
Geth ecosystem: f5f1764b87 | (Elizabeth Mattijsen)++ | META.list
Fix URL of the Digest module (again)
10:17
10:17 frost joined 10:19 melezhik left 10:27 dogbert17 joined 10:58 jaguart joined 11:18 frost left 11:26 frost joined 12:07 reportable6 left 12:10 reportable6 joined 12:15 sena_kun left 12:18 sena_kun joined 12:20 frost left 12:47 nine left, m_athias left, nine joined 12:48 m_athias joined
abraxxa Util: thank you for www.youtube.com/watch?v=rSP_GgcHQ0Q ! I'm no fan of YouTube comments which might not reach you. 12:49
Geth ecosystem: b5e6be17f9 | (Elizabeth Mattijsen)++ | META.list
Physics::Measure lives in the zef ecosystem now
13:02
13:18 morte_ joined 13:23 sena_kun left 13:24 sena_kun joined 13:26 wcs joined
guifa well that's surprisingly Englis-like 13:31
`state @ = eager gather take self and find-matches-in self, :type<positional>;`
14:26 linkable6 left, evalable6 left, evalable6 joined 14:27 linkable6 joined
abraxxa Raku remembers the type initially defined for a scalar variable, e.g. my Int $speed = 125; how can I display this type enforcement? 14:38
does the raku repl have some sort of autocomplete? double-tab or ? doesn't do anything 14:39
guifa m: my Int $speed; say $speed.WHAT 14:45
camelia (Int)
15:02 Sgeo joined
[Coke] that's not exactly right: 15:12
m: my Numeric $a; $a = 3; dd $a.WHAT; dd $a.VAR.WHAT
camelia Int
Scalar
[Coke] (note that "Numeric" as the restriction isn't there.)
m: my Numeric $a; dd $a.WHAT; $a = 3; dd $a.WHAT; dd $a.VAR.WHAT
camelia Numeric
Int
Scalar
[Coke] er, not there post-assignment.
m: my Numeric $a; dd $a.WHAT; $a = 3; dd $a.WHAT; dd $a.VAR.WHAT; dd $a 15:17
camelia Numeric
Int
Scalar
Int $a = 3
[Coke] (and dd only has the current type, not the type restriction also)
15:33 sena_kun left
guifa [Coke] eh yeah, you're right. I typed without thinking 15:34
in other news, for making slangs, I just wrote a script to automagically namespace (and denamespace) a grammar
ECMA regexen here we come 15:35
[Coke] you can get it back by assigning Nil, checking the variable's type (Then Numeric), but that isn't helpful 15:38
m: my Numeric $a; dd $a.WHAT; $a = 3; dd $a.WHAT; $a = Nil; dd $a;
camelia Numeric
Int
Numeric $a = Numeric
nine m: my Numeric $a; $a = 3; dd $a.VAR.of
camelia Numeric
[Coke] OF!
Thank you, nine!
nine Turns out, implementing a compiler frontend teaches you a _lot_ about a language
[Coke] docs.raku.org/type/Scalar#method_of 15:39
:)\
er, :)
nine I guess reading the docs would do the same :D
Arguably writing a compiler is more fun though ;)
abraxxa where is .of documented? I was looking the type tree up to docs.raku.org/type/Mu as I thought it must be defined there so every type has the method but can't find it 15:55
also I was expecting the methodname to be all uppercase like WHAT
[Coke]: ah, didn't grasp that your message was about my question, thanks 15:56
so not all types have a type restriction I can check using .of?
Array has .of but defined directly and not subclassed from somewhere upwards the class hierarchy 15:58
same for Hash
Rat is missing of! 16:00
ah, of is a method of Scalar which isn't a base class of Str, Int, ... but the thing the VAR method returns?! 16:02
which isn't documented ;-( 16:03
dutchie abraxxa: see docs.raku.org/language/containers
16:03 sena_kun joined
abraxxa or at least it's documented here docs.raku.org/language/mop#VAR but not in the type docs which is always the place I look at when I want to know what methods a type has 16:04
doesn't the container have the type constraint which dictates what it can hold? 16:05
dutchie exactly, that's the Scalar that .VAR accesses 16:06
abraxxa so for example a variable my $a = 'foo'; is of type Scalar, holds a, no idea what it's called, of type Str? 16:07
no, because then I would be able to call .of on the container object
container -> Scalar -> Str? 16:08
so three objects for a single var?
dutchie the container is the Scalar (by default with a constraint of Any), holding the Str
m: my $a = 'foo'; say $a.VAR.of; say $a.WHAT
camelia (Mu)
(Str)
dutchie oh, apparently Mu, not Any 16:09
abraxxa so why would I need to call .VAR on the Scalar to call one of its methods?
dutchie because normally the Scalar hides itself 16:10
abraxxa so $a is the Scalar which decontainerizes to the Str it holds for all method calls and if you want to get at the Scalar itself you'd need .VAR to get at it?
dutchie exactly
abraxxa Oh man!
every time I look at Raku I get turned down by the type system!
and I managed to grap and digest Typescript in just months
can you improve the docs so they contain EVERY method a type has? 16:12
16:35 mexen joined 16:37 abraxxa left 16:41 morte_ left
tonyo . 16:43
nine abraxxa: as far as I can tell thats already the case 16:57
tellable6 nine, I'll pass your message to abraxxa
17:01 dakkar left 17:03 eseyman joined 17:15 jaguart left
[Coke] Sorry, which method was missing from where? 17:16
Note that VAR isn't technically a method 17:23
17:31 jaguart joined
[Coke] points to docs.raku.org/language/typesystem#...thod_names 17:37
TIL about "is hidden" 17:42
m: class A is hidden { method m {say "eek"} }; class B is A { method m { nextsame }}; B.new.m 17:43
camelia ( no output )
18:06 reportable6 left 18:09 reportable6 joined 18:59 swaggboi left 19:06 xinming joined 19:07 xinming left 19:09 xinming joined 19:15 swaggboi joined 19:16 swaggboi joined
jjatria Ok, so this should let me implement SameSite: gitlab.com/jjatria/publicsuffix 19:32
20:16 evalable6 left, linkable6 left 20:17 evalable6 joined 20:18 linkable6 joined 20:24 morte_ joined 20:49 swaggboi left, Xliff joined
Xliff m: my %hash; role HashDefault[\T] { method AT-KEY (\k) { callwith(k) // T }; }; class C { }; %hash does HashDefault[C]; %hash<a> = 1; %hash<a>.say; %hash<b>.say; %hash.^name.say 20:54
camelia 1
(C)
Hash+{HashDefault[C]}
tellable6 2022-07-05T14:39:57Z #raku <dakkar> Xliff: github.com/LLFourn/p6-CompUnit-Uti...-exporting may help make your life easier
Xliff .tell dakkar Thanks
tellable6 Xliff, I'll pass your message to dakkar
Xliff Hash with a default value. Anybody see any obvious holes? 20:55
japhb m: my %hash is default(42); say %hash<foo> # Xliff 21:00
camelia 42
21:07 swaggboi joined 21:35 clarjon1 joined 21:51 Sgeo_ joined 21:54 Sgeo left 21:57 morte_ left 21:58 sena_kun left
Voldenet Xliff: there is one obvious hole 22:25
m: my %hash; role HashDefault[\T] { method AT-KEY (\k) { callwith(k) // T }; }; class C { }; %hash does HashDefault[C]; %hash<a> = Nil; %hash<a>.say; %hash<b>.say; %hash.^name.say
camelia (C)
(C)
Hash+{HashDefault[C]}
Voldenet m: my %hash; role HashDefault[\T] { method AT-KEY ($k, |) { self.EXISTS-KEY($k) ?? nextsame() !! T }; }; class C { }; %hash does HashDefault[C]; %hash<a> = Nil; %hash<a>.say; %hash<b>.say; %hash.^name.say 22:35
camelia (Any)
(C)
Hash+{HashDefault[C]}
Voldenet double lookup
but :p is also supported which is nice
m: my %hash; role HashDefault[\T] { method AT-KEY ($k, |) { self.EXISTS-KEY($k) ?? nextsame() !! T }; }; class C { }; %hash does HashDefault[C]; %hash<a> = Nil; %hash<a b>.say; %hash<a b>:p.say; %hash.^name.say 22:36
camelia ((Any) (C))
(a => (Any))
Hash+{HashDefault[C]}
Voldenet nevermind, :p works either way ┐(´~`;)┌ 22:37
22:40 Xliff_ joined 23:11 jaguart left 23:49 swaggboi left