Raku Conference Day 2 on Youtube: www.youtube.com/watch?v=BL9-XdC9WYI 🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). 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 14 August 2022.
00:00 evalable6 joined 00:06 reportable6 left 00:07 reportable6 joined 00:15 nopy left
Nemokosch well, it is "normal", yes 00:17
00:52 RandalSchwartz joined
[Coke] if you have a large script, move it to a module and 'use' it from the main script. then you get precompilation speedups on future runs. 00:53
00:54 Nemokosch left 01:02 RandalSchwartz left 01:11 bigdata joined 01:14 frost joined 02:01 razetime joined 02:34 Heptite joined 03:34 linkable6 left, evalable6 left, quotable6 left, greppable6 left, squashable6 left, unicodable6 left, tellable6 left, notable6 left, bisectable6 left, coverable6 left, statisfiable6 left, bloatable6 left, releasable6 left, benchable6 left, reportable6 left, sourceable6 left, committable6 left, nativecallable6 left, shareable6 left, releasable6 joined, statisfiable6 joined 03:35 quotable6 joined, tellable6 joined 03:36 unicodable6 joined, bisectable6 joined, evalable6 joined, committable6 joined, reportable6 joined, greppable6 joined, nativecallable6 joined 03:37 bloatable6 joined, squashable6 joined, notable6 joined, benchable6 joined, linkable6 joined, coverable6 joined, sourceable6 joined, shareable6 joined 03:49 Heptite left 04:38 razetime left 04:39 razetime joined 04:56 axmed left, axmed joined 05:15 razetime left 05:16 razetime joined 05:40 paddymahoney2 joined 05:44 paddymahoney2 left 06:07 reportable6 left 06:09 reportable6 joined 06:38 razetime left, razetime_ joined 06:58 nebuchadnezzar joined 07:09 abraxxa joined 07:14 abraxxa left, Sgeo left 07:16 abraxxa joined 07:19 grondilu joined 07:20 abraxxa left 07:21 abraxxa joined, mexen_ joined 07:22 jargan joined, jast left 07:27 mexen_ left 07:28 dg left
grondilu Hi all. 07:38
tellable6 2022-09-03T14:17:28Z #raku <guifa> grondilu: best you can do is
grondilu I have a module C<unit module Foo; constant $foo = [ -> {} ]; $foo()> which executes fine but fails when used : "No lexical found with name '$_'" 07:40
that Foo example is just a golfed version of what I had initially when I encountered this. 07:41
m: module Foo { constant $foo = [ -> {} ]; $foo(); }; import Foo; 07:42
camelia No such method 'CALL-ME' for invocant of type 'Array'
in block <unit> at <tmp> line 1
grondilu m: module Foo { constant $foo = -> {}; $foo(); }; import Foo;
camelia ( no output )
grondilu oh sorry I copied it wrong 07:43
the module is C<unit module Foo; constant $foo = -> {}; $foo()>
not sure if I can reproduce the error in a one-liner 07:44
07:48 sena_kun joined 07:58 razetime_ left
Nemokosch so... what is the code? 😅 07:59
07:59 razetime joined 08:08 dg joined
Geth ecosystem: 5515f5be2e | (Elizabeth Mattijsen)++ | META.list
Remove 3 of Brian Duggan's modules that also live in CPAN

