🦋 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.
00:00 djerius left 00:03 djerius joined 00:06 reportable6 left 00:15 euandreh left 00:16 djerius left 00:18 djerius joined 00:31 lichtkind left, Yeuph joined 01:12 euandreh joined 01:30 patterner___ joined, SmokeMachine_ joined, pjlsergeant_ joined, samcv_ joined 01:32 [dpk] joined, simcop2387_ joined, elcaro_ joined 01:33 ky joined, m_athias_ joined, greaser|q joined 01:34 mykhal_ joined, solitario_ joined 01:35 vodkra joined, esh joined 01:36 Tirifto joined 01:38 Altreus_ joined 01:39 SmokeMachine left, pjlsergeant left, SmokeMachine_ is now known as SmokeMachine, pjlsergeant_ is now known as pjlsergeant, patterner__ left, Zero_Dogg left, elcaro left, epony left, vodkra_ left, andrea[m] left, Arathorn left, solitario left, mykhal left, ingy left, m_athias left, esh_ left, simcop2387 left, kybr left, GreaseMonkey left, samcv left, simcop2387_ is now known as simcop2387, Altreus left, dpk left, timo left 01:40 epony joined 01:42 ecocode left 01:43 m_athias_ is now known as m_athias 01:44 Zero_Dogg joined, ecocode joined 01:47 timo joined 01:48 ingy joined, andrea[m] joined 01:49 Arathorn joined 02:03 euandreh left 02:04 ky is now known as kybr 02:08 reportable6 joined 02:18 euandreh joined 02:28 seednode99 left 02:29 seednode99 joined 02:40 frost joined 02:45 greaser|q left, greaser|q joined 02:46 kjp left, greaser|q is now known as GreaseMonkey 03:09 kjp joined 03:10 Maxdamantus joined 03:12 Kaipi left, Merfont joined 03:16 Merfont left, Merfont joined
Maxdamantus Hmm .. this is a bug, right? 03:17
$ cat /dev/urandom | head -c 100000 | raku -e 'say slurp("/dev/stdin", :bin).elems;'
65536
Looking at strace, it does a read with size 1048576, and it stops reading if the returned size is less than that. 03:18
If it receives a full 1048576 bytes, it will do another read (potentially blocking), so seems like it's just assuming that it's a regular file or something. 03:19
03:36 perlbot left 03:37 simcop2387 left 04:37 reportable6 left, nativecallable6 left, greppable6 left, linkable6 left, shareable6 left, bisectable6 left, quotable6 left, committable6 left, coverable6 left, releasable6 left, statisfiable6 left, bloatable6 left, tellable6 left, squashable6 left, unicodable6 left, evalable6 left, benchable6 left, notable6 left, sourceable6 left, bloatable6 joined 04:38 nativecallable6 joined, sourceable6 joined, shareable6 joined, coverable6 joined 04:39 statisfiable6 joined, linkable6 joined, unicodable6 joined, bisectable6 joined 04:40 evalable6 joined, committable6 joined, greppable6 joined, reportable6 joined 05:01 swaggboi left 05:16 swaggboi joined 05:38 releasable6 joined 05:39 notable6 joined 05:46 simcop2387 joined 05:47 perlbot joined 06:08 reportable6 left 06:09 reportable6 joined 06:37 benchable6 joined
elcaro_ I made a Wordle clone with Raku just for fun... teaching my kids about spelling and programming in one go 07:15
gist.github.com/0racle/77fb3e50b6b...2188bb81d8
07:36 archenoth joined 07:38 Oshawott left 07:39 Oshawott joined, tellable6 joined 07:41 archenoth left 07:42 seednode99 left 07:43 seednode99 joined 07:56 [dpk] is now known as dpk 08:06 epony left 08:08 epony joined 08:11 discord-raku-bot left 08:12 discord-raku-bot joined 08:21 hasrthur joined 08:26 hasrthur left 08:38 squashable6 joined 08:41 lichtkind joined 08:47 jjido joined
MasterDuke nice 09:17
09:38 quotable6 joined 09:58 eseyman left 10:14 jjido left 10:21 hasrthur joined 10:51 frost left 10:53 Sgeo left
Voldenet Maxdamantus: maybe a workaround, but `cat /dev/urandom | head -c 100000 | raku -e 'say "/dev/stdin".IO.open(:bin).slurp.elems;'` works fine 11:22
makes me wonder why `slurp("/dev/stdin", :bin)` behaves differently 11:23
Maxdamantus Yeah, I noticed that. A bit more awkward though since you need to capture the handle to avoid leaking the file descriptor.
(Not very nice to just open a file and not close it) 11:24
11:31 jjido joined
Voldenet Well yes, but `sub my-slurp(IO() $path, :$bin) { my $p = $path.open(:$bin); LEAVE $p.close; $p.slurp };` also works without that bug 11:35
moon-child augment class Handle { method slurp { ... } } 11:37
:)
Voldenet I wish LEAVE worked like defer, btw 11:39
11:43 jjido left
Voldenet in fact, this would be super nice to use: say "/dev/stdin".IO.open(:bin).defer-with(*.close).slurp.elems; 11:43
moon-child you would an explicit '.done' or similar at the end 11:44
otherwise I think you could rig it so that you'd be able to write that as is
lizmat Supplier.slurp() takes a :close argument ? 11:45
actually IO.slurp takes a :bin
so maybe "/dev/stdin".IO.slurp(:bin).elems" should work ? 11:46
Voldenet > cat /dev/urandom | head -c 14120000 | raku -e 'say "/dev/stdin".IO.slurp(:bin).elems;' 11:47
i see nothing close to the number on the left
with .open(:bin) inbetween I do though
lizmat hmmm... that feels strange 11:58
12:07 reportable6 left
Voldenet github.com/rakudo/rakudo/blob/10c3...h.pm6#L574 12:21
…can't readfh return fewer bytes than expected? 12:22
lizmat as far as I know, yes, what you specify is the max number of bytes to receive 12:24
moon-child check EAGAIN or some such iirc
might be the problem
Voldenet eh, just instead of iseq_i(…, slurp-size) do isne_i(…, 0) 12:31
13:00 kjp left
Skarsnik I think I remember stdin/stdout being already available at async::io on start up, that maybe the issue? 13:00
13:08 reportable6 joined 13:11 jjido joined 13:12 kjp joined
Maxdamantus It's not specific to stdin. 13:18
$ raku -e 'say slurp(@*ARGS[0], :bin).elems;' <(head -c 100000 /dev/urandom)
65536
13:25 jjido left
gfldex lolibloggedalittle: gfldex.wordpress.com/2022/01/15/ma...-hypering/ 13:42
13:52 djerius left 13:53 djerius joined
cognominal 0+0i == 0 13:55
True
> 0+0i eq 0
False
>
Why ?
Skarsnik say 0i.Str 13:56
evalable6 0+0i
Skarsnik eq coerce into string 13:57
cognominal Yes but I would expect. === things to be coerced into eq things
13:58 Zero_Dogg left
Nemokosch what does that mean? 14:02
m: dd 0+0i === 0 14:05
Voldenet m: dd 0+0i === 0 14:06
camelia Bool::False
Voldenet 0+0i has different value identity than 0
Skarsnik say (0+0i).WHAT 14:07
evalable6 (Complex)
Nemokosch okay, so 0+0i and 0 are NOT "=== things" in the first place
and from this point, there is nothing really surprising
string representation is more verbose than numeric representation 14:08
Voldenet say 0+0i + 1 === 1+0i 14:09
evalable6 True
Voldenet say 0+0i === 0.Complex 14:10
evalable6 True
14:13 dextercd joined
cognominal Nine said the same thing in #raku-dev.. Thx everyone. I got rusty even if I have trouble with rust 14:14
Voldenet counterintuitively you'll never get rusty if you code in rust frequently ;) 14:20
15:13 evalable6 left, linkable6 left 15:32 Henry151 left 16:15 evalable6 joined 16:31 seednode99 left 16:33 seednode99 joined 17:24 lichtkind left 18:08 reportable6 left 18:10 Util_ left 18:11 reportable6 joined 18:15 linkable6 joined 18:28 euandreh left 18:36 ingy left, ingy joined 18:44 mexen left, Sgeo joined 19:44 euandreh joined 19:58 Merfont left, Kaiepi joined 20:03 qorg11 left 20:05 qorg11 joined 20:22 Kaiepi left, Kaiepi joined 20:31 lichtkind joined 20:33 clarjon1 joined 20:35 stanrifkin joined
stanrifkin how i enter 200 in roman numerals? 20:35
â…­â…­
i copied that from unicode-table.com
one â…­ works but two of them not.
when i quite them "â…­â…­" it just print â…­â…­ 20:36
and "â…­â…­" + 0x200 is says it can't convert to number 20:37
but â…­ + 0x200 works fine
japhb Looking for Slang::Roman or Math::Roman maybe? 20:38
stanrifkin haven't looked into that
thought raku can do it native
[Coke] check the unicode properties on those characters. There's a difference between numbers/numerals, if I recall. 20:49
stanrifkin eval: â…­ + 0x200
evalable6 WARNINGS for /tmp/J1HIEdYGmN:
Useless use of "+" in expression "â…­ + 0x200" in sink context (line 1)
stanrifkin hm...
[Coke] you need to output it. 20:50
stanrifkin eval: say â…­ + 0x200
evalable6 612
stanrifkin eval: say â…­â…­ + 0x200
evalable6 (exit code 1) 4===SORRY!4=== Er…
stanrifkin, Full output: gist.github.com/d6925d556caf3815e6...d5e89037e1
stanrifkin Slang::Roman works. But not in the Repl. 21:07
21:35 evalable6 left, linkable6 left 21:48 stanrifkin left 22:26 Kaiepi left, Kaiepi joined 22:49 hasrthur left 23:08 lichtkind left 23:14 xinming left 23:23 eseyman joined 23:27 jjido joined 23:34 epony left 23:36 evalable6 joined