🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm Set by lizmat on 8 June 2022. |
|||
02:06
Voldenet left
02:08
Voldenet joined
|
|||
Geth | rakudo/main: 3e15093fa0 | ab5tract++ | src/core.c/Main.rakumod Small revision to the fix for R#5875 Unlike the PseudoStash lookups, we do not need to use `try` to guard the lookup into the `%caller-my` hash. Also, the previous phrasing was actually equivalent to: ... (5 more lines) |
11:52 | |
linkable6 | R#5875 [open]: github.com/rakudo/rakudo/issues/5875 [good first issue][enumerations][objects] Success in enum resolution during &MAIN invocation depends on declaration scope of the enum. | ||
lizmat | ab5tract: "that asking a hash for a missing key will never produce an exception" s/hash/ordinary hash/ | 11:55 | |
tellable6 | 2025-05-11T09:47:09Z #raku-dev <nine> lizmat: thanks for the quick review :) | ||
lizmat | nine: you're welcome | 11:56 | |
ab5tract | ah, the brain isn't working great today | ||
I was trying to come up with the right adjective and "core" didn't feel right | |||
could also have chosen "this hash" | |||
lizmat: is it worth me amending and force pushing? | |||
lizmat | no, it is not :-) | ||
just wanted to make sure that conceptually speaking, all hashes in Raku are what Perl would call "tied hashes", so any behaviour can go there | 11:57 | ||
and to be more precise: any class doing the Positional role | 11:58 | ||
and to be even more reality based: any class providing an AT-KEY method | |||
m: class A { method AT-KEY($) { 42 } }; say A<foo> | 11:59 | ||
camelia | 42 | ||
ab5tract | and of course my reasoning is actually wrong.. | 12:03 | |
because if `a` is undefined.... | |||
ahh, nevermind, it looks like I'm bumping up against the "classic" issue of subsets being kind of kneecapped when coupled with named args | 12:09 | ||
m: subset S where Nil | "ok"; sub foo(S :$grr) { say "rawr!" }; foo | 12:13 | ||
camelia | Constraint type check failed in binding to parameter '$grr'; expected S but got Any (Any) in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Geth | roast: 74e5b11ebb | ab5tract++ | S06-other/main.t Add tests to cover imported names in MAIN signatures Tests added to prevent regressions for the recent fix to R#5875. |
12:16 | |
linkable6 | R#5875 [open]: github.com/rakudo/rakudo/issues/5875 [good first issue][enumerations][objects] Success in enum resolution during &MAIN invocation depends on declaration scope of the enum. | ||
ab5tract | At the very least it would be nice to fix the LTA error message to say something like "named arguments with subset types require a conformant default value" or something lik this | 12:17 | |
Did we ever decide on the mechanism to access the AST of an object? ISTR the Q| |.AST mechanism isn't necessarily sticking around | 12:20 | ||
lizmat | no decision has been made afaik | 12:21 | |
ab5tract | ack | ||
probably it's better to do a type check on the HOW anyway | 12:22 | ||
nine | "AST of an object" doesn't make much sense anyway | 12:23 | |
lizmat | .tell melezhik looks like the link for the discord channel is incorrect | 12:27 | |
tellable6 | lizmat, I'll pass your message to melezhik. | ||
lizmat | notable6: weekly | 12:42 | |
notable6 | lizmat, 2 notes: 2025-05-09T18:10:29Z <melezhik>: sparrowdo.wordpress.com/2025/05/09...jobs-flow/ ; 2025-05-12T07:35:47Z <librasteve>: rakujourney.wordpress.com/2025/05/...ntic-time/ | ||
lizmat | notable6: weekly reset | ||
notable6 | lizmat, Moved existing notes to “weekly_2025-05-12T12:42:32Z” | ||
ab5tract | nine: so often I read your messages and miss a second, explanatory, phrase :) | 12:44 | |
but you are right, of course, as usual | 12:47 | ||
the "AST of an object" is really the AST of the expression of the object, not so useful for my purposes indeed | 12:48 | ||
unfortunately the stack trace for `./rakudo-m --ll-exception -e 'subset S of Int where * > 5; sub s(S :$s) { say "hi" }; s'` doesn't contain any obvious places for attaching a better error message | 12:53 | ||
removing `of Int` is more promising, but I'm starting to see why this hasn't been addressed successfully yet | 12:55 | ||
nine | TBH I don't see the big problem with that error message anyway. | 13:02 | |
13:14
guifa left,
guifa joined
|
|||
lizmat | and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2025/05/12/2025-...c-in-time/ | 13:19 | |
ab5tract | nine: I think it's completely broken to allow Int $i but not SubsetX $x | 13:21 | |
sorry, :$i and :$x respectively | |||
the least we can do is inform the user to provide conformant default value | |||
either we have LTA as a goal or we don't, but throwing "Uninitialized value used in ..." is not helpful | 13:24 | ||
nine | Well that *is* what happens. | 13:25 | |
ab5tract | but simply fixing the binder to just return success when the param is a subset and the value is Mu should also be fine (if my tiredness isn't affecting things) | ||
because if they explicitly allow for Mu, the bind success is true anyways | |||
and if not, the way we specify that an argument is required is with ! | 13:26 | ||
(anmed argument) | |||
nine | Wouldn't a compile time warning or error be more appropriate? Having an optional argument that would lead to certain failure unless provided makes little sense. | ||
ab5tract | this is a runtime issue though, afaict? | 13:27 | |
nine | Why? | ||
ab5tract | unless you mean we compile time error for any subset that isn't explicitly Mu || * | ||
My point is simple: DWIM for named arguments means optional | 13:28 | ||
I do not expect my optional arguments to be type checked. Only subsets seem to suffer from this | |||
13:28
guifa_ joined
|
|||
ab5tract | *type checked when no value is provided | 13:29 | |
nine | As you said: "the least we can do is inform the user to provide conformant default value". As it is the sub's signature as declared makes little sense. $s is optional but you will absolutely get an error unless you supply it | ||
ab5tract | That's why it is stupid | ||
Int works. User defined classes work | |||
nine | Because those do have a default value. What do you expect say $s to do when $s hasn't been provided? | ||
ab5tract | I honestly could care less | 13:30 | |
Mu is fine | |||
nine | a default value that actually fits their type constraint | ||
13:30
guifa left
|
|||
nine | That would then be a case where a variable has an explicitly declared type but the value does not fit that type constraint. I don't think we have that anywhere else and it would be highly surprising. | 13:31 | |
ab5tract | the whole issue here is that subsets aren't proper types | ||
nine | Bad enough that the compiler lets us write code that violates type constraints and lets us reap the explosion at runtime. But if types are then not even checked at runtime, what's the point of having them in the first place? | 13:32 | |
ab5tract | otherwise we would just hand over the type object of the subset | ||
so in my opinion, using of would be fine there | |||
Mu by default, whatever the user specified the subset of otherwise | 13:33 | ||
but backing up, I see what you mean about the compile time warning now | |||
Sorry, the wheels are turning slowly today | |||
so just to make sure I'm headed in the right direction: if a subset-based named argument isn't declared as required && this argument doesn't have a conformant default value, then explode? | 13:37 | ||
nine | Yes. At least warn under those conditions. | ||
ab5tract | Cool! That feels like some relatively lightweight RakuAST hacking, which would be a nice change of pace | 13:39 | |
nine | And something that might ease you into a bit more invovled RakuAST hacking to fix make install? | 13:43 | |
14:17
guifa_ left
14:19
guifa joined
|
|||
ab5tract | nine: yeah, a bit of an onramp so to speak | 14:47 | |
I have a tiny bit of poking already into | |||
the "$_ missing from outer" issue | |||
[Coke] | kicked off blin run | 15:33 | |
Looks like a small release this week. | |||
releasable6: next | |||
releasable6 | [Coke], Next release in ≈5 days and ≈3 hours. There are no known blockers. 12 out of 13 commits logged | ||
[Coke], Details: gist.github.com/add1ff4d08c69da380...373eee4502 | |||
18:33
melezhik joined
|
|||
melezhik | maybe someone ( who does AST development ) find this report useful - sparky.sparrowhub.io/report/gh-mel...tool/24592 | 18:34 | |
r3 tests for Rakudo with AST enabled | |||
nine | melezhik: Perl6::Metamodel::ClassHOW should be Metamodel::ClassHOW | 18:35 | |
melezhik | yeah, but the test does check that | 18:37 | |
[Coke] | nine++ | ||
melezhik | it only runs " my sub word-bytes(Int:D $word --> List:D[Int]) { }" and get this exception | ||
[Coke] | ⏳ 657 out of 2310 modules processed (28.44%) | ||
nine | melezhik: what do you mean by "the test does check that"? | ||
melezhik | I meant does NOT check | ||
nine | Ah, then --ll-exception would be more helpful | 18:38 | |
melezhik | the test actually replicates github.com/rakudo/rakudo/issues/1411 | ||
sure I can add | 18:39 | ||
nine | Cannot reproduce that locally: | 18:40 | |
> RAKUDO_RAKUAST=1 ./rakudo-m -e 'my sub word-bytes(Int:D $word --> List:D[Int]) { }' | |||
===SORRY!=== Error while compiling | |||
List cannot be parameterized | |||
melezhik | what's raked version? | 18:43 | |
timo | oh, List:D[Int], interesting | ||
i'm not sure if i would have expected that to have to be List[Int]:D | |||
melezhik | in test this is 2025.03 | ||
however I have just build 2025.04 and run against it | 18:44 | ||
raked -> rakudo | |||
nine | main branch or bootstrap-rakuast? | ||
melezhik | I build from source ( 2025.3, 2025.r etc ) and then run with RAKUDO_RAKUAST=1 just in case | 18:45 | |
2025.r -> 2025.4 | |||
just in case I get source straight from rakudo.org/downloads | 18:46 | ||
full details about rakudo could be found in here - sparky.sparrowhub.io/file_view/gh-...akuenv.txt | 18:47 | ||
( report -> artifacts -> rakuenv.txt -> view ) | |||
ok, for rakudo 2025.4 exception is now - "List cannot be parameterized" - sparky.sparrowhub.io/report/gh-mel...tool/24597 | 18:48 | ||
which is probably expected ? | |||
and I have added --ll-exception option. for this test | 18:49 | ||
you might be interested in other failed tests? like "Cannot find method 'PRECURSOR' on object of type QAST::Op" etc | 18:50 | ||
actually only 3 tests failed | |||
also test #4278 - No such method 'meta-object' for invocant of type 'RakuAST::Declaration::Import' | 18:52 | ||
replicates github.com/rakudo/rakudo/issues/4278 | |||
releasable6 | Next release in ≈4 days and ≈23 hours. There are no known blockers. Please log your changes in the ChangeLog: github.com/rakudo/rakudo/wiki/ChangeLog-Draft | 19:00 | |
19:06
melezhik left
|
|||
timo | can't wait for someone to override the "return" method on an object and cause code that is meant to not run after a "return" statement to actually unexpectedly run after all | 19:11 | |
Geth | rakudo/enhance-named-param-subset-feedback: 87e1dbdc15 | ab5tract++ | 2 files Enhance feedback around named subset parameters Adding a worry here provides users with a bit of helpful feedback when they define an optional named parameter with a subset type but fail to provide a valid default value. Default values are also checked for conformance to the provided subset, with the obvious caveat that an expression without a compile time value will pass through this protection. |
21:00 | |
rakudo: ab5tract++ created pull request #5879: Enhance feedback around named subset parameters |
|||
ab5tract | RakuAST 🤌 (should be :chefs-kiss:) | 21:03 |