🦋 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.
Nemokosch Not like I'm any authority here but I do feel strongly about the ideal itself: Raku should be one of the VERY FEW languages that doesn't remove meaningful features just because the underlying implementation makes them slow. I'm not aware of any "killer feature" of Raku that would justify that - actually the killer feature of Raku is the freedom it grants itself. 00:01
00:02 reportable6 left 00:03 reportable6 joined
and the huge monster Raku is syntax-wise, it seems so banally simple to add some extra pragma if someone wants effective `switch` rather than multi-smartmatching... 00:03
00:04 sftp left, sftp joined
MasterDuke not disagreeing with you, but we do also have to be careful that the language doesn't get too big to maintain. if we have switch semantics *and* smartmatching, that's just that much more code to get correct 00:19
Nemokosch I mean if someone really just wants a C or even Javascript kind of `switch`, that shouldn't cause much headache, right? 00:20
implementation-wise 00:21
MasterDuke but raku definitely isn't a minimalist scheme, so i don't think we should reflexively veto any addition
well, it might actually be "relatively" easy to implement as a macro after rakuast lands
backing up to your example, i only see the unhandled failures if the last extension isn't found 00:25
00:25 Colt joined
MasterDuke e.g., i have a bunch of .cpp files in a directory. `my $a; for ".".IO.dir -> $p { $a = $p.extension("c"|"pcc"|"cpp") ~~ :f }; say $a` just prints `True`. but if i put one of the other extensions last in the junction, i get a ton of the unhandled Failures 00:27
huh, but i get them regardless of position if i just call .f instead of smartmatching against :f 00:35
anyway, off to sleep 00:36
Nemokosch same
buonanotte 😄
00:38 Oshawott left 00:41 ajr left 00:44 _________ left, patrickb left 00:45 patrickb joined, _________ joined, squashable6 left 00:46 squashable6 joined 00:54 archenoth joined 00:56 patrickb left 01:28 swaggboi left 02:08 melezhik joined
melezhik . 02:09
02:18 melezhik left, melezhik joined 02:33 melezhik left 03:25 swaggboi joined 03:34 [Coke] left 03:52 Colt left 03:53 Colt joined 03:55 [Coke] joined 04:51 MoC_ left, MoC joined 05:51 squashable6 left, committable6 left, releasable6 left, greppable6 left, quotable6 left, linkable6 left, reportable6 left, evalable6 left, notable6 left, benchable6 left, nativecallable6 left, statisfiable6 left, sourceable6 left, coverable6 left, tellable6 left, unicodable6 left, shareable6 left, bisectable6 left, bloatable6 left 05:52 unicodable6 joined, linkable6 joined, coverable6 joined, statisfiable6 joined, benchable6 joined 05:53 releasable6 joined, squashable6 joined, nativecallable6 joined, bloatable6 joined, greppable6 joined, shareable6 joined, quotable6 joined 06:11 frost joined 06:12 frost left 06:30 frost joined 06:49 leont left, kawaii_ left 06:50 kawaii_ joined 06:52 leont joined, tellable6 joined, bisectable6 joined 06:53 sourceable6 joined 07:05 reportable6 joined 07:16 avar left 07:17 avar joined 07:25 seednode left 07:26 seednode joined 07:52 committable6 joined, notable6 joined 08:14 abraxxa joined 08:16 Sgeo left 08:19 abraxxa left, abraxxa joined 08:54 evalable6 joined 09:06 MoC left 09:15 Colt left, Colt joined 09:55 andrzejku joined
andrzejku hello 09:55
09:57 RakuIRCLogger joined 09:58 Geth joined
Nemokosch suppers 10:02
10:39 linkable6 left 10:42 linkable6 joined 10:44 linkable6 left 11:27 ecocode__ left 11:28 rjbs left 11:30 ecocode__ joined 11:31 rjbs joined
Xliff \o 11:31
I'm getting segfaults with latest Raku. One sec. 11:32
*sigh* -- it's a flapper. 11:33
Only appears when precompiling a compunit. Not enough for a bug report. 11:34
11:35 Altai-man joined
lizmat Xliff: ther 11:36
there are several issues atm
11:36 patterner_ left 11:39 patterner_ joined
Xliff lizmat: I am aware. I tried to report one other, but that one too was a flapper. Not a segfault, though. 11:39
11:46 linkable6 joined 12:02 reportable6 left 12:03 reportable6 joined 12:08 linkable6 left 12:49 frost left 13:05 frost joined 13:08 linkable6 joined 13:26 sm2 joined
tbrowder lizmat: how do you feel about adding a method for Date.new with input of year and day-of-year? 13:57
kind of an inverse method
lizmat I guess a :year / :year-day candidate could work 14:01
14:03 frost left, andrzejku left 14:21 linkable6 left 15:19 Flwyd left 15:22 linkable6 joined
andinus does "is copy" do nothing when passing lists? 15:58
[Coke] is the complaint that you still get the immutable error? 16:00
I would expect that a copy of an immutable list is immutable itself.
andinus no, the changes are not localised,
so this is a recursive function, i'm trying to trace back all the points that got it to this point 16:01
[Coke] Do you mean Array and not List?
andinus yes, i'm changing it, so array i believe
@maze, Int $y, Int $x, @visited?, @cur-path? --> List
[Coke] m: my @a=1,2,4; sub a(@a is copy) { @a[2]=4}; a(@a); dd @a;
camelia Array @a = [1, 2, 4]
moritz_ Array is a reference type, "is copy" just copies the refernece to the array 16:02
andinus ah i see, can i make it "deepcopy" the array for every call?
moritz_ if you have a deepcopy function, sure 16:03
@a = deepcopy(@a) as the first line in your sub
andinus is hash a "reference type" too? 16:05
so does is copy on hash copies the refrence or deep copies the hash?
16:06 ufobat joined
[Coke] could also have the sub do a clone when you enter. 16:06
andinus i see, yes that'll work
tbrowder lizmat: ok, i'll work on it when i get a chance. imho, the power of Date and DateTime is not heralded enough compared to some other nuggets of raku :) 16:09
just look at all the cal modules in Perl needed to do the same thing 16:10
17:09 evalable6 left, linkable6 left 17:12 evalable6 joined 17:43 zjmarlow joined 17:46 abraxxa left 17:58 zjmarlow left 18:02 reportable6 left 18:07 ufobat left 18:48 Altai-man left 19:48 evalable6 left 19:50 evalable6 joined 20:04 zjmarlow joined 20:05 reportable6 joined
zjmarlow Hi.  Has anyone successfully compiled Rakudo on macOS Monterey?  I'm having trouble after the make install step for nqp.  nqp can't find nqp.moarvm even though it is in install/share/nqp/lib/ 20:09
[Coke] I don't think anyone has 12.0 yet 20:17
anyone *here*, obv. you do. :)
Any errors/warnings prior to this point in the build? 20:18
lizmat feels to me Apple got even more suspicious of native libs :-( 20:19
zjmarlow No errors / warnings that I can see.  MoarVM compiled fine.  Configure for nqp also completed fine. 20:24
fwiw, ./nqp --version runs okay if nqp.moarvm is placed in the same directory but nqp has trouble finding it again if run from another directory. 20:28
lizmat I seem to have read that MacOS needs some extra care with regards to non-local native binaries 20:35
[Coke] I used to have a shortcut for dumping out the link info on a binary... where did I put that...
lizmat also, I'd check the system log if that has anything about moarvm
[Coke] try otool -L <path to nqp> ? 20:36
here I get gist.github.com/coke/41a4407bb4e97...da9ba622a8 20:38
zjmarlow my output is just /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0) 20:39
no relevant information in Crash Reports, Log Reports, system.log 20:41
MasterDuke anything change if you compile moarvm with --static? 20:42
20:47 colemanx left
zjmarlow no, it is still looking for (and can't find) nqp.moarvm 20:48
okay, an entry in Crash Reports for nqp: Exception Not: EXC_CORPSE_NOTIFY.  Termination Reason: CODESIGNING 2.  I was able to work around that by mving nqp instead of just doing a cp. 20:53
Exception Note*
20:58 dextercd joined 21:05 tejr left
[Coke] good find. 21:15
21:22 tejr joined 21:28 zjmarlow left 21:32 zjmarlow joined 21:34 squashable6 left 21:38 zjmarlow left 21:45 zjmarlow joined, sm2 left 21:48 [Coke] left 21:50 [Coke] joined 22:11 linkable6 joined 22:18 patrickb joined 22:33 zjmarlow left 22:36 squashable6 joined
Nemokosch I don't know whether this is a weird thing to say 22:46
but I definitely love to use Raku as a kind of shell xD 22:47
Python or JS already feel like a breath of fresh air after POSIX shell variants 22:48
but in Raku it's really a no-brainer to get a better `cut` and stuff like this 22:49
and the interaction with underlying shells is so fluent...
there is no "check for binary file" utility? no worries, I can just call the pretty good `file` program and extract something from the returned string 22:51
22:52 zjmarlow joined
moon-child @Nemokosch#9980 what constitutes a 'binary file'? You can read the bytes and check if any of them is ≥0x80 22:57
(or perhaps 7f)
Nemokosch It's hard to tell but that's surely too strict, non-ascii chars are a thing 23:02
It would be costly to get false positives for every German comment in source files and man docs 😅 23:04
japhb A reasonable heuristic for determining text v. binary is kinda messy. You have to consider whether there are nulls or control bytes, whether it can be decoded as utf-8, etc. 23:05
perl6
Gah
perl5's heuristic is reasonable at matching human expectation, but makes me wince.
23:05 Sgeo joined
japhb Probably why we didn't adopt it. 23:05
Nemokosch Anyways, it seems good enough to just take the judgement of `file` 23:15
qqx{file --mime-encoding $_} ~~ /binary\n/ 23:16
Or sth like this
qqx{file --mime-encoding $_} ~~ /binary\n$/
patrickb Is it guaranteed that all whenevers in a react block are set up before the first fires? 23:18
japhb patrickb: It is guaranteed that the top level of the react block is executed before the reacting starts. But whenevers can be added at run time, from within other whenevers, for instance. 23:20
lizmat I think it is, if you understand that all the whenevers are just syntactic sugar for a bunch of code blocks being passed to a routine
23:20 zjmarlow left
lizmat japhb: I didn't know that... so... patrickb I guess YMMV 23:21
patrickb hm. I want to be sure that events fired during the execution of one event block are guaranteed to be seen by the other block.
japhb Well, the whenevers within a *particular* react block are guaranteed to be mutually exclusive. But not, IIUC, between react blocks. 23:22
And certainly, when you start a new task for the react, you have no idea whether that new task or your current task executes first; if you need it to happen in a certain order, you need to write an interlock. 23:23
patrickb Could `whenever anyof(Promise.keep, $some-supply) { ... }` do that?
lizmat well, that just returns another Promise, no ?
patrickb Lets add some context: paste.sr.ht/~patrickb/9eb21e6d2cd4...ab1300e61f 23:25
I try implementing remote window handling in cro http2
23:26 djerius left, djerius joined
patrickb Task is: Check if there is enough room left in curent window and if yes (the fast path) atomically decrement the window sizes. 23:26
23:27 dextercd left
patrickb If not, wait for an event telling me the window sizes have been bumped and then check again. 23:27
japhb (BTW, side note on that paste: If you've already typed an attribute, you don't have to repeat yourself to initialize it. You can do: `has Supplier $.stream-reset .= new;` ... or even `has Supplier:D $.stream-reset .= new;` if you want to guarantee that you never have an uninitialized Supplier.) 23:28
patrickb Raciness spoils the fast path, when a bump happens between the fast path check and before the tap is set up. Then I possibly wait endlessly. 23:29
japhb: Those lines were existing Cro code. Want to stick to the convention.
japhb When using atomicint, you should use atomic fetch (prefix atom) as well as atomic math. 23:34
But again, that's a side note. 23:36
patrickb Without atomic I'm at least guaranteed to either read the old or new value, right? If yes, I'm fine.
japhb patrickb: Not necessarily, IIUC. I believe atomicint is the right size so you *can* use atomic primitives on it, but if you don't, you could get e.g. split reads. 23:41
(But I'm not an expert in portability of atomicity conventions.)
Why are you reacting to a 'Promise.kept'? That's going to be instantly true.
patrickb split read means completely bogus value?
moon-child I don't know of any remotely new hardware where you'll get split reads on something that size. That said it would be nice to have first-class support for relaxed ordering 23:42
japhb patrickb: Upper 32 bits and lower 32 bits in separate reads.
moon-child: Like I said, I'm no expert, just following docs.
(To my comment above: Promise.kept is a shorthand for creating a new Promise that has *already* had .keep called on it.) 23:43
patrickb I'm unsure it works, but the hope is, that this will be instantly true, run the code, if success be done. *But*, if, while doing the check, an event on the $remote-window-change occurred, I'm guaranteed I will not miss it. 23:44
That's the thing I'm stuggeling with. How can I have the fast path (usually there will be enough room in the window), but also be sure I will not have missed any concurrent window size increases. 23:46
japhb Hmmm, looking at that code more, I'm not sure I've ever tried to tap a Supplier directly (rather than a Supplier.Supply)
patrickb I think you're right about that, I need to get a supply first. 23:47
paste.sr.ht/~patrickb/2193bb0eab81...3941e3566e <- That's the code I started with, before I noticed the raceiness. It's probably more obvious which problem I try to solve. 23:54
paste.sr.ht/~patrickb/88628f6bb305...2940964b39 <- even clearer 23:57