🦋 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 inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
SmokeMachine kawaii_: say [42] ~~ Array[Int] 00:57
m: say [42] ~~ Array[Int]
camelia False
kawaii_ Ah I see, yes :) 00:58
Juerd m: subset IntArray of Array where .all ~~ Int; say [42] ~~ IntArray; 01:02
camelia True
atweiden_air- why does one file lib/A.rakumod containing `role A['a'] {}; role A['b'];` pose no issue with downstream usage whereas splitting this file into lib/Aa.rakumod containing `unit role A['a'] {}` and lib/Ab.rakumod containing `unit role A['b'] {}` throw P6M Merging GLOBAL symbols failed: duplicate definition of symbol Replace 01:11
s/Replace/A 01:12
golfed github.com/atweiden/golf 01:26
atweiden_air- Is the only workaround not parameterizing the unit roles? 01:46
atweiden_air- solved github.com/atweiden/golf/commit/5c...9c3b3f1162 04:40
Geth doc: 9930cf5d20 | (Patrick Böker)++ (committed using GitHub Web editor) | doc/Language/modules.pod6
Give the more obvious answer to "Where are bin/ scipts installed?" (#4046)
05:30
patrickb melezhik: I think one possible route is to move over to DB::MySQL which maintains a connection pool. 08:23
Altreus japhb: meh, this is for me, and the maths is easier if the week starts at 1 09:12
And the maths was weirdly not very easy
Altreus Where are raku's own options documented? Equivalent of perldoc perlrun? 13:12
I tried rakurun :D
lizmat raku --help ? 13:17
Altreus o, I tried man raku and gave up :D
forgot about basic functions -_-
in repeat/while, can the condition see variables lexical to the repeat block? 13:39
lizmat I think so? 13:40
Altreus TIAS
ugexe m: while my $x = 42 { last; }; say $x
camelia 42
ugexe oops i guess thats the exact opposite 13:41
Altreus m: repeat { my $x = 42 } while $x > 50;
camelia ===SORRY!=== Error while compiling <tmp>
Variable '$x' is not declared. Perhaps you forgot a 'sub' if this was
intended to be part of a signature?
at <tmp>:1
------> repeat { my $x = 42 } while ⏏$x > 50;
Altreus :(
leaky scope
that's OK, the outer scope is small here
Altreus Hmm, the .? methodop doesn't work if it's an attribute on a type object 14:09
lizmat example? 14:13
Altreus m: DateTime.?day 14:16
camelia Cannot look up attributes in a DateTime type object. Did you forget a '.new'?
in block <unit> at <tmp> line 1
Altreus m: Nil.?day
camelia ( no output )
Altreus Seems like "I would have this if I were instantiated" overrides "maybe you don't have this" 14:17
lizmat m: DateTime.day
camelia Cannot look up attributes in a DateTime type object. Did you forget a '.new'?
in block <unit> at <tmp> line 1
lizmat m: class A { has $.a }; A.a 14:19
camelia Cannot look up attributes in a A type object. Did you forget a '.new'?
in method a at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat the underlying issue, to an extent
not sure why the accessor is not generated with a :D check on the invocant
m: class A { has $.a }; dd A.^find_method("a") # hmmm... the signature says it is? 14:20
camelia Method a = method a (A:D: *%_) { #`(Method|5973966464984) ... }
lizmat m: class A { has $.a; method a(A:D:) { 42 } }; dd A.a # signature does not match reality 14:21
camelia Invocant of method 'a' must be an object instance of type 'A', not a
type object of type 'A'. Did you forget a '.new'?
in method a at <tmp> line 1
in block <unit> at <tmp> line 1
stanrifkin is there something similar to perl's Math::Prime::Util in raku? 14:57
lizmat not that I know of 14:59
shouldn't be too hard to port metacpan.org/pod/Math::Prime::Util::PP to Raku :-) 15:00
especially since a lot of the bigint / bigfloat handling is built into Raku :-) 15:01
stanrifkin lizmat: but not gmp or?
lizmat: can't i simply use that perl module in raku? never done that 15:02
lizmat possibly... there's even a MoarVM branch to use libgmp internally, which would make things even simpler
stanrifkin: that you can do also: raku.land/cpan:NINE/Inline::Perl5
lizmat
.oO( another plan thwarted to get a module ported :-)
15:03
stanrifkin get an error when installing Inline::Perl5 15:16
relocation R_X86_64_PC32 against symbol `PL_opargs' can not be used when making a shared object; recompile with -fPIC 15:17
something wrong with the newest perl5.34.1 and raku distributions?
i use perlbrew and it seems that the archive libperl.a is not compiled with -fPIC 15:18
drakonis github.com/rakudo/rakudo/issues/4835 huh well. 15:23
stanrifkin nothing to do with tail call optimization. I didn't realize raku doesn't have that. 15:25
ok perl has no TCO either... i see 15:26
lizmat still fails to understand why some people seem to dismiss a language because it does not appear to have tail call optimizations 15:27
whereas Raku has a more general automatic inlining of hot code
ugexe i wonder how many people who proclaim such a desire for TCO have actually blown a stack before 15:29
dont get me wrong, having TCO would be awesome
stanrifkin lizmat: some problems are recursive naturally and hard or not possible iterative. but that doesn't mean someone "dismiss" a language because of the lack of TCO 15:31
Altreus Is this normal? In month-as-table, if I do it this way, all weeks are the same; presumably the assignment to @week is done by reference and the @month array therefore gets changed --> gist.github.com/Altreus/8d797886a3...8d6719c899 15:32
El_Che doesn't perl stops you at 100 recursive loop?
stanrifkin lizmat: but when i think about it. TCO possible problems should be no recursive either.
Altreus But if I use gather/take, it works as expected (gist updated) 15:33
I didn't expect any reference behaviour here at all
ugexe did you mean to use append? 15:34
i guess not
Altreus no I want an AoA
I mean, I do prefer gather/take!
drakonis oops, i derailed the topic 15:37
i've seen someone dismiss raku over no tco 15:38
stanrifkin drakonis: and used instead?
drakonis hmm, this person used python at the time 15:39
which doesn't have tco either
stanrifkin darkonis: says it all :) 15:40
ugexe I wanted atomics in raku, so I paid someone to implement them
drakonis hmm, time to pay someone for tco
ugexe exactly >:)
[Coke] I would chip in a few bucks for that. (if anyone has a plan, could submit a grant to YAS also) 15:43
drakonis YAS? 15:44
[Coke] www.perlfoundation.org/ 15:45
I was avoiding the "perl" name variant, but it's the one most people know.
[Coke] e.g. news.perlfoundation.org/post/grant...march_2022 15:46
drakonis oh i see 16:00
stanrifkin someone have got an working Inline::Perl5 module? 16:09
stanrifkin got it working with the default installed perl but not with the newest perlbrew perl-5.34.1 16:13
Altreus japhb: I made this; dunno if it helps you any gist.github.com/Altreus/17359580fb...2e05741324 16:14
japhb Altreus: Thank you. 16:29
jdv anarchy in the uk? 16:45
wrong chan:( 16:46
Altreus wrong japh 16:47
melezhik . 16:56
Hi. let me know if someone is interested in trying out sparkyci 16:57
Altreus qué 16:59
Altreus Now I just need to figure out how to output that table in such a way that I can put fields next to each date and navigate to those fields in the terminal! 17:06
Maybe Terminal::UI 17:08
stanrifkin Altreus: and output it to an CVS file? Terminal only? 17:28
Altreus Currently I'm just outputting the result to the terminal... With Terminal::UI, I could feasibly just output it to another pane 17:29
p6steve lichtkind: I see this lichtkind.de/vortrag but not the Plotten mit raku deck - kanst du bitte mitteilen? 18:44
lichtkind p6steve: yes it developed into pure perl talk partially becasue the big modules on rakku org are wrapper for same libs but most of talk is dataprep theory math and design anyway 18:52
and becasue raku is missing some the math i needed
which is in smaller part my fault 18:53
stanrifkin lichtkind: do you use this kephra editor? 18:53
lichtkind im the author but i use it too
stanrifkin nice website. i'll take a look at these wx tutorials. 18:55
lichtkind you mean lichtkind.de? 18:56
stanrifkin yes
lichtkind its like a buisnesscard :) not much design, but thanks for compliment 18:57
stanrifkin content matters right?
lichtkind exactly 18:58
stanrifkin did some c++ wxwidget stuff. but experimenting things out with perl seems like a good idea. can than implement it later in c++. 19:00
lichtkind then you look into xrc
you c++ app loads same xrc file and looks same
also helps with i18n
stanrifkin ok i see. 19:01
melezhik . 19:09
lucs Hmm... Took me a while to figure out: 20:51
for ^42 { foo(); bar(); } # foo() is evaluated in sink context, but bar() is not, not sure why...
Nemokosch is it the last statement of your function? 20:58
idk how exactly it works but bar() is not in sink context probably because it's the last statement in some scope
therefore its return value is propagated
lucs Yeah, that's kind of what I suspected, but I'm not sure where exactly the value is propagated to. 20:59
lucs (It doesn't sink when it's the last statement in the block here.) 21:01
melezhik patrickb I've created a prototype for sparkyci - sparrowhub.io:2222 so you can check it out and see the idea - please let me know if you have any thoughts ... 21:03
I think what else besides test coverage would be interesting to add as CI part for a regular Raku project?
maybe license checks? not sure 🤔 if it fits opensource projects requirements ... 21:04
another though - check pod syntax linter , but maybe not everyone uses pod now, many docs - just markdown ... 21:05
code security vulnerabilities checks?
lucs Yucky, but I can make sure bar() gets evaluated in sink context (because it may generate a Failure whose exception I want to be thrown) by doing: 21:17
for ^42 { foo(); bar(); next; }
guifa you can also force sink context by just prefixing with sink
for ^42 { foo(); sink bar(); }
lucs Aha! I knew there must have been a better way :)
Thanks. 21:18
patrickb melezhik: This looks really nice. 21:33
melezhik: I'd focus on usability.
Getting it up and running as simple as possible. 21:34
GitHub / GitLab / SourceHut integration.
Simple configuration
patrickb is off to bed now.
gfldex m: my $result = do for ^1 { 42 }; dd $result; 22:45
camelia List $result = $(42,)
lucs gfldex: Ah, gotcha, thanks. 23:50
moon-child m: my $x = gather for ^1 { take 42 }; dd $x 23:51
camelia Seq $x = $((42,).Seq)
moon-child m: my $x = eager gather for ^1 { take 42 }; dd $x 23:52
camelia List $x = $(42,)