🦋 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 6 September 2022.
00:00 reportable6 left 00:02 reportable6 joined 00:14 Manifest0 left 00:18 ProperNoun left 01:04 jpn joined 01:09 jpn left 02:06 derpydoo joined 02:23 pony joined 03:23 squashable6 left, sourceable6 left, nativecallable6 left, statisfiable6 left, notable6 left, greppable6 left, shareable6 left, committable6 left, reportable6 left, evalable6 left, quotable6 left, unicodable6 left, bloatable6 left, coverable6 left, benchable6 left, tellable6 left, linkable6 left, releasable6 left, bisectable6 left, tellable6 joined, benchable6 joined, greppable6 joined, shareable6 joined, sourceable6 joined, nativecallable6 joined 03:24 coverable6 joined, releasable6 joined, notable6 joined, evalable6 joined, reportable6 joined, linkable6 joined 03:25 statisfiable6 joined, committable6 joined, quotable6 joined, bloatable6 joined, unicodable6 joined, bisectable6 joined, squashable6 joined 04:25 coverable6 left, bloatable6 left, shareable6 left, notable6 left, unicodable6 left, quotable6 left, sourceable6 left, benchable6 left, bisectable6 left, releasable6 left, tellable6 left, squashable6 left, evalable6 left, greppable6 left, nativecallable6 left, statisfiable6 left, committable6 left, reportable6 left, linkable6 left, coverable6 joined 04:26 statisfiable6 joined, evalable6 joined, shareable6 joined, greppable6 joined 04:27 quotable6 joined, bloatable6 joined, benchable6 joined, notable6 joined, reportable6 joined, releasable6 joined, sourceable6 joined, committable6 joined, bisectable6 joined 04:28 linkable6 joined, unicodable6 joined, tellable6 joined, nativecallable6 joined, squashable6 joined 05:25 kst left 05:26 kst joined 05:45 abraxxa joined 06:00 reportable6 left 06:02 reportable6 joined 07:02 nativecallable6 left, releasable6 left, committable6 left, greppable6 left, sourceable6 left, bisectable6 left, tellable6 left, coverable6 left, benchable6 left, statisfiable6 left, quotable6 left, linkable6 left, bloatable6 left, evalable6 left, squashable6 left, unicodable6 left, notable6 left, reportable6 left, shareable6 left, committable6 joined, sourceable6 joined 07:03 releasable6 joined, nativecallable6 joined, tellable6 joined, coverable6 joined, benchable6 joined, bloatable6 joined, shareable6 joined 07:04 reportable6 joined, squashable6 joined, quotable6 joined, greppable6 joined, unicodable6 joined, notable6 joined, bisectable6 joined, evalable6 joined, linkable6 joined, statisfiable6 joined 07:36 MoC joined 07:37 Sgeo left 07:44 MoC left 07:47 kst left 07:57 dakkar joined, jpn joined 08:18 derpydoo left 08:23 teatwo joined, teatwo left 08:24 teatwo joined 08:25 teatime left
grondilu Hi all. Can the gcc builtin be accessed via NativeCall? gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html I tried and failed. 08:46
I tried the very naive : use NativeCall; sub __builtin_clz(uint8 $ --> int8) is native {*} 08:47
and got : ===SORRY!=== Error while compiling Cannot locate symbol '__builtin_clz' in native library '' at line 08:48
dakkar those don't really exist 08:49
they are added (almost certainly as `static`, i.e. not visible to the linker) by the compiler to objects (programs, libraries) that need them 08:50
grondilu I see. So I suppose if I really want to use them I need to write a wrapper library? 08:52
dakkar ah, yes «GCC built-in functions are always expanded inline and thus do not have corresponding entry points and their address cannot be obtained» 08:53
not even `static`, inlined directly
tbf, I'd first ask why you want to access them 08:55
they're either equivalent to libc functions, or very special
(you may have a very good reason, but it's still useful to know it) 08:56
08:56 wafflus joined
grondilu I'd like to implement www.rosettacode.org/wiki/Posit_numbers but make it as fast as possible. 08:57
dakkar you know where to find an assembler 😜 08:58
wafflus is it a bug if I tell a function to return a int and it returns a Nil and does not crash 08:59
if i return a string it does crash 09:00
dakkar grondilu: also notice that the GCC builtins you were looking at, may change with any gcc release, they're pretty much "internal use only"
wafflus: `int` or `Int`?
wafflus Int
i mean i could tell it to return a Str and it will still work but the signature would be a lie 09:01
dakkar Int is an object type, Nil is a valid value for it
although…
wafflus well that seems silly
dakkar there's… a bunch of reasons, some good 09:02
m: Nil ~~ Int 09:03
camelia ( no output )
wafflus ok i guess i shouldnt question larry
:D
dakkar m: say Nil ~~ Int
camelia False
dakkar m: sub foo(-->Int) { return Nil }; say foo()
camelia Nil
grondilu chatGPT just told me there is no "count leading zero" in libc, but it gave me the equivalent code with bitshift ops. I guess I can write it in raku and it should not be much slower.
dakkar that's the surprising bit, I guess?
wafflus yes
i mean i would kind of expect it to behave the same as when i return a string 09:04
when it was expecting a Int
dakkar grondilu: ① never trust LLMs / Markov chains ② that page you linked already said that ③ "correct" should win over "fast" any day
wafflus also it be cool if it could detect the error when i was creating it as well 09:05
dakkar lizmat: do you happen to know/remember why returning a Nil is allowed even if it doesn't match the return type? I think there's reasons, but I can't remember
wafflus: sorry, you lost me there; when you were creating what? 09:06
lizmat dakkar: initially, Failures were also always allowed to be returned 09:07
when Nil got introduced, it was Nil that is always allowed to be returned
m: sub a(--> Int:D) { Nil }; dd a
camelia Nil
wafflus if you write a function that is obviously incorrect i think raku should not create the function and say the types are incorrect like returning a Str when it should be an Int. instead it just compiles and crashes at run time
lizmat dakkar: at that time, Failure became a subclass of Nil
wafflus some of my terminology may be slightly incorrect
lizmat m: dd Failure.^mro 09:08
camelia (Failure, Nil, Cool, Any, Mu)
lizmat and this Failures are also always allowed to be returned
*thus
dakkar aha! thank you
wafflus: in the general case, what you are asking for is impossible; in many specific cases, it could be implemented (like, the compiler could do a lot of static analysis / data flow / &c and determine that the function could not possibly ever work, and tell you) 09:09
just, nobody got around to it yet 09:10
wafflus i've seen something simlar done in F# but much more complicated
lizmat dakkar: which implies, if you want a class to be always returnable, make it a subclass of Nil:
m: class A is Nil { method raku() { "foo" } }; sub a(--> Int:D) { A }; dd a
camelia foo
dakkar lizmat: that's the kind of cheating we like in the Perl family, but that we never want to see in Real Code™ 😁 09:11
btw, is there any way to mark a function as "no, I'll never return a Failure/Nil"?
lizmat create a subset with a constraint that will die if given a Nil ? 09:12
and then --> thatconstraint ?
dakkar m: sub foo(-->Int:D) { return Nil }; say foo()
camelia Nil
dakkar ehrm 09:13
also, I asked my question badly… what I really meant is: would it make sense to have a way to tell _the compiler_ that we intend this function to never return a Failure/Nil, so that future implementations may exploit that fact? 09:15
lizmat meh, that idea doesn't fly, as the constraint check is simply bypassed for Nil apparently
grondilu If I want the two-complement of an unsigned int, can I just negate it? say -my uint8 $ = 1
dakkar grondilu: I feel you're confusing values and representations 09:16
grondilu that is likely
lizmat dakkar: that makes sense
dakkar grondilu: if you want the complement of a *string of bits*, you operate on the bits; if you want the negative value of a number, you negate it… 09:17
grondilu what about my uint8 $ = -my int8 $ = my uint8 $ = 1 ? 09:18
dakkar grondilu: if you want to see the representation of a number as a string of bits… you have to dig in the innards of whatever implementation you're using (and sometimes this digging ends below the asm level)
wafflus i tried to do a !Nil no luck
dakkar wafflus: yes, that's what we've just noticed, you can always return Nil from a function (unless it returns a native, non-boxed type, but those are a different beast)
m: sub foo(-->int) { return Nil }; say foo()
camelia Cannot unbox a type object (Nil) to int.
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu dakkar: that can't possibly be that complicated, can it? 09:19
lizmat heh... that feels like a bug
dakkar lizmat: the unbox, or that you can return Nil from a sub marked `-->Int:D`?
lizmat the unbox
dakkar grondilu: depends! if you want a twos-complement representation, you "just" write your own representation code; if you want to see how the language+runtime+computer actually represents things… that may be very complicated 09:20
lizmat: `int` can't represent an undefined value, so (apart from maybe a LTA error message), the behaviour feels correct to me 09:21
wafflus thinks it silly to have two things with the same name (int or int) to confuse people 09:23
dakkar wafflus: the naming is sub-optimal, yes; the fact that we have both is actually pretty important 09:24
values of type `Int` are objects: they have methods, you can subclass them, apply traits, &c&c 09:25
values of type `int` are raw numbers: you can only do some arithmetic with them, but they take less space in memory and are a bit faster
wafflus k cool 09:26
dakkar (other languages have the same distinction, often with the same sub-optimal naming, e.g. Java docs.oracle.com/javase/tutorial/ja...types.html ) 09:27
wafflus int also initilizes a value
and makes it defined
 ofc but we learn form our mistakes hopefully
dakkar more or less. more precisely: values of type `int` cannot be undefined, and have a default value of `0`
wafflus maybe the shold have called it a qint  for a quick int :) 09:29
09:33 abraxxa left 09:48 abraxxa joined
nemokosch I opened an issue for "Failure is Nil" once upon 09:58
it wasn't well received tbh
> that's the kind of cheating we like in the Perl family, but that we never want to see in Real Code™ 😁 that's very much on point...
int is basically a VM-level integer, practically the same thing as C's int 09:59
10:26 guifa joined
guifa o/ 10:30
10:35 jpn left
lizmat And yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2023/09/18/2023-...ew-search/ 10:42
nemokosch lizmat++ spreading the word about the new search is the best thing we can do for UX at the moment 10:44
10:52 guifa left
wafflus a suggestion for the manual when you search sometime it comes up with multiple version of the same keyword. it would be nice if you could tell the difference between the two before you click on the page 11:02
for example search for do and you will get two do's 11:03
nemokosch have you seen new-raku.finanalyst.org/ ? 11:05
wafflus nope
looks interesting and better 11:06
however
not sure when i search for do i think it maybe should list the do first 11:07
and not about docs
but those at the bottom
put
lizmat please report your findings at github.com/Raku/doc-website/issues/new/choose :-) 11:09
nemokosch yeah fair enough 11:10
wafflus lizmat is that an issue or a complaint though? 11:12
lizmat it's a comment? 11:13
at this point, any comment / suggestion / complaint / issue is welcome to get more feedback
wafflus does not have a github account atm
lizmat ah... hmmm.... 11:14
is it a problem for you to get one ?
wafflus i can get one i just don't like using my real emails 11:15
or i had one and i forgot the email 11:16
i guess thats strange these days 11:17
that one of the reason i use IRC
nemokosch not many reasons remain for using IRC these days, that's for sure... 11:19
even XMPP is kinda retro and it's rocket science compared to IRC
wafflus i'm also kind of private and maybe paranoid about it 11:20
nemokosch Okay, now a bit of English 11:22
wafflus plus alot of these online forms are a little mod heavy
nemokosch because I'm not sure if English is at fault or the user in this case...
so what does it mean if I say
"any of these numbers is greater than 5"
11:23 ProperNoun joined
to me this would mean all of them 11:23
wafflus to me it would be any or all 11:24
nemokosch okay but what does it mean with "any",
?
wafflus i guess 11:25
what if
you go throught each person and you ask if any of them want to reaise there hand from the perspective of each person they would all be any
if that makes sense
nemokosch I get that 11:26
wafflus but maybe your is more correct english wize
11:26 guifa joined
wafflus you are more correct 11:26
nemokosch that would mean "is there a person P for which P wants to raise their hand"
but I feel that there is a difference of meaning with a statement 11:27
11:27 guifa left
"is any of these numbers greater than 5" clearly means "is there a number X among these numbers for which X > 5" 11:27
El_Che wafflus: use rotating burner emails? 11:28
nemokosch it seems to me that the statement doesn't have the same meaning
wafflus El_Che ok
:person A to group b would anyone like to eat dinner 11:29
11:29 guifa joined
wafflus all could raise there hands or 1 or some 11:29
or none ofc 11:30
nemokosch "any" seems too fragile
"any of you can drive a car"
this quite clearly means "all of you" 11:31
"any of you are adults" - now, this just sounds stupid I think
wafflus i agree with that last one lol 11:32
you are probally right we need a better word
nemokosch or take this one 11:33
"not anyone can do that"
this doesn't mean downright "nobody can do that"
much rather just "not all people can do that" 11:34
wafflus it is kind of confusing for noobs like myself 11:38
11:50 tea3po joined 11:53 teatwo left 12:00 reportable6 left 12:01 reportable6 joined
nemokosch as we have come this far, I don't think we can do much about it but I think it's worth thinking about and be aware of 12:04
if we are using terms like "true" and "false", we are clearly thinking in statements, not questions 12:05
it's not terribly useful to use a word like "any" as a term, then, which has its "true meaning" in questions
12:07 Vyrus left 12:11 Vyrus joined 12:23 Manifest0 joined 12:40 wafflus left 12:59 jpn joined 13:14 derpydoo joined 13:31 jpn left 13:35 jpn joined
guifa "any of you X" is the same as "all X, but has a connotation 13:36
err
13:37 [Coke] joined
tea3po I mean there's lots of this stuff in english that you run into in logic, around words like "any" and "only" 13:37
[Coke] nemokosch: I did not end up getting time to work on zef-deps, still in my queue though
guifa "any of X" is the same as "all X" but has a potentiality connotation (hence it's often used with might/would/could)
nemokosch I think on a meta level "any" is like "the listener will fill this word in" 13:38
so when it appears in a question, it's like "can you fill it in so that we want to make it a true statement?" 13:39
but when it appears in a statement (often a speculative statement), it expresses a great load of confidence
"no matter how you fill it in, the statement will still be true" 13:40
14:20 thundergnat joined
thundergnat While I don't disagree that in English, "any" can have a murky meaning in a statement, in Raku, "any" means "at least one". Try substituting "at least one" into all of the above sentences and they're much less ambiguous. The problem is that English doesn't really have a better (short) word for "at least one".... and I,for one, would much rather 14:25
type any(..) than at-least-one(...).
Maybe some other language has a better word for the concept that could be appropriated. Can't readily think of one but I am not multi-lingual. 14:26
14:27 thundergnat left, perlbot left, perlbot joined
tbrowder__ hi, i just released File::Copy and i would appreciate any feedback. 14:30
nemokosch I think "some" itself is much better than "any", for what it's worth 14:32
moreover, "any" led to the temptation to special-case negation for Junctions, which I think nobody actually likes
any(a, b) != c turning into none(a, b) == c for the lolz 14:34
tbrowder: github.com/raku-community-modules/...nd/pull/43 if you feel up to it 14:35
I see we got yet another HTML escaper as well... 14:37
is it mi6 that generates these "perl": "6.*" versions? 14:38
14:42 simcop2387 left, simcop2387 joined
tbrowder__ could be. 15:08
have we agreed what it should be? 15:09
15:10 moritz left 15:16 moritz joined 15:17 jpn left 15:24 moritz left 15:25 jpn joined 15:33 jpn left
tbrowder__ nemokosch: “feel up to it” you mean “merge” or fix something on the PR? 15:45
15:45 abraxxa left 15:54 moritz joined
nemokosch well, I see that somebody added a couple of comments... 15:57
that may have been me but anyway 😛
15:59 moritz left 16:14 moritz joined 16:22 moritz left 16:52 dakkar left
tbrowder__ i’ll see if i can fix the badges for one thing 16:55
[Coke] released 0.9.8 of zef-deps which tracks the latest change in zef not to be explicit about a version 17:20
(in the case of nativecall & test)
17:20 nil9 joined 17:23 nil9 left, nil9 joined 17:24 nil9 left, nil9 joined 17:38 derpydoo left 18:00 reportable6 left 18:03 reportable6 joined, n1to joined 18:04 n1to left
tonyo ? 18:25
[Coke] it used to say nativecall:ver<6.c+> or similar, now it just says Nativecall 18:26
tonyo ahh, less to do about how zef resolves :from<native>
[Coke] you can see the test output changes (and dependency changes) here: github.com/coke/raku-zef-deps/comm...42941ca5a9
18:28 jpn joined 18:32 nil9 left 18:46 xinming left 18:48 xinming joined 18:50 nil9 joined
tbrowder__ nemokosch: what is ye 19:13
*yr github handle?
or "ye" for olde
*oldish english 19:14
nemokosch Just look at the PR ^^ 19:15
tonyo it means they when "they" are the subject, most generally 19:19
19:21 nil9 left 19:24 jpn left
tea3po y is a substitute for letter thorn which is a ligature of t and h 19:25
en.wikipedia.org/wiki/English_articles#Ye_form
19:39 jpn joined 19:43 tejr left 19:46 xinming left 19:48 xinming joined 19:49 tejr joined 19:59 jpn left 20:17 lizmat_ joined 20:20 lizmat left 20:22 teatwo joined 20:23 teatwo left 20:24 teatwo joined 20:26 tea3po left 20:27 teatwo left 20:28 teatwo joined
nemokosch Coke: is there something like zef-deps but for reverse dependencies? 20:33
took some time until I realized that it's what I actually need now; basically I want to check the impact of a certain distribution 20:34
20:36 teatwo left, teatwo joined 20:45 xinming left 20:47 xinming joined 20:51 jmcgnh left 20:56 jmcgnh joined 21:25 xinming left 21:27 rba left, rba joined, xinming joined 21:46 xinming left 21:48 xinming joined 22:12 Sgeo joined 22:21 Maylay left, Maylay joined 22:59 lizmat_ left, lizmat joined 23:15 teatwo left 23:17 teatime joined 23:18 tobs left 23:35 tobs joined 23:48 nick55 joined, moritz joined 23:49 nick55 left