00:05
arkiuat joined
00:13
arkiuat left
|
|||
Voldenet | it's not actually impossible to compile raku into binaries - in fact given some specific AST it's possible to write C directly from it | 00:16 | |
generating C from tiny subset of the language should be trivial due to having built-in parser for it | 00:19 | ||
for example "all types must be defined, only Str and Int are supported, only simple subs" should be relatively easy, types for scopes, signatures would need to be practically implemented in C | 00:24 | ||
otoh, scopes, dynamic variables, await can't be written in trivial C, so that'd require bundling the whole raku runtime - it's not impossible to generate bytecode and use this path | 00:27 | ||
00:27
arkiuat joined
|
|||
Voldenet | at some point I was planning to build some poc of embeddable raku (something like PerlInterpreter), it would definitely make this more feasible | 00:30 | |
arkiuat | some Str somewhere isn't getting initialized. I think this is the kind of thing that made me flee *brew and scurry back into MacPorts (which hasn't updated rakudo since v2025.05) | 00:33 | |
Voldenet | hm, is there any stack trace? | 00:34 | |
01:03
notable6__ joined,
quotable6 left,
notable6 left,
bisectable6 left,
linkable6 left,
Ekho left,
cryosis left,
unicodable6 left,
sourceable6__ left,
coverable6 left,
benchable6 left,
releasable6 left,
quotable6 joined,
bisectable6 joined,
linkable6 joined
01:04
nativecallable6_ left
01:05
nativecallable6 joined,
zetaaaa_ left,
Sgeo__ joined
01:06
cryosis joined,
Ekho joined
01:07
benchable6 joined
01:08
Sgeo_ left
|
|||
arkiuat | Nope, it's a compilation error | 01:08 | |
pointing to /private/var/folders/p2/ with what look like hashes in the rest of the path | 01:09 | ||
It happened most recently when I was installing ValueType and then later with App::Ecosystems | 01:11 | ||
just now I tried "zef install rakudoc" -- same compilation error | 01:12 | ||
perhaps when I decided to try *brew again, I needed to thoroughly eradicate MacPorts from my system first. Not sure that I've done that correctly | 01:14 | ||
okay, this is fun. I just used rakubrew to switch from v2025.08 back to v2025.05, and now ValueType just installed with no problem, and rakudoc is installing | 01:18 | ||
installed successfully, and now installing App::Ecosystems. So this seems to be a bug introduced in v2025.08 maybe? | 01:19 | ||
01:21
hulk joined,
kylese left
01:22
zetaaaa_ joined
|
|||
arkiuat | that failed, but for a much more graspable reason: expected module eigenstates v0.0.11 but got eigenstates v0.0.12 | 01:22 | |
01:29
nine left
01:30
nine joined
|
|||
Voldenet | hmm, ValueType doesn't have very large test, maybe it could be further reduced to one line | 01:32 | |
arkiuat | yes, that's a good tip | 01:59 | |
the compilation error singled out line 2 of the single test file, which is "use Test" which would certainly explain why this is happening across all modules! | 02:04 | ||
however, "raku -MTest" under v2025.08 starts up with no problem | 02:06 | ||
02:15
hulk left,
kylese joined
02:49
zetaaaa_ left
03:08
arkiuat left
03:20
arkiuat joined
03:24
arkiuat left
03:25
dg left
03:26
dg joined
03:44
arkiuat joined
03:54
arkiuat left
04:36
Aedil joined
05:22
phogg left
05:27
phogg joined
06:26
Geth left
06:27
Sgeo__ left
06:28
kylese left
06:29
kylese joined
06:45
quotable6 left,
cryosis left,
quotable6 joined,
bisectable6 left
06:57
dg left,
timo2 left,
timo2 joined
|
|||
disbot9 | <simon_sibl> I am not sure to understand the do whenever at docs.raku.org/type/IO/Socket/Async/ListenSocket why is the do required, why is the return value handled that way ? | 06:58 | |
07:00
dg joined
07:10
tadzik joined
07:13
merpp left,
merp joined
|
|||
disbot9 | <simon_sibl> also, will Raku recognize such instruction and use sendfile or similar trick: $socket.write($path.IO.slurp(:bin)) ? or it will slurp the whole file in memory and only then send it through the socket ? | 07:48 | |
<simon_sibl> or linked to that question, would it be possible to lazily read a file, pipe it through a base64 generator and lazily send that output through a socket ? | 07:50 | ||
08:09
dakkar joined
08:44
Maylay left
08:46
lichtkind_ joined
08:47
Maylay joined
09:23
mimosa_ joined
09:32
mimosa_ left
09:33
mimosa joined
|
|||
ab5tract | .IO.lines is lazy already, IIRC | 10:15 | |
`do` is a way of evaluating an expression into its sunk value. so here it's a sort of conditional `await` | 10:16 | ||
FWIW, I've never seen that in the wild and I think it fails a docs smell test of only demonstrating as few language features at a time in an example | 10:17 | ||
lizmat | simon_sibl afaik, sendfile is out of reach at the moment: but I have set up irclogs.raku.org to be able to use that as soon as it becomes possible | 10:19 | |
although I think it will more become something like: $socket.sendile($path) | 10:20 | ||
*sendfile | |||
10:31
ds7832 joined
11:12
Geth joined
12:32
apa_c joined
13:27
ds7823 joined
13:30
ds7823 left,
ds7832 left
13:31
ds7832 joined
13:38
ds7832 left
13:39
ds7823 joined
13:41
ds7823 left
13:43
ds7823 joined
|
|||
disbot9 | <jubilatious1_98524> I don't understand that do either. Usually I see do before a for loop, not within a block. | 14:10 | |
14:12
Sgeo joined
|
|||
disbot9 | <librasteve> Technically, do is a loop which runs exactly one iteration. .oO | 14:15 | |
<librasteve> [I have used do a bit but never really understood what it does] | |||
14:15
ds7823 left,
apa_c left
|
|||
disbot9 | <jubilatious1_98524> Don't we have once for that? | 14:16 | |
<librasteve> I am quoting the docs - docs.raku.org/language/control#do ... doesn't mean that I have any clue what they mean! | |||
<jubilatious1_98524> I've used do to send the return of a for loop into a LHS assignment, usually overwriting the same object I started from. | 14:18 | ||
14:21
arkiuat joined
|
|||
ab5tract | I hadn't ever considered `do` a looping construct. otherwise `do for` wouldn't make sense | 14:25 | |
once is per-scope. It can be used in a loop or outside of one | 14:26 | ||
`do` is a statement prefix modifier that turns an expression into a value | |||
disbot9 | <jubilatious1_98524> m:my @a = "a".."e"; @a = for @a { $_.uc }; say @a; | ||
<Raku eval> Exit code: 1 ===SORRY!=== Word 'for' interpreted as a listop; please use 'do for' to introduce the statement control word at /home/glot/main.raku:1 ------> my @a = "a".."e"; @a = for⏏ @a { $_.uc }; say @a; Unexpected block in infix position (two terms in a row) at /home/glot/main.raku:1 ------> my @a = "a".."e"; @a = for @a⏏ { $_.uc }; say @a; | |||
ab5tract | m:my @a = "a".."e"; @a = do for @a { $_.uc }; say @a; | 14:27 | |
evalable6 | [A B C D E] | ||
disbot9 | <jubilatious1_98524> m: my @a = "a".."e"; @a = do for @a { $_.uc }; say @a; | ||
<Raku eval> [A B C D E] | |||
<librasteve> yeah - I read that do for returns the value of the last iteration (better go review what my do fors are doing!) | |||
ab5tract | sorry if I got that impression. I was referring to the final value in the statement list | ||
arkiuat | I've always thought of do as "what you use when you want to obtain the return value of a control statement usually evaluated in sink context" | 14:28 | |
ab5tract | but it's probably not a good way to explain it | ||
arkiuat: well said | 14:29 | ||
arkiuat | as for my zef install issues, I've had to fall back from v2025.08 to v2025.05 because at least I can install modules on it | ||
disbot9 | <librasteve> I am having a few niggles with installs atm | 14:30 | |
<librasteve> but does seem to be around 2025.08 / 2025.05 boundary ... | 14:31 | ||
librasteve_ | m: say do for ^3 {$++} | 14:47 | |
camelia | (0 1 2) | ||
librasteve_ | m: say for ^3 {$++} | 14:48 | |
camelia | ===SORRY!=== Error while compiling <tmp> Unsupported use of bare "say". In Raku please use: .say if you meant to call it as a method on $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun. at <tmp>:1 -… |
||
disbot9 | <librasteve> yeah - that's what I expected do for to do (ie do the for loop and return the results as a List) | 14:49 | |
<librasteve> weekly: unix.stackexchange.com/questions/3...463#800463 | 14:51 | ||
<librasteve> lools like the weekly bot is down here (Discord) | 14:52 | ||
librasteve_ | weekly: unix.stackexchange.com/questions/3...463#800463 | ||
notable6__ | librasteve_, Noted! (weekly) | ||
librasteve_ | but not here (IRC) | ||
arkiuat | I've been using do + given a lot lately | 14:53 | |
do + given-when, I should say | 14:54 | ||
14:55
apa_c joined
|
|||
arkiuat | ab5tract, thanks! | 14:56 | |
and by a lot, I mean two or three times, which only seems like a lot because it's a new usage for me | 14:57 | ||
14:57
guifa joined
15:01
apa_c left
|
|||
disbot9 | <librasteve> yeah it took me a while to get into it ... such as | 15:02 | |
<librasteve> my @todos = do for <one two> -> $text { Todo.new: :$text }; | |||
arkiuat | librasteve, that stackexchange example has me wondering if the one-and-only distinction between for and given is that given doesn't loop | 15:03 | |
15:03
abraxxa left
|
|||
disbot9 | <librasteve> that's how it feels to me | 15:03 | |
lizmat | m: .say for 42 | 15:04 | |
camelia | 42 | ||
arkiuat | I don't think I've ever used for-when yet | ||
lizmat | m: .say given 42 | ||
camelia | 42 | ||
lizmat | m: .say for (1,2,3) | ||
camelia | 1 2 3 |
||
lizmat | m: .say given (1,2,3) | ||
camelia | (1 2 3) | ||
disbot9 | <librasteve> I think the only thing given does is to set the topic afaik | ||
lizmat | indeed | 15:05 | |
arkiuat | lizmat, oh, very interesting | ||
lizmat | and it will not iterate on iterables | ||
arkiuat | so that's a second difference, thanks | ||
disbot9 | <librasteve> .oO (gee I love this language!) | ||
arkiuat | and that totally makes sense, given the close connection between looping and wanting to iterate over iterables vs treating an iterable as an item | 15:06 | |
that makes the distinction between for and given a lot clearer for me | 15:07 | ||
librasteve, so I guess a series of whens followed by a default (with scattered proceeds and succeeds as needed) would work inside any topic-setting control syntax? | 15:09 | ||
lizmat | m: $_ = 42; when 42 { say "success" } | 15:10 | |
camelia | success | ||
arkiuat | Nice. | ||
disbot9 | <librasteve> I bow to lizmat in all matters, natch | 15:11 | |
15:12
apa_c joined
|
|||
arkiuat | that's incredibly flexible | 15:14 | |
I am going to be on the lookout for opportunities to use for-when now! | 15:17 | ||
15:18
apa_c left
|
|||
arkiuat | thanks, lizmat | 15:21 | |
disbot9 | <jubilatious1_98524> @arkiuat I wrote it both ways, given/when and for/when, nd finally decided to post the for/when version. | 15:54 | |
arkiuat | I'm glad you did! | ||
disbot9 | <jubilatious1_98524> m: $_ = 43; when 43 { say "success" }; | 16:06 | |
<Raku eval> success | |||
<jubilatious1_98524> m: $_ = 43; when none 42 { say "failure" }; | |||
<Raku eval> failure | |||
<jubilatious1_98524> Use none to negate. | 16:07 | ||
arkiuat | that's certainly more elegant-looking than when $_ ne 42, but I expect non-rakuuns are going to cite as yet another of Raku's weird idioms | 16:16 | |
sorry, meant !=, not ne | |||
disbot9 | <jubilatious1_98524> m: $_ = 43; when $_ != 42 { say "failure" } | 16:23 | |
<Raku eval> Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Confused at /home/glot/main.raku:1 ------> $\⏏_ = 43; when $_ != 42 { say "failure" } | |||
<jubilatious1_98524> m: $_ = 43; when $_ != 42 { say "failure" } | 16:24 | ||
<Raku eval> Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Confused at /home/glot/main.raku:1 ------> $\⏏_ = 43; when $\_ != 42 { say "failure" } | |||
<jubilatious1_98524> Bot interprets $ ... $ as italics (markdown). Anyway $_ != 42 works also. | 16:25 | ||
16:29
dakkar left
17:00
arkiuat left
17:05
arkiuat joined
|
|||
arkiuat | yes, but none 42 looks prettier | 17:13 | |
disbot9 | <librasteve> I recommend back ticks as in m: code when in discord | 17:14 | |
Voldenet | btw, "none" isn't even the same thing | 17:20 | |
disbot9 | <jubilatious1_98524> Thanks Steve. | ||
Voldenet | under the hood I mean, it's a lot more complicated than plain != | 17:22 | |
disbot9 | <jubilatious1_98524> m: my @a = "a".."e"; @a.grep( {! /f/ } ).say; | 17:23 | |
<Raku eval> (a b c d e) | |||
Voldenet | m: given 42 { when * != 42 { say "failure" }}; # another way of writing it | ||
camelia | ( no output ) | ||
disbot9 | <jubilatious1_98524> m: my @a = "a".."e"; @a.grep( none /f/ ).say; | ||
<Raku eval> (a b c d e) | |||
<jubilatious1_98524> m: my @a = "a".."e"; @a.grep( none /e/ ).say; | 17:24 | ||
<Raku eval> (a b c d) | |||
Voldenet | m: sub x(Mu $x) { say $x }; x none 42; | 17:25 | |
camelia | none(42) | ||
Voldenet | it's useful, but plain op for "not equals" can't do the above, for example | 17:26 | |
disbot9 | <jubilatious1_98524> Why are you complicating things by creating a sub? | ||
Voldenet | Obviously to show that you can complicate things by complicating them ;) | 17:27 | |
disbot9 | <jubilatious1_98524> [ BTW, grep examples are straight from the Docs ]. | ||
Voldenet | huh, I've checked and apparently grep(none /f/) is faster | 17:30 | |
so apparently in some cases junctions are even faster than simple negation | 17:32 | ||
I can guess that the `none /e/` doesn't even create a block and blocks aren't cheap | |||
disbot9 | <jubilatious1_98524> m: $ = 43; when $ eq none 42 { say "failure" }; | 17:34 | |
<Raku eval> failure | |||
<jubilatious1_98524> The Junction page suggests: "In general it is more readable to use a positive comparison operator and a negated junction". | 17:35 | ||
Voldenet | hm, I remember there was some weird gotcha about negated junctions | 17:38 | |
m: say none([]) != 42 | 17:39 | ||
camelia | False | ||
Voldenet | which means that the array contains value 42… | 17:41 | |
so I tend to avoid junctions, because I simply don't understand the why behind it | 17:42 | ||
arkiuat | well, not exactly. It means that none of the values are unequal to 42, and there are no values, so none of them are | 17:43 | |
neither != nor ne will accept Nil as an arg | 17:44 | ||
Voldenet | I understand technically, but I intuitively would use it wrong | 17:45 | |
arkiuat | oh wait, I'm wrong. It complains with an error msg, but: | ||
m: say so Nil != 42 | |||
camelia | Use of Nil in numeric context True in block <unit> at <tmp> line 1 |
||
arkiuat | it does return True. Huh. | ||
Voldenet | m: say so 42 (elem) [] # this is what I prefer | 17:47 | |
camelia | False | ||
arkiuat | sure, that's much clearer | ||
Voldenet | and | 17:48 | |
m: say so 42 !(elem) [] | |||
camelia | True | ||
Voldenet | otoh when there's no negation, it works as I'd expect | 17:49 | |
m: say none() eq 42 | 17:50 | ||
camelia | none() | ||
Voldenet | m: say so none() eq 42 | ||
camelia | True | ||
arkiuat | now I'm even more confused | 17:57 | |
Voldenet | hehe, I know right? :) | 17:59 | |
the trick is in how negation is implemented | |||
it simply does !($op1 eq $op2) | 18:00 | ||
so in case of negated junctions… it actually finds equal values and negates the result | |||
18:00
[Coke]_ joined
18:03
[Coke] left
|
|||
lizmat | Voldenet arkiuat github.com/Raku/problem-solving/issues/319 | 18:10 | |
arkiuat | lizmat, thanks! | 18:14 | |
oh no, and I just told tbrowder the other day that !(elem) is equiv to ∉ | 18:19 | ||
I suppose in most context it still is | |||
lizmat | yeah, it is (usually) | ||
arkiuat | so it looks as if some of the confusing behavior we were discussing will change in 6.e | 18:23 | |
lizmat | it does ? | 18:35 | |
arkiuat | okay, that's surmising too much. there are some unmerged PRs outstanding that haven't been closed that *seem* to address at least part of the issue | 18:38 | |
disbot9 | <jubilatious1_98524> @Voldenet are you equating say so none() eq 42 with say so $_ eq none 42? | ||
arkiuat | but the main one is still marked DRAFT, so definitely surmising too much | ||
18:40
silug4 left
18:41
silug4 joined
19:28
guifa left
19:30
disbot10 joined
19:31
charsbar_ joined,
dano2 joined
19:32
guifa joined,
ab5tract_ joined,
oodani joined,
gabiruh joined
19:33
[Coke]_ is now known as [Coke]
19:34
greaser|q_ joined
19:35
sivoais_ joined,
andinus2 joined
19:36
ab5tract left,
camelia left,
charsbar left,
ab5tract_ is now known as ab5tract,
ugexe left,
oodani_ left,
disbot9 left,
andinus left,
dano left,
gabiruh_ left
19:37
greaser|q left,
sivoais left,
dano2 is now known as dano,
charsbar_ is now known as charsbar
19:38
linkable6 left,
greppable6__ left,
committable6 left,
benchable6 left,
nativecallable6 left,
notable6__ left,
quotable6 left,
bloatable6 left,
evalable6 left
19:40
shareable6 joined,
linkable6 joined,
releasable6 joined,
bloatable6 joined
19:41
committable6 joined,
greppable6 joined,
tellable6 joined,
evalable6 joined,
bisectable6 joined
19:42
coverable6 joined,
sourceable6 joined
19:43
unicodable6 joined,
benchable6 joined,
nativecallable6 joined,
notable6 joined,
quotable6 joined
19:44
Aedil left
19:47
ugexe joined,
jdv joined
19:51
camelia joined
20:00
camelia left
20:07
arkiuat left
20:08
apa_c joined
20:19
arkiuat joined
20:23
camelia joined
20:24
arkiuat left
20:38
stanrifkin joined
20:39
melezhik_ joined
|
|||
melezhik_ | . | 20:39 | |
20:39
arkiuat joined
20:41
itaipu left
20:47
melezhik_ left,
melezhik_ joined
|
|||
arkiuat | seen on another channel: "rak will rename with `git mv' if it sees the file is under git control" <-- this is super cool | 20:48 | |
lizmat++ | |||
20:49
itaipu joined
|
|||
Voldenet | jubilatious1_98524: Yes, `none of elements () is equal to 42` and `from () none is equal to 42` sound very similar to me, but that only works with these specific operands | 21:03 | |
but it might be that I'm not seeing something, I'm not very fluent in junctions | 21:05 | ||
I still prefer the code I know best from C#, so explicitly checking if element is in collection or if it matches some predicate | 21:07 | ||
21:10
Manifest0 joined
21:11
ds7832 joined
21:15
lichtkind_ left
21:18
melezhik_ left
22:00
halloy2489 joined,
arkiuat left
22:06
arkiuat joined
22:10
ds7823 joined
22:16
apa_c left
22:21
ds7832 left
22:38
halloy2489 left,
Geth left
22:40
itaipu left
22:45
itaipu joined
22:49
ds7823 left
22:52
ds7832 joined
|
|||
disbot10 | <jubilatious1_98524> m: $ = 43; say so $ == none(42); | 22:55 | |
<Raku eval> True | |||
<jubilatious1_98524> m: $ = 43; say $ ~~ none(42); | |||
<Raku eval> True | |||
23:16
librasteve_ left
|