To prevent double mentions in raku.land
08:33
09:08 evalable6 left, linkable6 left 09:09 linkable6 joined 09:10 evalable6 joined
grondilu the code is just 'use Foo' 09:11
or -MFoo
anyway, on an other note, I was supposed to get the first 64 bits of the fractional part of sqrt(2) and it seems raku truncated it 09:15
m: put (($_ - .Int)*2**64).Int.fmt("%0x") given sqrt 2 09:17
camelia 6a09e667f3bcd000
grondilu correct result is 6a09e667f3bcc908
Nemokosch isn't that too much for an IEEE 754 floating point number?
I don't know but wouldn't be surprised
I mean doesn't matter what you are doing if you lose precision on sqrt 2 itself
grondilu probably yes
isn't there a way to do better than IEEE754 here? 09:18
lizmat FatRat ?
grondilu sqrt 2 is not a rational 09:19
Nemokosch but you can only approximate it either way
grondilu isn't there a FatNum or something lol?
isn't there a FatNum or something lol? 09:20
Nemokosch Raku is not a numeric platform to deal with formulae
so everything _is_ rational one way or another, right?
and if you want accurate digits, it cannot be a bad idea to use rationals 09:21
grondilu I suppose I could tweak the equation to look for an integer 09:23
(2**64 + x)**2 == 2**128 or something?
lizmat grondilu: ah duh, yeah :-) 09:24
grondilu bad formula here, x = 0 lol 09:25
something similar should work though
Nemokosch anyway, why does 2.FatRat.sqrt give a Num?
doesn't seem too friendly
"Where a Rat degrades to a Num, math with a FatRat keeps chugging along:" says the docs 09:26
then why does it turn back into a Num
grondilu I think I would need the integer algorithm for sqrt anyway 09:32
m: say sqrt(1 + 2**64)
camelia 4294967296
grondilu 🤔
m: say sqrt(1 + 2**128) 09:33
camelia 1.8446744073709552e+19
grondilu yeah that's what I thought, there is no multi candidate for large integers
Nemokosch sqrt exists on Cool and Numeric so in theory that shouldn't be a problem 09:36
but does the implementation actually preserve all that data....
09:36 sena_kun left
grondilu integer square root is a thing en.wikipedia.org/wiki/Integer_square_root 09:37
I'm surprised it's not in Raku's core
not complaining, just noticing
lizmat grondilu: there's your chance to gain immortality :-) 09:41
Nemokosch well tbh this seems niche enough for a "general-purpose programming language" 09:42
I'm more concerned about what I was pointing out
.sqrt shouldn't collapse a FatRat into a Num
and very apparently this is what happens
Nahita it took ~28 years for Python to add `math.isqrt`
Nemokosch again, implying that it wouldn't rather belong to some numerical calculations package 09:44
or if we really insist that FatRat is a "true rational" and shouldn't be used for approximations, then at least there should really be a FatNum
some arbitrary precision type that doesn't collapse into Num when sqrt is used
grondilu m: gist.github.com/grondilu/72daaea1a...5d29ce6fee 09:55
camelia 6a09e667f3bcc908
grondilu quite involved, but will do 09:56
lizmat feels like a module :-)
grondilu it's in rosetta code 10:00
btw I can't log in rc anymore since the update, kind of annoying 10:01
10:09 sena_kun joined
Xliff m: '🤔'.uniname.say 10:17
camelia THINKING FACE
Xliff m: '🤔'.unichar.say
camelia No such method 'unichar' for invocant of type 'Str'
in block <unit> at <tmp> line 1
Xliff m: '🤔'.chr.say
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏🤔' (indicated by ⏏)
in block <unit> at <tmp> line 1
Xliff m: '🤔'.ord.say
camelia 129300
10:44 a3r0 left, gfldex left, jmcgnh left, swaggboi left, simcop2387 left, vasko left, nine left, tailgate left, El_Che left, avar left, leah2 left 10:49 a3r0 joined, gfldex joined, jmcgnh joined, swaggboi joined, simcop2387 joined, vasko joined, nine joined, tailgate joined, avar joined, El_Che joined, leah2 joined 10:54 Xliff left 10:55 grondilu left 11:30 razetime left 11:31 razetime joined 11:40 jargan is now known as jast 12:09 reportable6 left 12:10 reportable6 joined 12:31 frost left 12:35 Kaiepi left 12:36 Kaiepi joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/09/05/2022-...-in-at-50/ 13:25
guifa lizmat++ 13:28
13:36 linkable6 left, evalable6 left, evalable6 joined 13:37 linkable6 joined 13:58 Heptite joined
Nemokosch being on the IEEE list _at all_ is a good sign in my opinion 14:15
lizmat my thoughts exactly :-) 14:16
Nemokosch it can get things started, like one can show it around, "see it's that language I'm using, not something esoteric joke" 14:17
it can get things started, like one can show it around, "see it's that language I'm using, not some esoteric joke"
the current "did you know" even works with .= 14:22
lizmat sure, but I wanted to keep it one feature at a time :-) 14:25
that's laziness for you :-)
nothing happens until something actually needs the values
in this case, it's the "say" command
Nemokosch I SAID .= WORKS FOR THAT EXAMPLE 14:43
^is that what you mean? 🤣
I just used the say command 14:44
lizmat yes, and that's what's causing the Seq to actually be executed 14:46
14:58 linkable6 left, evalable6 left, evalable6 joined, linkable6 joined 15:19 perlbot left, simcop2387 left 15:44 simcop2387 joined 15:45 perlbot joined
Nemokosch Apparently I don't get how rak works 16:14
I have HTML files in a folder, generated by HTML::Tag - the whole file is one humonguous line 16:15
I wanted to see where the images are
I did `grep "img src" *` but obviously it would just give me whole, megabyte-sized files
I did `rak "img src"` and it did nothing
I thought it would at least find the files as grep did, perhaps produce a more manageable output even 16:16
but it produced no output whatsoever 16:17
16:21 perlbot left, simcop2387 left
when I added `--extensions=html`, it did work 16:24
so there must be something I'm missing
16:25 bigdata left 16:34 abraxxa left 16:44 simcop2387 joined 16:45 justache- joined, perlbot joined 16:46 justache left 17:17 sena_kun left
lizmat Nemokosch: no, it's me who missed adding .htm and .html in a #html group 17:28
tellable6 lizmat, I'll pass your message to Nemokosch
lizmat it will be in the next release 17:33
p6steve on extended precision topic, I have added Raku here en.wikipedia.org/wiki/Arbitrary-pr...plications 17:41
17:43 Sgeo joined
also ... I think it is a fair design decision to NOT attempt integer sqrt, but to degrade to Num for both Int and FatRat ... otherwise we (i.e. you) will be building a new tower of ln, log, sin, cos, tan... libraries 17:44
since all of these produce irrational numbers
17:49 razetime left, sena_kun joined 17:53 melezhik joined
melezhik how one can configure rakudo to search packages in alternative locations? 17:53
gist.github.com/melezhik/29ad03155...4224358d92 17:56
I am trying to build alpine packages for rakudo installed into /opt/rakudo-pkg/ prefix
app does not allow to build packages into `/opt` path 17:57
so here is my problem, how can I make rakudo installed into `/opt/rakudo-pkg/` prefix look up packages installed into `/usr/` prefix ?
which is legit prefix for alpine packages ... 17:58
lizmat El_Che might know 18:04
melezhik thanks!
18:06 reportable6 left 18:08 reportable6 joined
El_Che as far as a know is /opt valid in linux and unix 18:14
/usr besides /usr/local is mostly reserved for the OS itself 18:15
If by packages you mean libraries? env RAKUDOLIB? or add it at build time?
melezhik El_Che I mean this - github.com/alpinelinux/abuild/blob...ld.in#L761 18:19
ugexe m: role Foo { method bar { ... } }; class MyClass { has Foo $.foo; }; my $c = MyClass.new; say $c.foo; say $c.foo.?bar 18:21
camelia (Foo)
Method 'bar' must be implemented by Foo because it is required by roles: Foo.
in block <unit> at <tmp> line 1
ugexe does that make sense?
melezhik gist.github.com/melezhik/4a8ec17d5...abuild-L29 and this
ugexe i assume its called the stubbed bar method, but i really want .?bar to only call bar if an implementation exists 18:22
melezhik if one tries to build an alpine package for Raku module using standard "$pkgdir" path they sendup having package files into `/usr` prefix, so rakudo installed  into `/opt/rakudo-pkg` prefix won't see them 18:23
obvious way to overcome that is to use `$pkgdir"/opt/rakudo-pkg/` for install-dist.raku however it results in the mentioned error when trying to build a package using `abuild -r` 18:24
please see this - gist.github.com/melezhik/4a8ec17d5...nt-4290938 18:25
18:31 epony left 18:33 epony joined
El_Che melezhik: so the solution would be adding /usr/local/raku (or something) to the search path of rakudo-pkg? (security consideration aside for a moment) 18:34
?
18:35 n1to joined
melezhik yeah, so as I started my question from the very beginning I would like say to build alpine packages for Raku modules for rakudo distribution shipped into `/opt/rakudo-pkg` and looks like alpine only allows me to ship packages into `/usr` prefix not `/opt/rakudo-pkg` , so look like we need to be able to configure `rakudo-pkg` to see packages in 18:36
`/usr` path
by configuring a `rakudo-pkg` I mean any way to achieve this , maybe via some env var? 18:37
El_Che if you're setting env vars, you can set RAKUDOLIB? 18:40
melezhik yes, I guessed that , however I just wanted to clarify here, maybe there is a better approach ?
El_Che wel, i am doubtful 18:41
if you create packages of libs, I think it makes sense to link to the system rakudo 18:42
I mean distributable packages not private ones
if you want to create packages for lib that use rakudo-pkg I would put that in /usr/local and set the environment 18:44
or use another tooling that does to impose that check
(I use github.com/goreleaser/nfpm)
melezhik yeah, make a sense, the reason I try to build for the distribution supported by you is that official alpine distribution gets stuck in old versions 18:45
El_Che melezhik: I was under the impression they had recent releases, maybe is my info outdated
melezhik let me check real quick 18:46
so - pkgs.alpinelinux.org/package/edge/...4le/rakudo 2022.06 - so not that bad
in that case maybe I'd continue my journey with official alpine rakudo distro 18:47
El_Che yes, that sounds sane to me
melezhik anyway - thanks!
El_Che np 18:48
19:09 sena_kun left 19:11 melezhik left, sena_kun joined 19:29 MoC joined 19:36 squashable6 left 19:38 squashable6 joined
gfldex lolibloggedalittle: PWC SPOILER ALERT! gfldex.wordpress.com/2022/09/05/va...peratures/ 20:22
20:38 linkable6 left, evalable6 left 20:39 linkable6 joined 20:41 evalable6 joined, sena_kun left 20:46 justache- is now known as justache 20:49 sena_kun joined, sena_kun left 20:52 xinming left 20:53 xinming joined 21:27 MoC left 22:04 n1to left 23:04 sourceable6 left, coverable6 left, statisfiable6 left, nativecallable6 left, unicodable6 left, benchable6 left, quotable6 left, linkable6 left, evalable6 left, greppable6 left, squashable6 left, releasable6 left, tellable6 left, committable6 left, bisectable6 left, releasable6 joined 23:05 linkable6 joined, benchable6 joined, quotable6 joined, squashable6 joined, sourceable6 joined, statisfiable6 joined 23:06 nativecallable6 joined, bisectable6 joined, tellable6 joined, coverable6 joined, greppable6 joined, unicodable6 joined 23:07 committable6 joined, evalable6 joined 23:57 squashable6 left 23:59 squashable6 joined