🦋 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.
moon-child hmm, why can't you atomic-fetch, atomic-assign, or cas non-ints? 00:02
00:02 reportable6 left
patrickb moon-child: The atomic ops are directly wired to a hardware functionality of the CPU, and that requires ints to work. 00:03
00:04 reportable6 joined
moon-child patrickb: you can atomically store, load, or cas any word. The CPU doesn't care if that word represents a pointer or an integer at the language level 00:04
ugexe yeah a MWSR using atomic int or cas was my initial thought 00:05
patrickb moon-child: What other native word size things do you have in mind that atomic ops would be useful on? 00:06
moon-child patrickb: raku objects have identity; and they are boxed, so they are represented by a pointer, that is a word 00:07
patrickb What semantic should modifying an object pointer in Raku have? 00:09
moon-child same as assignment... 00:12
ugexe github.com/Raku/roast/blob/dffc2a4....t#L22-L24
moon-child ah, that works! Docs are out of date 00:13
00:14 lizmat_ joined 00:18 lizmat left
ugexe github.com/jnthn/p6-concurrent-sta.../Stack.pm6 is also a good example 00:23
patrickb I'm off to bed. Thanks so far for everyone having a look. I'll backlog tomorrow, so please write, should you have another idea / comment. 00:32
moon-child night! 00:33
00:34 patrickb left 00:40 tejr left, tejr joined 01:15 Colt left, Colt joined
moon-child m: sub f (--> Int) {}; say f 01:16
camelia Nil
moon-child why?
01:24 frost joined
[Coke] you didn't return anything, so Nil? 01:29
m: sub f() {} ; say f
camelia Nil
moon-child but I specified that the result should be an Int. So I would expect either an error or an Int type object 01:30
[Coke] Yes. Nil is special.
m: sub f(-->Int) {"hi"} ; say f
camelia Type check failed for return value; expected Int but got Str ("hi")
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
[Coke] docs.raku.org/type/Nil 01:31
"The value Nil may be used to fill a spot where a value would normally go, and in so doing, explicitly indicate that no value is present."
the first few paragraphs cover your question, I think. 01:32
esp: "Along with Failure, Nil and its subclasses may always be returned from a routine even when the routine specifies a particular return type. "
moon-child ahh, ok! 01:35
[Coke] m: Nil.is.a.special.value.say 01:43
camelia Nil
lucs This looks a bit complicated, can it be simplified?: 02:13
m: my $t = DateTime.now; my $s = $t.second; note $t.posix + ($s - $s.truncate) 02:14
camelia 1637201640.9526284
moon-child hmm, I could have sworn there was a function called 'frac' or some such to replace $s - $s.truncate, but apparently not 02:21
02:24 linkable6 left, evalable6 left 02:27 linkable6 joined
lucs Oh, rereading the DateTime doc page, there is an Instant method that does it right off the bat 02:32
m: note DateTime.now.Instant;
camelia Instant:1637202801.88565274
lucs *phew* 02:33
m: note DateTime.now.Instant.Num 02:36
camelia 1637203042.7485209
moon-child m: say now.Num 02:39
camelia 1637203182.772122
lucs Fair enough :) 02:45
moon-child :) 02:46
lucs I love this language. 02:47
03:27 evalable6 joined 03:33 bruceAxtens joined
bruceAxtens > 'ACTU'.split("").Array.map(-> $v { $v.ord }) gives me (Nil 65 67 84 85 Nil) 03:43
Where are the Nil values coming from and how do I not get them
03:45 RavingCodRoller joined 03:47 bruceAxtens left
kjp There is "nothing" before the "A", so the string is split there, giving the first Nil, and similarly at the end. 04:02
Generally in raku, if you want to specify what you want to keep, then use comb rather than split, so something like 'ACTU'.comb('.') would do. 04:03
m: 'ACTU'.comb('.') 04:04
camelia ( no output )
Xliff m: 'ACTU'.comb('.').gist.say
camelia ()
kjp m: 'ACTU'.comb('.').say
camelia ()
Xliff m: 'ACTU'.comb(/./).gist.say
camelia (A C T U)
kjp m: 'ACTU'.comb(/./).say
camelia (A C T U)
elcaro the `/./` is not necessary if you just want chars 04:29
m: say 'ACTU'.comb
camelia (A C T U)
elcaro m: say 'ACTU'.comb».ord
camelia (65 67 84 85)
elcaro m: say 'ACTU'.ords # or just this if you want ords 04:30
camelia (65 67 84 85)
04:36 RavingCodRoller left
Xliff Anyone interesetd in TUS? 05:08
05:15 RavingCodRoller joined 05:33 RavingCodRoller left 05:42 Xliff left 05:43 swaggboi left 05:52 Xliff joined 05:56 swaggboi joined 06:02 reportable6 left 06:04 djerius left, djerius joined 06:28 Xliff left, Xliff_ joined 07:23 parv joined 07:27 seednode left 07:28 seednode joined 07:32 Manifest0 left 07:40 abraxxa joined 07:45 abraxxa left, abraxxa joined 08:04 reportable6 joined 08:44 Sgeo left 09:05 jrjsmrtn left 09:08 jrjsmrtn joined 09:22 parv left 09:32 RakuIRCLogger left, Geth left 09:33 Geth joined, lizmat_ left, lizmat joined 09:35 abraxxa left 09:55 abraxxa joined 10:10 squashable6 left 10:47 Manifest0 joined 10:49 Manifest0 left 10:50 Manifest0 joined 10:53 Manifest0 left 11:13 squashable6 joined
tbrowder m: my $doy=132;my $y=2021;my $t=Date.new(:year($y).later(:days($doy-1);say $t.day-of-year 11:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use variable $t in declaration to initialize itself
at <tmp>:1
------> 3.new(:year($y).later(:days($doy-1);say $7⏏5t.day-of-year
expecting any of:
argument list
tbrowder m: my $d=25;my $y=2021;my $t = Date.new(:year($y)).later(:days($d-1));say $t.day-of-year 11:24
camelia 25
tbrowder .tell lizmat i'm not sure Date.new from year, year-day is justifiable ^^^ 11:26
tellable6 tbrowder, I'll pass your message to lizmat
lizmat tbrowder: yes, I was aware of that, and it's even simpler (code wise) 11:45
tellable6 2021-11-18T11:26:37Z #raku <tbrowder> lizmat i'm not sure Date.new from year, year-day is justifiable ^^^
lizmat m: dd Date.new(:year(2021)) - 1 + 45 # the 45th day of the year 2021
camelia Date.new(2021,2,14)
11:51 hi joined, hi left 12:02 reportable6 left 12:03 reportable6 joined
lizmat m: sub yearday($year, $day) { Date.new($year - 1, 12,31) + $day } # tbrowder probably the most efficient 12:08
camelia ( no output )
12:12 discord-raku-bot left 12:13 discord-raku-bot joined 12:17 frost left
lizmat meh, still 18 submissions to go for the Advent Calendar: github.com/Raku/advent/blob/master...authors.md 12:59
13:17 evalable6 left, linkable6 left 13:19 evalable6 joined 13:20 linkable6 joined 13:25 Manifest0 joined
lizmat PSA: logs.liz.nl now running on refactored IRC::Log and many other improvements, using less CPU and less memory 13:30
now on to using Cro 0.8.7 :-) 13:32
13:43 Colt left 13:48 gordonfish- joined 13:49 gordonfish left
tib The ephemeral miniconf is going LIVE NOW: us02web.zoom.us/j/81869065466?pwd=...dPaTFuZz09 13:51
13:52 MoC joined
MasterDuke oh, i thought i would be able to attend, but turns out i have a bunch of stuff already scheduled. will the presentations be recorded? 13:54
tib JJ Merelo speaking right now 14:16
MasterDuke yes but not all
14:17 MoC left
Nemokosch is JJ Merelo Spanish? 14:20
MasterDuke yes 14:21
Nemokosch Nice 😄 14:23
[Coke] m: dd "ABCD".split('', :skip-empty) 14:31
camelia ("A", "B", "C", "D").Seq
[Coke] .comb is usually better for this use case, but you can use split. 14:32
14:54 ProperN[out] joined
RaycatWhoDat When making a grammar, what is the correct way to look for delimited block if the delimiters are on separate lines? 14:54
14:57 ProperN[out] left, ProperN[out] joined, ProperN[out] is now known as ProperNoun 15:06 jess joined
tbrowder lizmat: thnx, i didn't know Date could be incremented like that. i think i was confusing incrementing DateTime by duration of seconds. yr method is very handy. 15:18
15:25 sm2 joined 15:36 patrickb joined
tib (I will run a very small Raku quiz after jjatria QAs at the ephemeral mininconf) 15:39
15:53 gordonfish- is now known as gordonfish
tib (sjn won) 15:55
El_Che sjn, damn that guy, he's just too nice ;) 16:12
sjn pfft 16:14
I won because Kahoot is a made by a Norwegian country, so I get a "home advantage" :D
s/country/company/ 16:15
El_Che you were in kahoot with them!
sjn exactly! :-D
16:19 suman joined
suman say $_ if $_~~ /regex/ for "file".IO.lines gives the line that match the regex. 16:19
How to get the line immediately after the match?
16:24 andrea[m] left, AlexDaniel left, demostanis[m] left, happy-dude left, CIAvash left 16:35 bdju left
sjn reads certitude.consulting/blog/en/invis...-backdoor/ 16:36
16:36 CIAvash joined, Maylay left, chronon left
sjn Would it be sensible that the parser warns if it detects invisible/nonprintable characters in the code? 16:36
16:36 AlexDaniel joined, happy-dude joined 16:37 demostanis[m] joined, andrea[m] joined, bdju joined
sjn (maybe this should be in #raku-dev) 16:37
16:37 sm2 left, chronon joined 16:39 sm1 joined, abraxxa left, patterner_ left, ecocode__ left, leont left, skaji left, SmokeMachine left, tbrowder left 16:40 mjgardner left, kawaii_ left, pjlsergeant left 16:41 Maylay joined, pjlsergeant joined 16:42 ecocode__ joined, PotatoGim left, leont joined, mjgardner joined, SmokeMachine joined, patterner_ joined 16:43 kawaii_ joined 16:44 PotatoGim joined, skaji joined 16:45 tbrowder joined 16:49 suman left 16:50 suman joined 16:59 happy-dude left 17:01 AlexDaniel left 17:06 tejr left 17:07 tejr joined 17:14 sm1 left
El_Che weekly: github.com/dha twitter.com/GinaRSnape/status/1460...9101740033 both raku and perl community passed away 17:32
notable6 El_Che, Noted! (weekly)
17:32 AlexDaniel joined, happy-dude joined 17:39 suman left
Nemokosch rip 17:44
17:46 lizmat_ joined 17:47 lizmat_ left, lizmat_ joined 17:49 lizmat left, lizmat_ left, lizmat joined 17:53 patrickb left 18:03 reportable6 left 18:04 reportable6 joined 18:20 patrickb joined 18:41 dextercd joined 19:06 ajr joined 19:38 linkable6 left 20:23 sm1 joined
daxim raku job jobs.perl.org/job/21831 20:47
El_Che Desired skills: - German language :)
daxim could be worse
El_Che if I squint a little I can read it, I speak dutch :) 20:48
daxim I have visited nl about a dozen times and will reflect that notion 🤝 20:51
El_Che when there keep driving south and you'll meet my blend of dutch (Belgium, Flanders)
I sould like lizmat, but more polite :P 20:52
lizmat but less direct :-) 20:56
El_Che :P
21:02 ajr left 21:13 ajr joined 21:18 ajr left 21:24 sm1 left 21:34 jrjsmrtn left 21:36 jrjsmrtn joined, jrjsmrtn left 21:37 jrjsmrtn joined 21:43 ajr joined
Xliff_ What does this error mean? "const_n32 NYI" 22:16
El_Che not yet implemented? 22:17
moon-child load of literal/constant 32-bit [floating-point] number is not yet implemented
[Coke] github.com/MoarVM/MoarVM/blob/mast...erp.c#L220 22:19
22:23 ircuser left, ircuser joined
[Coke] how did you trigger it, OOC? 22:24
(wondering how hard it would be to implement MVM_BC_get_N32)
Xliff_ Um. There is a problem. 22:26
Global value set in package is NOT equivalent to said value in INIT block. 22:27
22:41 linkable6 joined
MasterDuke that kind of error usually means memory corruption 22:42
Geth doc: cd32380ab4 | (Marc Chantreux)++ | doc/Language/5to6-nutshell.pod6
simpler explanation of $RAKULIB

also remove reference to $PERL6LIB.
linkable6 Link: docs.raku.org/language/5to6-nutshell
23:07 Sgeo joined 23:51 dextercd left