ds7832 What's a good way to check all elements of an array are of a given type? (I get the array as a slurpy, so can't put a proper type constraint on it.) 00:07
00:11 arkiuat joined 00:16 arkiuat left
ds7832 Alright, I think I`m going to go with all(@items) ~~ Item 00:21
nemokosch that should be good enough; I think the "canonical" solution is moving towards using are 00:22
docs.raku.org/routine/are
ds7832 ooh, I like that. ty 00:23
.landyacht. @nemokosch / @aruniecrisps - in my personal experience the biggest barrier to adoption of Raku has been the chicken-and-egg problem… not enough people using it, so it seems fringe, and there aren’t enough people who know enough to rapidly fix bugs in Rakudo 00:24
nemokosch catch-22 00:25
.landyacht. Of course any growing language faces the same issue
Without some sort of corporate sponsor at least
nemokosch my (biggest) problem with this explanation is that it's kind of a cope that tells you "it is what it is, whatever, cannot be helped" 00:26
it's not really actionable and there is a bad kind of comfort in that
.landyacht. Looking at more unique challenges, one is that we rakuuns love to show off the fun features, and to do that we typically simplify down, and then it gives the impression of a Big Box of Features that’s kinda crazy and meant as a golfing language 00:27
00:27 ds7832 left, Nemokosch joined
Nemokosch m: say ().are; 00:28
tellable6 2026-02-03T20:01:17Z #raku <SmokeMachine> nemokosch: that’s the thing, discussing and helping other people to understand the working class politics IS THE THING that will help my surroundings, my people and my kids in the future…
camelia Nil
.landyacht. And I think the action there is to make “real” applications to show what can be done
Nemokosch so it is either that the docs are wrong or this behavior is wrong (in this case I feel it's the former) 00:29
.landyacht. But perhaps even better, to make platforms… I would argue Perl’s success in its heyday was largely due to CGI
It gets more people learning when they can make their fun thing atop a nice platform
I’m working on an extensible (via plugins) secure chat platform 00:30
I hope this will have a similar effect if it catches on, to encourage people to learn Raku for the sake of making a plugin
nemokosch good luck certainly 00:31
00:32 ds7832 joined, Nemokosch left
.landyacht. Plus I don’t exactly love Discord, and I would not be sad to sad goodbye to it 00:32
to say*
nemokosch I don't necessarily like the way discord is being run but I think it takes a lot to ruin it
.landyacht. It has been a long road because of the rather lofty architectural goals I’ve set for it 00:33
nemokosch this forum-text chat-conference calls hybrid is brilliant
.landyacht. Yeah, it generally serves a need and is more accessible to most than slack, and MS Teams is relegated to businesses really 00:34
00:34 Sgeo joined
Matrix is a good idea that’s been around for a while and isn’t too hard to set up but mostly just appeals to tech-savvy folks 00:35
I am hoping to match the ease of Discord and beat it in extensibility, then make it configurable for business applications as well 00:36
Unseating Teams won’t happen of course but non-microsoft shops might like it
nemokosch I think there simply is a huge appeal to getting a ready-made service, let alone "for free" 00:38
what I personally hate about most nerdy stuff is the need to create accounts for every goddamn thing 00:40
honestly I even find it safer to sell my soul to Microsoft, Google and Facebook but then that's it than having random accounts dangling all over that all demand a password from me
00:43 ds7832 left 00:44 arkiuat joined, ds7832 joined 00:48 arkiuat left 00:50 ds7832 left
[Coke] That used to bother me until I got a password vault that works on all my hardware. 00:53
01:06 kjp joined 01:11 arkiuat joined 01:16 arkiuat left 01:31 arkiuat joined 01:36 arkiuat left 01:46 sibl joined 01:55 arkiuat joined 01:56 sorenson left
Voldenet m: say ().are; # idk how is that wrong 02:13
camelia Nil
Voldenet docs say `returns nil or empty list` docs.raku.org/type/Any#method_are 02:14
nemokosch > say ().are; # OUTPUT: «True␤»
Voldenet okay, I scrolled to it and it's wrong 02:15
nemokosch funnily there is also > say ().are; # OUTPUT: «Nil␤»
Voldenet should be `say ().are(Any)` probably
or Nil
actually, empty lists always return True 02:16
m: say ().are(Whatever)
camelia True
arkiuat well, before I saw this discussion, I went and changed the example to `say ().are(Nil)` which is just one instance of many, but seemed intuitive to me 02:25
now i'm wondering whether that behavior is ROASTed or not. If it's not, it shouldn't be in the doc 02:26
It is, but any type would do, and Nil isn't as intuitive to everyone as I thought, apparently, so I changed the example again to what roast tests for (which just happens to be Int) 02:39
nemokosch I would like to be able to have "any type will do" there but sure enough, this would be first and foremost the task of the specification to say 02:42
include rant about how roast is not a specification
arkiuat yeah, this is probably a better channel for most of what we were just now talking about on #raku-doc 02:43
the roast test is at S29-any/are.t#L14 if anyone is curious 02:44
02:47 hulk joined 02:48 kylese left 03:15 hulk left, kylese joined 03:16 kjp left, kjp joined 03:21 sibl left 03:23 nine left, nine joined 03:37 sibl joined 03:38 arkiuat left 03:40 arkiuat joined 03:42 sibl left 03:46 sibl joined 04:00 sibl left 04:02 sibl joined 04:08 lichtkind_ joined 04:10 lichtkind__ left 05:07 disbot12 left 05:08 disbot13 joined 05:13 kst left 05:57 Aedil joined, Aedil left, Aedil joined 07:40 Sgeo left 08:41 johnjay left 09:09 dakkar joined
SmokeMachine lizmat: I'm sorry, but I disagree with you... I think custom control exceptions are very useful, for example: github.com/FCO/Red/blob/7499121179...akumod#L77 :) 09:41
09:43 arkiuat left
SmokeMachine (I think that comment on the code is very old and I should remove that... and I'm not sure why I'm doing that CONTROL twice... it seems that needs some refactor...) 09:43
lizmat from that code it is not clear to me what a custom control exception actually brings 10:02
it doesn't show where the exception is being thrown
10:15 sibl left 11:35 johnjay joined 11:37 timo left 11:38 timo joined
nemokosch github.com/FCO/Red/blob/7499121179...akumod#L31 it's thrown here but really without any explanation it's easy to get totally lost 12:12
12:12 Aedil left
SmokeMachine lizmat: it's used here: github.com/FCO/Red/blob/7499121179...akumod#L31 12:14
lizmat and why is that just not a subroutine call to a subroutine that has the handlers code ? 12:15
SmokeMachine lizmat: I use that to try to understand what happens inside a block.. every time a AST node is boolean tested, it returns True, sees whats the response of the block than runs again, returns False and sees the return again... with that I can create a switch case with all the options and create the SQL version of it... but it for all AST nodes... 12:17
nemokosch: yes, thanks
tellable6 SmokeMachine, I'll pass your message to Nemokosch
12:24 sibl joined 12:25 sibl left
SmokeMachine lizmat: maybe it could... but it doesn't make custom CX useless. But I think the way it is now makes sense... 12:26
12:27 sibl joined
lizmat well, If it doesn't actually make use of the fact that it's an exception, it is only adding runtime overhead 12:28
SmokeMachine what do you mean? where I call the block get notified when a bool is found and the block keeps running. If it were a function call it would need to call something else and the code running the block would not know about that... doable, but different... 12:33
nemokosch there is a lot of action at a distance here... found-bool resumes the continuation 12:34
12:37 derpydoo left 12:58 sibl left 12:59 sibl joined 13:06 El_Che left 13:07 Nemokosch joined, El_Che joined 13:09 Nemokosch left 13:24 sibl left
I'm afraid I'll have to write a follow-up gist for the mod vs % topic xD 13:52
anyway, the long story short would be - I never advocated for div to truncate numbers and probably wouldn't now either 13:54
and if we need mod at all, I would still advocate for numeric coercions for it
actually, let me make a huge code-argument against my supposed implementation 14:05
14:06 Nemokosch joined
Nemokosch m: say 10 mod 1.9 14:06
camelia -9
tellable6 2026-02-04T12:17:53Z #raku <SmokeMachine> nemokosch: yes, thanks
Nemokosch let that sink in. "10 modulo 1.9" is -9 14:07
14:07 Nemokosch left
nemokosch updated the gist, long story short my take is to make div only coerce to Numeric (which immediately restores the sanity of mod) and potentially retire mod as generally useless 14:26
if div coerces to Numeric, it might even be fine to fail on non-Int numbers
15:39 johnjay left 15:41 johnjay joined 16:00 ds7832 joined
aruniecrisps @.landyacht. I generally agree, but I think there are some things that do make adoption harder such as the tooling parity with other languages 17:05
I'm also working on a dictionary project in Raku at the moment that will hopefully get people to get eyes on Raku 17:06
17:26 human_blip left 17:28 human_blip joined 17:31 japhb left 17:37 japhb joined 17:40 dakkar left 17:43 ds7832 left 17:44 ds7832 joined 18:02 gabiruh left 18:03 gabiruh joined 18:25 Guest6754 joined 18:26 ds7832 left 18:32 Guest6754 left 19:01 arkiuat joined, gabiruh left 19:02 gabiruh joined 19:06 gabiruh left 19:07 gabiruh joined
arkiuat nemokosch, I agree. One of the few points S03 is clear on is that neither div nor mod should coerce non-integer types, and that both should fail instead when called on non-ints 19:08
(few points relevant to problem-solving issue 504, that is. It's clear on lots of other points!) 19:09
and yeah, it's known that the current implementation of mod is buggy, which is why I only use % instead anymore. That's why problem-solving issue 504 was opened in the first place, when I pointed out mod's weird current problems 19:10
nemokosch the whole arch-original point that I had with the old issue was that something like '5' div '3' has no reason to fail 19:11
not that 10 div 1.9 should be 10
arkiuat right, that makes sense. non-int only the within-Numerics sense
19:11 Guest6754 joined
antononcube @arkiuat I am not sure why mod or div should work on integers only. 12 div 2.4 is 5. 19:11
arkiuat div and mod should fail on non-integral Rats and Nums, but not necessarily on Str representations of integers (nor Rat and Num representations of integers, either, but they'd need to be numerically equal) 19:12
nemokosch @antononcube there are a million nuances about this topic. One argument that comes to my mind is that 5 div 3 is a fast operation while 12 div 2.4 is probably not 19:13
arkiuat I don't know that we need to retire mod, although we do need to fix it, but only because I'm waiting for someone to explain the design decision behind why Raku has both mod and % in the first place
nemokosch I'm this close to getting cynical 😅 19:14
antononcube Isn't it "too late" to retire mod? It is used in packages.
arkiuat antononcube, S03 originally specced otherwise, and S03 would have you phrase that as 12 div (2.4).floor or the like
antononcube, well the current implementation is badly buggy
antononcube Ok. Wolfram Language defines`QuotientRemainder as an "integer function", but QuotientRemainder works on reals and complexes. 19:15
arkiuat "retiring" mod in this sense would be making it a synonym of %. But I still not convinced there isn't a good reason to have a separate mod (given than we already have %): I'm just not able to explain what that reason is
nemokosch my general sentiment, almost like a big rule, is that nobody has ever understood this language and it has to be read as a dynamic, permanently shifting and evolving process, not a set of rules 19:16
there hasn't been a single point in time when 1. there was a full specification available 2. a single person or a couple of people knew that specification 3. it was implemented and used in the wild, all at once 19:17
arkiuat nemokosch, I can't deny that last point
nemokosch this is my fundamental disagreement with raiph 19:18
antononcube I have to implement "complex" mod in "Math::NumberTheory".
(It is an omission...) 19:19
korvo A clarifying question from PLDI might be useful here: are your numbers meant to resemble low-level machine types, or are they drawn from some (semi)ring?
19:19 gabiruh left
nemokosch @antononcube we have a holistic problem at hand. That will open up an even broader discussion 19:20
the truth is, a "generic division" can actually make sense - it's simply that div, as it has been implemented, is not that 19:21
19:21 gabiruh joined
antononcube Ok. I am inclined to implement quatient-reminder in "Math::NumberTheory". 19:22
nemokosch in my ideal world, what we have as div would be idiv or something and then there could be a sane "generic division" that would obviously provide non-coercive behavior for all core numeric types for starters
antononcube (Whatever div or mod are doing then.)
nemokosch that idealistic div could have an idealistic mod counterpart
antononcube Here is what I am looking at: 19:23
cdn.discordapp.com/attachments/633...36e6c&
nemokosch I wonder if the image gets carried over to IRC (wouldn't assume) 19:24
apparently there is a link that I for one can open
antononcube I think (curious) IRC readers can click on a link. 19:25
nemokosch the problem (if we consider it as one) is that it's almost never one isolated issue
generic division and modulo is one topic - the actually implemented div and mod are another 19:26
and even there, I slipped "Int" in the name of an issue and it led to truncating behavior that I'm not sure anybody really wants 19:27
lizmat `weekly: github.com/Raku/problem-solving/issues/511 19:28
weekly: github.com/Raku/problem-solving/issues/511
notable6 lizmat, Noted! (weekly)
19:31 Guest6754 left 19:33 Guest6754 joined 19:39 Guest6754 left
arkiuat we already have / and %, so it makes no sense for div and mod to just be synonyms of those, and that (synonymity) was clearly not the intent expressed in S03 19:39
and FYI, the images you see on discord don't get carried over to IRC 19:40
just a really long and atrociously ugly URL 19:41
19:41 Guest6754 joined
lizmat which you can click at least ? 19:44
19:46 Guest6754 left
nemokosch talked about synonymity, though 19:46
19:47 Guest6754 joined
where is "nobody" from the beginning 19:47
19:47 gabiruh left 19:48 gabiruh joined
arkiuat there seems to be a lack of a clearly understood distinction 19:50
19:51 Guest6754 left
aruniecrisps Is knowhow the keyword supposed to be exposed to user land? 19:51
arkiuat github.com/Raku/problem-solving/is...3842875074
19:53 Guest6754 joined
nemokosch my analysis of the situation is that the original idea (relayed by S03) was that div and mod would indeed be general versions of / and %, similarly how somebody could come up with plus and minus and similarly to how eqv exists 19:56
"general" here means: non-coercive, meant to be handled on a per-type basis, so just like Python's overloads 19:57
19:57 gabiruh left
however, the reality of the things have been, for God-knows-how-long, is that div (which also backs mod) simply doesn't satisfy what you'd expect from a generic division 19:57
19:58 gabiruh joined
a generic division should never fail for something as mundane as 12 div 2.4 (all types involved are core types), yet it did for the longest time 19:58
also, a generic division arguably shouldn't confidently state that 5 divided by 2 is 2
lizmat fwiw, I think the coercion shouldn't have been to Numeric, but to Int 19:59
nemokosch lowkey hoping you meant the other way around - currently coerces to Int and arguably it should coerce to just Numeric 20:00
one thing is sure, there is a lot of talking past one another 20:01
20:02 Guest6754 left 20:04 Guest6754 joined 20:07 Guest6754 is now known as ds7832, ds7832 left 20:09 ds7832 joined 20:11 ds7832 left, ds7832 joined
arkiuat the other sure thing is the mod has been badly broken for months 20:13
s/the/that/
lizmat years I think :-(
arkiuat yes, years, that's right
lizmat lack of spec tests :-(
otoh, it never showed up in blin runs either
so I guess the breakage wasn't bad enough 20:14
arkiuat it's bad enough that I just never use mod anymore. I'll make do with workarounds using % and .floor until it's fixed
20:14 ds7832 left
lizmat well, I guess a repair module would maybe be in order 20:15
arkiuat as nemokosch pointed out already: 20:16
m: say 10 mod 1.9
camelia -9
nemokosch for me it's a two-faceted problem: one is that breaking changes are taken too lightly (we know about much more breaking changes than Roast or Blin), and that people with sufficient influence are sick and tired of language design discussions 20:17
20:39 sorenson joined 20:57 librasteve_ joined
arkiuat kjp, are you around? 21:23
kjp - good catch on removing that `with $min { ... }` from TWEAK! I thought I had been using a test that would catch that, but apparently not. Thanks!
21:24 ds7832 joined
arkiuat kjp, I just made another issue on Math::Angle before I start on a PR to address it, just to see if you have any alternative suggestions before I get too far down the path 21:24
21:28 ds7832 left, ds7832 joined 21:34 ds7832 left 21:36 ds7832 joined 21:50 ds7832 left, ds7832 joined 22:10 ds7832 left, ds7832 joined
lizmat weekly: dev.to/lizmat/doc-mirages-1aj9 22:20
notable6 lizmat, Noted! (weekly)
22:21 ds7832 left, ds7832 joined 22:36 ds7832 left 22:37 ds7832 joined 22:42 ds7832 left, ds7832 joined 23:07 librasteve_ left 23:12 ds7832 left, ds7832 joined 23:19 oodani left 23:21 oodani joined 23:43 ds7832 left, ds7832 joined