00:28
PotatoGim left
00:30
PotatoGim joined
00:41
[Coke] left
01:07
yewscion_ joined
01:12
yewscion_ left
01:39
silug left,
silug joined
01:55
habere-et-disper joined
02:06
hulk joined
02:07
kylese left
02:29
habere-et-disper left
02:38
[Coke] joined
02:40
yewscion_ joined
02:49
yewscion_ left
03:15
hulk left,
kylese joined
04:20
Aedil joined
04:30
kylese left
04:33
kylese joined
04:48
maylay left
04:51
maylay joined
05:30
kylese left
05:31
kylese joined
05:40
Aedil left
05:45
Aedil joined
06:19
Sgeo left
|
|||
melezhik. | . | 06:32 | |
06:43
maylay left
06:46
maylay joined
|
|||
Voldenet | grondilu: I think you're right - posted code should work | 07:14 | |
07:15
apac left
|
|||
Voldenet | m: class A { method !foo { "bar" }; class B { method x { A.new!foo } } }; A::B.new.x | 07:17 | |
camelia | ===SORRY!=== Error while compiling <tmp> No such private method '!foo' for invocant of type 'A::B' at <tmp>:1 ------> o { "bar" }; class B { method x { A.new!<HERE>foo } } }; A::B.new.x |
||
Voldenet | very similar code in C# works, so that is definitely sane behavior dotnetfiddle.net/GQiPxf | 07:25 | |
and also works in java | |||
librasteve | Voldenet: (and grondilu), the docs are quite expansive on how raku differs from other languages … Unlike in some languages where private is an accessibility modifier on a method, in Raku "private methods" and "methods" are quite different things - that is to say, it's better to read "private method" as a compound noun rather than an adjective describing a noun. | 08:00 | |
that is not to say that you are wrong, since I do not claim to understand the raku design well enough, or to know the reason why the docs say that | 08:01 | ||
I suspect it may boil down to “we need a way to do fully private things in raku since “my” variables cannot be hidden from outer scopes” or maybe “a module is a class, so we want to suppress lexical scoping across module boundaries” … as I say I don’t know and this is wild speculation… I’m not that deep into using private methods so I could live with changing/fixing this providing it is clear | 08:07 | ||
and simple either way :-) | |||
08:25
Guest52 joined
08:26
Guest52 left
|
|||
lizmat | you probably should think of private methods as lexically scoped subs that have an implicit invocant "self" specified as the first positional argument | 08:47 | |
Voldenet | librasteve: Well, hence "I think", I'm not very fixated on this - syntactically the class being inside of the other should have access to things on the same level IMO, but those details are not the same even in java/kotlin/C# | 08:49 | |
I feel like there's no single idea on what's the point of subclasses in the first place | 08:50 | ||
08:51
wayland joined
|
|||
Voldenet | but it might be difficult to say (a'la C++): I want class B and C to be friends of A and have access to its private methods, but other parts of code should not have this access | 08:53 | |
grondilu | The thing is, even if I define the nested class inside the definition of a method of the outer class, the private call still fails. This is odd to me. The private call works, unless it's inside a local class? | 09:01 | |
m: class A { method !foo {}; method bar { class B { method x { A.new!foo } } } }; | 09:02 | ||
camelia | ===SORRY!=== Error while compiling <tmp> No such private method '!foo' for invocant of type 'A::B' at <tmp>:1 ------> method bar { class B { method x { A.new!<HERE>foo } } } }; |
||
grondilu | ^see? | ||
besides there is no reason raku should think the method is called by an invocant of type A::B and not A, is there? | 09:03 | ||
golfing it even more: | 09:04 | ||
m: class { method !foo {}; method bar { class{ method x { A.new!foo } } } }; | |||
camelia | ===SORRY!=== Error while compiling <tmp> Whitespace required after keyword 'class' at <tmp>:1 ------> ass { method !foo {}; method bar { class<HERE>{ method x { A.new!foo } } } }; |
||
grondilu | oops | ||
m: class { method !foo {}; method bar { class { method x { A.new!foo } } } }; | |||
camelia | ===SORRY!=== Error while compiling <tmp> Undeclared name: A used at line 1 |
||
grondilu | nevermind | 09:05 | |
m: class A { method !foo {}; method bar { class { method x { A.new!foo } } } }; | |||
camelia | ===SORRY!=== Error while compiling <tmp> No such private method '!foo' for invocant of type '<anon|1>' at <tmp>:1 ------> ; method bar { class { method x { A.new!<HERE>foo } } } }; |
||
grondilu | m: class A { method !foo {}; method bar { my &foo = { A.new!foo }; class { method x { foo } } } }; | 09:07 | |
camelia | ( no output ) | ||
grondilu | ^that would be a workaround, I guess. | ||
m: lass A { class B {...}; trusts B; method !foo {}; method bar { class B { method x { A.new!A::foo } } } } | 09:11 | ||
camelia | ===SORRY!=== Error while compiling <tmp> No such method 'add_trustee' for invocant of type 'Perl6::Metamodel::PackageHOW' at <tmp>:1 |
||
grondilu | m: class A { class B {...}; trusts B; method !foo {}; method bar { class B { method x { A.new!A::foo } } } } | ||
camelia | ( no output ) | ||
grondilu | ^or this | ||
Voldenet | oh, raku has "trusts", huh | 09:12 | |
patrickb | I think I'm facing a Native all bug. paste.sr.ht/~patrickb/1de35011b308...634f1739b1 | ||
On Linux both the C and the Raku version work fine. On an ARM MacOS the C version works, but in the MacOS Version the ioctl call succeeds, but does not update the $size struct. | 09:14 | ||
09:14
melezhik joined
|
|||
melezhik | .tell patrickb: you might be interested in this - sparky.sparrowhub.io/report/~patri...-API/24326 HTH | 09:15 | |
tellable6 | melezhik, I'll pass your message to patrickb | ||
patrickb | Any clues on how to best debug this? Any best guesses as to which component is the most potential offender? | ||
melezhik | sorry you are talking about this? "[Terminal-API] get-config failed" ? | 09:16 | |
patrickb | No. This is about get-win-size and it only affects MacOS. | 09:17 | |
wayland | Hi all! I asked a question about a month ago about operators that take multiple parameters. I've written a short gist about what I'm trying to achieve at gist.github.com/wayland/2876a7c8ef...24ad9ed8c7 . If anyone has ideas about how I could achieve these things, I'd be interested to hear about it :) | ||
Voldenet | patrickb: I'd build C library that'd set the struct's property without ioctl and see if that works | 09:21 | |
melezhik | sure, np | 09:23 | |
Voldenet | if not, then it's good test case, if it does, then it's ioctl-related somehow | ||
patrickb | I'll have to verify, but I'm pretty sure that's covered by the native all tests. I suspect it's related to ioctl being a vararg function. | ||
but yes, creating an isolated test case is a good idea. | 09:24 | ||
09:25
melezhik left
|
|||
Voldenet | wayland: you don't need an operator to take multiple parameters, `html⪪body⪪h1{.id eq "red"}` can be written as ((html⪪body)⪪h1).CALL-ME({ .id eq "red" }) | 09:31 | |
09:42
yewscion_ joined
|
|||
lizmat | m: class A { method CALL-ME(|) { say "hi" } }; say A() | 09:43 | |
camelia | (A(Any)) | ||
lizmat | m: class A { method CALL-ME(|) { say "hi" } }; say A.new() | ||
camelia | A.new | ||
lizmat | m: class A { method CALL-ME(|) { say "hi" } }; say A.new()() | ||
camelia | hi True |
||
lizmat | Voldenet: is the .CALL-ME needed there ? | 09:44 | |
09:46
librasteve_ joined
|
|||
librasteve_ | . | 09:46 | |
09:47
yewscion_ left
|
|||
Voldenet | hm | 09:49 | |
m: class h1 { method CALL-ME(&n) { n() } }; h1({ .say }) # I was expecting this to work without () | 09:51 | ||
camelia | (Any) | ||
Voldenet | m: class h1 { method CALL-ME(&n) { n() } }; h1 { .say } # but it doesn't | ||
camelia | ===SORRY!=== Error while compiling <tmp> Unexpected block in infix position (missing statement control word before the expression?) at <tmp>:1 ------> ss h1 { method CALL-ME(&n) { n() } }; h1<HERE> { .say } # but it doesn't expecting any o… |
||
Voldenet | h1 would work as a sub | 09:54 | |
09:57
melezhik joined
|
|||
librasteve_ | www.irccloud.com/pastebin/lv83BHqX | 09:57 | |
librasteve | ^^ I'm fixated on the grondilu thing and thus made a little snippet to try and get in my head what lizmat said in that context ... ultimately I think the thing that is confusing me is that grondilu original has a subclass that makes a new outer ... not sure that that would ever be something I would do (but then I guess there may be a reason like nested class trees) | 09:59 | |
anyway must to $day-job | 10:00 | ||
Voldenet | m: multi infix:<A>(&a, &b) {}; multi sub html() { -> {}; }; sub h1(&n) { -> { }; }; html A h1 { .id eq 'red' } | ||
camelia | ===SORRY!=== Error while compiling <tmp> Undeclared name: A used at line 1 |
||
Voldenet | this doesn't quite work | ||
m: multi infix:<A>(&a, &b) {}; multi sub html() { -> {}; }; sub h1(&n) { -> { }; }; (html) A h1 { .id eq 'red' } | |||
camelia | ( no output ) | 10:01 | |
wayland | Thanks Voldenet and lizmat. It seems I've been unclear. I've amended the gist to say "The elements such as body and h1 are supposed to be undeclared labels; you could equally well substitute in filenames if the tree in question happened to be a filesystem instead of a document." | 10:03 | |
That's why I said I could quote them if necessary. HTH, | |||
Voldenet | m: role N {}; multi infix:<A>(Str $a, Str $b) { N }; multi infix:<A>(N $a, Str $b) { N }; multi infix:<A>(N $a, Block $b) { N }; "html" A "head" A "h1" A { .id eq "red" } | 10:09 | |
camelia | ( no output ) | ||
10:13
sena_kun joined
|
|||
wayland | Voldenet: Thanks! That looks like my least bad option at the moment. | 10:13 | |
Voldenet | I'm not sure if for "xpath-like" operator it wouldn't be better to define some other operator | 10:14 | |
m: role N {}; multi infix:<A>(Str $a, Str $b) { N }; multi infix:<A>(N $a, Str $b) { N }; multi infix:<B>(N $a, Block $b) { N }; "html" A "head" A "h1" B { .id eq "red" } | 10:15 | ||
camelia | ( no output ) | ||
Voldenet | m: role N {}; multi infix:<A>(Str $a, Str $b) { N }; multi infix:<A>(N $a, Str $b) { N }; multi infix:<B>(N $a, Block $b) { N }; "html" A "head" A "h1" B { .id eq "red" } A "h2" B { .className eq "x1" } | 10:16 | |
camelia | ( no output ) | ||
Voldenet | m: role N {}; multi infix:<A>(Str $a, Str $b) { N }; multi infix:<A>(N $a, Str $b) { N }; multi infix:<A>(N $a, Block $b) { N }; "html" A "head" A "h1" A { .id eq "red" } A "h2" A { .className eq "x1" } # it works either way, but with B i feel that it's more readable | ||
camelia | ( no output ) | ||
Voldenet | and after all, no CALL-ME was needed | 10:17 | |
wayland | Voldenet: Yes, agreed about the separate operator; was thinking the same. | 10:18 | |
10:29
jpn joined
|
|||
Voldenet | wayland: btw, I read the second part after left join - RED was doing something similar and it leads to emitting proxies and making a lot of custom operators | 10:31 | |
however RakuAST might improve that dev.to/fco/the-future-of-red-orm-for-raku-44gf | 10:32 | ||
SmokeMachine | It still is doing that… the RakuAST implementation of Red is still in very early stages | ||
Voldenet | my overly positive news reporting style treats early stages as finishing touches ;P | 10:33 | |
10:34
melezhik left
|
|||
Voldenet | hm, thinking about how this could be passed this gives me an interesting idea, probably making xpath a lot simpler | 10:36 | |
m: sub xpath(*@n) {}; xpath "html", "head", "h1", { .id eq "red" }, "h2", { .className eq "x1" } | |||
camelia | ( no output ) | ||
Voldenet | wayland: ^ the style is easier and requires no custom operators at all | 10:38 | |
I have no idea which one is better, but second one has hardly any magic in it, which probably is good | 10:39 | ||
bad part is that it has no magic :P | 10:41 | ||
10:44
lichtkind joined
10:50
melezhik joined
10:52
JimmyZhuo joined
10:55
melezhik left
|
|||
patrickb | I have it reproduced without ioctl. It's exactly as I guessed. It fails on MacOS when trying to modify a struct passed in via varargs. | 11:02 | |
That specific thing is not covered by tests. | |||
This makes me think that the issue is probably with dyncall /libffi | 11:03 | ||
SmokeMachine | m: class Node { has $.parent; has $.child; has @.tests; method AT-KEY(&code) { @!tests.push: &code; self }; method add($child) { without $!parent { $!parent = $!child; return self }; self.new: :parent(self), :$child }}; sub term:<html> { Node.new: :child<html> }; multi infix:<< <- >>(Node $parent, $child) is looser(&postcircumfix:<{ }>) { Node.new: :$parent, :$child }; say html <- "body" <- "h1"{ *.id eq "red" } | 11:06 | |
camelia | Node.new(parent => Node.new(parent => Node.new(parent => Any, child => "html", tests => []), child => "body", tests => []), child => Failure.new(exception => X::AdHoc.new(payload => "Type Str does not support associative indexing."), backtrace => Back… | ||
SmokeMachine | Odd… locally that works… | ||
Voldenet | there's no postcircumfix<{ }> | 11:07 | |
SmokeMachine | No, I got it wrong…. It does not work locally either… :( | 11:12 | |
But it works with ()… | |||
glot.io/snippets/h5t1sg55xd | 11:14 | ||
lizmat | and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2025/03/25/2025-...n-rakuast/ | 11:34 | |
12:05
librasteve_ left
12:23
dakkar joined
|
|||
leont | Hmmm, Air looks pretty cool | 12:30 | |
12:32
dakkar left
12:33
Voldenet_ joined
12:34
Voldenet left,
Voldenet_ is now known as Voldenet
12:51
maylay left
12:53
maylay joined
13:19
Xliff joined
|
|||
Xliff | \o | 13:20 | |
tellable6 | 2025-03-22T23:17:32Z #raku <lizmat> Xliff: if you're not using those routines, it's all good | ||
Xliff | Was reading FCO | 13:27 | |
D'oh | |||
Was reading FCO's post on Red's future and was wondering how that would work. Are there plans on exposing a mechanism that will generate the AST for a classes methods (or at least selectively preserving the AST in stage parse? | 13:28 | ||
if not, it could be as simple as having a trait...let's say "ast-preserved" which will add a .AST method to a Callable which will emit the AST as presered during the parsing phase. | 13:29 | ||
I was working on something like that a while ago, but got sidetracked | 13:30 | ||
Would the core devs be interested in me reviving that work for a future PR? | |||
lizmat | the idea is that a CHECK phaser would have access to the complete RakuAST tree | 13:31 | |
so at that time, you would be able to do whatever you want to that tree, before it gets turned into QAST / bytecode | 13:32 | ||
13:40
JimmyZhuo left
|
|||
SmokeMachine | My plan is, on CHECK time, replace all map/grep/first/etc to add a named parameter with the block ast… | 13:41 | |
lizmat | Xliff: so such a trait would only make sense if you'd like to be able to access the original AST **at runtime** | 13:42 | |
14:02
librasteve_ joined
|
|||
librasteve_ | I was wondering how the AST would get applied … CHECK sounds cool | 14:02 | |
leont: appreciate the kind words … it’s still early days for Air so now is a great time to come in a shape things the way you want ;-) | 14:03 | ||
leont | Getting form handling right is the main hard thing really. I think pretty much all the other things are obvious | 14:04 | |
All the other things are just output, form handling is also handling input if done right. | |||
librasteve_ | I have done all the HTMX examples in raku crotmp already … github.com/librasteve/raku-HTMX-Examples | 14:07 | |
and I think that quite a lit of these are form-relavant and could/should be included in forms | |||
(which I did not really do any examples / any Components or Tags for in Air yet) | 14:08 | ||
one general question I have is whether there is “core Cro::WebApp” forms support currently used by Cro Template and if so how easy that would be to carve out and re-use… so I guess next step is to rootle around in there | 14:10 | ||
leont: do you have a role model form implementation that you like (not necessarily in raku) … or maybe some words about do & donts? | 14:17 | ||
s/do/dos/ | |||
leont | I've been trying to stay away from anything front-end for at least 15 years so I wouldn't really know what the good solutions are. | 14:19 | |
librasteve_ | very wise | 14:47 | |
14:48
liztormato joined,
maylay left
|
|||
liztormato | Librasteve do you think it would be feasible / make sense to rework irclogs.raku.org in hArc? | 14:50 | |
14:51
maylay joined
14:55
liztormato left
15:16
sena_kun left,
sena_kun joined
15:25
sena_kun left
15:26
sena_kun joined
|
|||
librasteve | feasible - yes. make sense - not really since quick glance at the code shows many lines of cro templates …. so I am not sure it makes sense to just rewrite something that works unless there is a need for big changes | 15:27 | |
what I have in mind is a rework of raku.org … since tbh that is a bit in need of a more modern design and some of the content (raku example, and so on) looks very stale and also imo, there is about 10 times too much info than is needed to appeal to a potential raku wannabe to get started | 15:30 | ||
what do you think of that idea? | |||
[Coke] | Folks - had to reload the MoarVM tarball into the release, and *create* the nqp tarball. both should be in place now. | ||
the git repos were fine, but any tools that depended on the release would have had an issue (e.g. rakudo/star) | 15:31 | ||
15:33
sena_kun left,
sena_kun joined
15:40
yewscion_ joined
|
|||
Xliff | Oh! You can access the AST at CHECK time? How would that work? The .ast method? | 15:41 | |
15:42
liztormato joined
|
|||
Xliff | librasteve: Do you think a rework of raku.org to use Air might be more flexible and reliable than Cro templates? | 15:44 | |
liztormato | librasteve feels like we can use a restyling to coincide with a 6.e release | 15:45 | |
Xliff | I love Cro templates, but they have limitations that I suspect Air does not. | ||
15:45
yewscion_ left
|
|||
Xliff | As long as coding styles enforce separation of display logic and module logic it could work well. | 15:46 | |
15:46
vrurg left,
vrurg joined
15:48
yewscion_ joined
15:54
notable6 left,
linkable6 left,
shareable6 left,
evalable6 left,
tellable6 left,
coverable6 left,
unicodable6 left,
nativecallable6 left,
quotable6 left,
greppable6 left,
sourceable6 left,
benchable6 left,
bloatable6 left,
releasable6 left,
bisectable6 left,
committable6 left
|
|||
librasteve_ | I, also, love cro templates (so much that I added fragment support to them back in December) … they are the gold standard in terms of usability and syntax for templates (and there is even good syntax highlighting in the IntelliJ raku plugin v2) then I got into HTMX and I implemented the HTMX examples in Cro templates github.com/librasteve/raku-HTMX-Examples … then I got kinda frustrated since I had forgotten how mind | 15:54 | |
numbing and restrictive coding a website in a template language can be and I missed all the cool stuff I could do with a full language and since I had been listening to some podcasts about elmlang, I realsed that the functional ness of raku is a fantastic way to bring HTML tags right into raku (my favourite coding medium) … this is the way | |||
liztormato | Xliff: re CHECK time access. Probably a dynvar such as $*CU | ||
SmokeMachine | Would that make sense to use Cromponents once it already uses Cro templates? | 15:55 | |
15:56
coverable6 joined,
bloatable6 joined,
bloatable6 left,
coverable6 left
|
|||
librasteve_ | liztormato … good idea … I will make a prototype of a new design and share around for feedback … 6.e is due to release at Easter, right? | 15:57 | |
SmokeMachine | Xliff: what kind of limitations you see on Cro templates? | 15:58 | |
15:59
liztormato left,
nativecallable6 joined,
committable6 joined,
sourceable6 joined
16:00
greppable6 joined,
quotable6 joined,
evalable6 joined,
bisectable6 joined,
tellable6 joined,
coverable6 joined,
unicodable6 joined,
releasable6 joined
16:01
bloatable6 joined,
shareable6 joined,
linkable6 joined,
notable6 joined,
benchable6 joined
16:02
yewscion_ left
|
|||
librasteve_ | Xliff: the great thing about HTMX is that all the coding can be done in the back end (yes even for dynamic UX) … I have taken a lot of inspiration from the HTMX essays - I recommend htmx sucks first, then locality of behaviour and complexity budget are my favourites htmx.org/essays/#complexity-very-very-bad | 16:03 | |
Xliff | SmokeMachine: Ability to set constants. This is deliberate according to jnthn. Minor shortcomings to expression logic. LTA handing of objects that are not defined (particularly, if a template tries to evaluate Nil, it will crash the route | 16:04 | |
16:04
yewscion_ joined
|
|||
Xliff | librasteve: And yes, this is the way! :) | 16:05 | |
liztomato: OK, so $*CU hasn't been implemented, yet? | |||
SmokeMachine | Xliff: it does not fix that, but have you tried Cromponent? | ||
Xliff | SmokeMachine: How could Air not support that? It's Raku!? | 16:06 | |
SmokeMachine: No. I have not tried that yet. Link? | |||
SmokeMachine | $*CU is implemented (I’m searching for my example using it) but it only exists índice a CHECK block | ||
Xliff | Ah. OK. | 16:07 | |
Can you modify $*CU at CHECK time? | |||
SmokeMachine | Xliff: github.com/FCO/Cromponent | 16:08 | |
Yes, you can… I’m still searching my test/example | |||
16:08
yewscion_ left
|
|||
Xliff | Dynamic variable $*CU not found | 16:09 | |
16:10
Altai-man joined,
sena_kun left
|
|||
Xliff | SmokeMachine: Huh! Looks interesting. I'll give it a spin and see if I can use it. Thanks! | 16:10 | |
SmokeMachine | Xliff: you need to set RAKUDO_RAKUAST=1 if I remember it well... | ||
librasteve_ | forgive me - what is it that Air does not support? | 16:11 | |
Xliff | Ah, THAT'S what I'm missing. | ||
Not Air. Cro templates. | |||
librasteve_ | phew | ||
16:12
yewscion_ joined
16:14
Altai-man left
16:16
sena_kun joined,
yewscion_ left
16:17
yewscion_ joined
16:22
yewscion_ left
|
|||
SmokeMachine | Xliff: I finally found it: github.com/FCO/ACME-Overreact | 16:24 | |
Xliff | Thanks! | ||
SmokeMachine | github.com/FCO/Acme-Overreact/blob...ct.rakumod | 16:25 | |
16:26
LainExperiments joined
|
|||
SmokeMachine | That was one of my first tests to see if it would be possible to use RakuAST on Red… | 16:31 | |
grondilu | wasn't there a syntax for read-only variables? | 16:37 | |
m: my $x is ro = pi | 16:38 | ||
camelia | ===SORRY!=== Error while compiling <tmp> Can't use unknown trait 'is' -> 'ro' in variable declaration. at <tmp>:1 ------> my $x is ro<HERE> = pi expecting any of: TypeObject default dynamic export |
||
grondilu | sigilless variables won't do, as they'd bind to the variable, right? | ||
m: my $x = pi; my \var = $x; $x = 3; var | |||
camelia | WARNINGS for <tmp>: Useless use of var symbol in sink context (line 1) |
||
grondilu | m: my $x = pi; my \var = $x; $x = 3; say var | 16:39 | |
camelia | 3 | ||
16:44
benchable6 left,
unicodable6 left,
bloatable6 left,
bisectable6 left,
evalable6 left,
greppable6 left,
releasable6 left,
quotable6 left,
tellable6 left,
notable6 left,
sourceable6 left,
linkable6 left,
nativecallable6 left,
committable6 left,
coverable6 left,
shareable6 left
16:47
bloatable6 joined,
greppable6 joined,
bisectable6 joined,
unicodable6 joined
16:48
notable6 joined,
evalable6 joined,
nativecallable6 joined,
linkable6 joined,
benchable6 joined,
releasable6 joined,
tellable6 joined,
coverable6 joined
16:49
quotable6 joined,
shareable6 joined,
sourceable6 joined,
committable6 joined
16:55
LainExperiments left
|
|||
SmokeMachine | also, I was thinking... I don't know how macros are going... but I think that another way of solving the Red AST replacing would be if we could not only define macros that would be called like `macro($par1, $par2)` but also `$par1.macro($par2)` that way, Red could define a `map` macro for example that would do: `$par1.map: &par2, :raku-ast(&par2.ast)` | 17:00 | |
m: my $x = pi; my \var = $x<>; $x = 3; say var | 17:02 | ||
camelia | 3.141592653589793 | ||
SmokeMachine | grondilu: ^^ | ||
when you do `my \var = $x` you are setting the container to `var`, if you remove it from the container, it will work the way I think you want... | 17:04 | ||
17:05
jpn left
|
|||
SmokeMachine | m: my $x = pi; given $x -> $var is copy { say $var; $x = 3; say $var } | 17:09 | |
camelia | 3.141592653589793 3.141592653589793 |
||
lizmat | Xliff: try: RAKUDO_RAKUAST=1 raku -e 'CHECK say $*CU; say "hello world"' | 17:13 | |
17:16
jmcgnh left
|
|||
Xliff | lizmat: Got it. Now I want to see if I can make it easier to obtain just the AST for methods rather than having to introspect the entire compunit. | 17:16 | |
17:17
jmcgnh joined
|
|||
lizmat | grep is your friend: CHECK .say for $*CU.grep(RakuAST::StrLiteral); say "hello world" | 17:17 | |
grondilu | SmokeMachine: what does $x<> mean? | 17:18 | |
lizmat | $x deconted | ||
Xliff | lizmat: Yeah? Try doing that to a full compunit with a few classes that contain a dozen methods apiece! | ||
lizmat | so how would you select them then? | 17:19 | |
SmokeMachine | Xliff: Maybe this could help: github.com/FCO/ASTQuery | ||
lizmat | or that :-) | 17:20 | |
Xliff | Hmmm... $*CU.grep( RakuAST::Method ) actually works a treat. | ||
lizmat | SmokeMachine++ slipped my mind | ||
Xliff | FCO: Are you finished with that project or is there a future roadmap? | ||
grondilu sees the so-called decont operator in the docs. Assumes it's fairly new because he doesn't remember it at all. | 17:21 | ||
Xliff | nqp::decont has been around for a while | ||
SmokeMachine | Xliff: not finished, still working on that… when possible… | ||
lizmat | grondilu: actually, <> is the zen slice. and the zen slice will return its invocant decontainerized | 17:22 | |
as all code blocks do, unless they have an "is raw" :-) | |||
17:23
coverable6 left,
shareable6 left,
nativecallable6 left,
committable6 left,
greppable6 left,
notable6 left,
bisectable6 left,
linkable6 left,
quotable6 left,
unicodable6 left,
tellable6 left,
bloatable6 left,
releasable6 left,
benchable6 left,
evalable6 left,
sourceable6 left
|
|||
grondilu | Oh, I see. I was wondering if that notation would interfere with postfix:<> for hashes. | 17:24 | |
lizmat | it doesn't: it's the same thing :-) | ||
grondilu | I wonder if $$x would do the same | ||
m: my $x = pi; my \var = $$x; $x = 3; say var | |||
camelia | 3 | ||
grondilu | nope | ||
17:25
coverable6 joined
|
|||
lizmat | itemization makes sure that it only itemizes deconted value | 17:25 | |
s | |||
m: my $x = 42; say $x =:= $$$$$x | 17:26 | ||
17:26
greppable6 joined
|
|||
camelia | True | 17:26 | |
17:26
linkable6 joined,
benchable6 joined
|
|||
lizmat | it actually doesn't re-containerize | 17:26 | |
17:26
nativecallable6 joined,
evalable6 joined,
tellable6 joined,
unicodable6 joined
|
|||
grondilu | FYI I have just finished translating chess.js into raku. It's seems to work, it's much faster than my previous code, but still much slower than javascript. | 17:27 | |
17:27
releasable6 joined,
shareable6 joined
|
|||
lizmat | grondilu: cool! | 17:27 | |
17:27
committable6 joined
|
|||
grondilu | lots of room for optimization, though. native types and so on. | 17:27 | |
lizmat | blog post ? | ||
17:27
quotable6 joined,
notable6 joined,
shareable6 left,
releasable6 left,
coverable6 left,
nativecallable6 left,
committable6 left,
benchable6 left,
notable6 left,
quotable6 left,
evalable6 left,
tellable6 left,
linkable6 left,
unicodable6 left,
greppable6 left
|
|||
grondilu is not really a blog guy | 17:27 | ||
anyone can feel free to check out my repo, though : github.com/grondilu/chess | 17:28 | ||
I think all programming language should have a chess engine for performance tests. IMHO. | 17:30 | ||
17:30
greppable6 joined,
quotable6 joined,
bisectable6 joined
|
|||
[Coke] | grondilu: I think the example is slightly better with -I. instead of -Ilib | 17:30 | |
17:31
nativecallable6 joined,
releasable6 joined
|
|||
[Coke] | or, if someone is installing it, without the -I | 17:31 | |
17:31
evalable6 joined,
committable6 joined,
sourceable6 joined
|
|||
[Coke] | grondilu++ | 17:31 | |
17:31
linkable6 joined
|
|||
[Coke] | didn't realize it had a gui. :) | 17:31 | |
17:31
coverable6 joined
|
|||
grondilu | it's not a GUI lol | 17:32 | |
17:32
bloatable6 joined,
shareable6 joined,
benchable6 joined,
unicodable6 joined,
tellable6 joined
17:33
notable6 joined
17:34
jmcgnh left
17:35
greppable6 left,
releasable6 left,
notable6 left,
unicodable6 left,
linkable6 left,
coverable6 left,
committable6 left,
evalable6 left,
benchable6 left,
bloatable6 left,
nativecallable6 left,
bisectable6 left,
tellable6 left,
shareable6 left,
sourceable6 left,
quotable6 left
17:36
jmcgnh joined
17:38
greppable6 joined,
releasable6 joined,
unicodable6 joined,
coverable6 joined
17:39
committable6 joined
|
|||
[Coke] | er, ui. :) | 17:39 | |
17:39
evalable6 joined,
shareable6 joined
17:40
quotable6 joined,
notable6 joined,
nativecallable6 joined,
linkable6 joined,
benchable6 joined
17:41
bloatable6 joined,
sourceable6 joined,
bisectable6 joined,
sourceable6 left,
nativecallable6 left,
bloatable6 left,
benchable6 left,
quotable6 left,
evalable6 left,
coverable6 left,
greppable6 left,
bisectable6 left,
committable6 left,
notable6 left,
shareable6 left,
unicodable6 left,
linkable6 left,
releasable6 left
|
|||
grondilu | in chess.js there is a perft method, with depth as argument. I translated it to raku too. | 17:42 | |
in javascript perft(4) takes about 100ms. Guess how long it takes in raku. | |||
SmokeMachine | Xliff: did you look at ASTQuery? | ||
17:44
coverable6 joined,
evalable6 joined,
shareable6 joined,
bisectable6 joined,
benchable6 joined
17:45
tellable6 joined,
releasable6 joined,
notable6 joined,
quotable6 joined,
linkable6 joined
|
|||
librasteve | 100s? | 17:46 | |
17:46
greppable6 joined,
committable6 joined,
unicodable6 joined,
nativecallable6 joined,
bloatable6 joined,
sourceable6 joined
|
|||
grondilu | less | 17:47 | |
librasteve | btw if its faster than raku, than alone is worthy of a blog | ||
less than 100s or 100ms? | |||
nahita3882 | π seconds | ||
grondilu | less than 100s | 17:48 | |
librasteve | m: say e ** (i * π), 's'; | 17:49 | |
evalable6 | -1+1.2246467991473532e-16is | ||
Raku eval | -1+1.2246467991473532e-16is | ||
grondilu | anyway it's 37s against 122ms. It's not too bad for a first draft, and a straightforward code translation with zero optimizations. | ||
it's much better than my own implementation anyway, which was ridiculously slow. | 17:50 | ||
Xliff | SmokeMachine: I remember when you started working on it! | 17:52 | |
SmokeMachine: Are you finished with it or is it still under development? | 17:53 | ||
17:57
El_Che left
|
|||
SmokeMachine | Still under development… but it can already be useful… | 17:57 | |
grondilu | it's not finished, of course. There are so many things to implement. | ||
17:58
El_Che joined
|
|||
grondilu | I should add entries in the TODO, though. | 17:59 | |
one of the most ambitious goal would be a fully-fledge, uci-capable chess engine. | 18:00 | ||
(www.chessprogramming.org/UCI) | |||
maybe a GUI one day? | |||
though I think if I could display the board and animate the moves in the terminal with Kitty's protocol, that'd be already pretty cool. | 18:02 | ||
Xliff | Kitty? | 18:03 | |
Is there a working Kitty for Linux? | |||
grondilu | sw.kovidgoyal.net/kitty/ | 18:04 | |
18:37
jpn joined
18:38
jpn left
|
|||
holmdunc | github.com/vushu/raylib-raku would be good for making real graphical chess | 18:56 | |
19:13
leah2 left
19:26
leah2 joined
19:32
bazzrrr0 joined
19:37
silug left
19:39
silug joined
|
|||
antononcube | Hm... "Graphviz::DOT::Chessboard" is (most likely) much more convenient to use. | 19:43 | |
It produces SVG images. | 19:44 | ||
melezhik. | .tell librasteve: I look at github.com/librasteve/Air/tree/main/t and just for fun I am thinking to implement those one by using sparrow task checks . It’ll be interesting to compare . In the end of the day air generates a lot of html code which is essential to test … just a though 🤔 | 19:45 | |
tellable6 | melezhik., I'll pass your message to librasteve | ||
antononcube | Also, "JavaScripdt::D3" can produce D3.js code of chess positions. | ||
The ability to make a chess-GUI with Raku is demonstrated here: www.youtube.com/watch?v=fwQrQyWC7R0 | 19:47 | ||
19:58
yewscion_ joined
20:05
librasteve_ left
20:10
yewscion__ joined,
yewscion_ left
|
|||
librasteve | melezhik: please do - but i am worried about the ease of installing the Air deps since I’m struggling on macOS with DBIish on pq with 2025.02 | 20:26 | |
tellable6 | librasteve, I'll pass your message to melezhik | ||
Xliff | How can I get raku to run a command in the background and exit? | 20:31 | |
(effectively daemonizing said program) | |||
librasteve | Proc::Async maybe? | 20:33 | |
tellable6 | hey librasteve, you have a message: gist.github.com/3624428b1f78b4fa66...8ce77c1685 | ||
librasteve | docs.raku.org/type/Proc::Async | 20:34 | |
[Coke] | I don't think you can daemonize it, but you could use proc::async, then have your code wait until it completes then exit | 20:56 | |
[Coke] googles and finds raku-knowledge-base.podlite.org/mo.../README.md - wtf is this? | 20:57 | ||
ah, it's github.com/hipek8/p6-UNIX-Daemonize | 20:58 | ||
ugexe | lol | 21:03 | |
it is using fork()? | |||
yeah no one should be using github.com/hipek8/p6-UNIX-Daemonize | 21:04 | ||
21:06
wayland left,
wayland joined
|
|||
ugexe | we do not support forking in raku (even if there is a nqp::fork()), since moarvm itself cannot support forking past a certain point in the startup | 21:07 | |
[Coke] | Yah, it's only there, not published. | 21:10 | |
jdv | iirc brrt put real work into that | 21:27 | |
21:37
apac joined
21:39
Aedil left
|
|||
Xliff | Could I use nohup and background that? | 21:42 | |
antononcube | @.xliff | 21:44 | |
@.xliff See here: | 21:45 | ||
cdn.discordapp.com/attachments/633...6dc3d& | |||
21:46
human_blip left
21:48
human_blip joined
|
|||
Xliff | antoncube: What model is that? | 21:52 | |
antononcube | OpenAI's "gpt-4o" with the prompt "CodeWriterX". | 22:10 | |
See that prompt here : github.com/antononcube/Raku-LLM-Pr...son#L10658 | 22:11 | ||
Actually, it might not be clear that the screenshot is of Raku chatbook, not the web interface of a certain LLM provider service. | 22:13 | ||
22:22
oodani left
|
|||
ugexe | jdv: into nqp::fork yes, and the way it was used was within the early startup contain i mentioned earlier. early startup being before libuv initialization or some such | 22:23 | |
22:23
oodani joined
|
|||
ugexe | s/contain/constraint/ | 22:23 | |
22:24
Sgeo joined
22:39
jargan joined,
jast left
23:11
lichtkind left
23:17
apac left,
sena_kun left
23:26
ACfromTX left
23:27
bdju left
23:40
ACfromTX joined
23:44
bdju joined
23:47
bazzrrr0 left
|