🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
00:01 gfldex left 00:02 reportable6 left 00:04 reportable6 joined 00:06 gfldex joined 00:07 Tirifto joined
holly I have a window of Solstice, now to blit things 00:35
stuff compiles fully
I put an MVC in the code 00:39
I called it "Solstice : Underdark" for some nice additions 00:45
00:56 guer joined 01:01 guer left 01:15 peteretep is now known as pjlsergeant 01:18 pjlsergeant left, pjlsergeant joined, holly left 01:38 swaggboi left 02:02 swaggboi joined 02:20 Util joined 02:53 p6steve left 02:55 p6steve joined 02:57 guer joined 03:02 guer left 03:13 dogbert11 left, dogbert11 joined 03:24 kevin1 is now known as kjp
stoned75_ 03:25
Geth doc/allomorph: cee3ac27d4 | (Stoned Elipot)++ | doc/Type/Allomorph.pod6
Fix pastos
03:32 dogbert11 left 04:05 dogbert11 joined 04:32 vrurg left 04:41 vrurg joined
GreaseMonkey have there been any efforts to convert the OpenGL XML information into a Raku binding? 04:51
there's a GLFW3 binding somewhere which has at least some of the OpenGL API, but it would be better off having the OpenGL stuff be a separate thing altogether 04:52
04:56 frost joined 04:58 guer joined 05:03 dogbert11 left, dogbert11 joined 05:04 guer left
moon-child GreaseMonkey: github.com/moon-chilled/glarkum 05:14
(also prefer sdl to glfw) 05:15
GreaseMonkey nice, what's the preferred way to load that? 05:16
doesn't appear to be available via zef
moon-child still needs to be cleaned up, I haven't built it into a proper package yet. But see the example
GreaseMonkey huh, didn't realise GL Core could be done in under 100 lines of C 05:18
i normally hit 200-300 when i do it
moon-child :) 05:19
no comments though, and dsa cuts down on the binding crap
GreaseMonkey ah right, DSA
if you don't care about Windows users with old GPUs and old drivers, it's great 05:20
which is the view i hold, so it's great
if you really want to breathe life into an old GPU, Windows is not how you do it
but maybe one day we'll have GL 3.3 on a GMA 4500 MHD
moon-child haha maybe. That thing is ancient! 05:21
GreaseMonkey you're talking to someone who used to have an S3 ViRGE
and heck, the 4500 MHD is still pretty respectable
and also great to have if you want to bare-metal an Intel GPU, relatively free of silicon bugs 05:22
but that thing can access up to not quite 2 GB per context, and you can even raytrace at 320x180 at a decent framerate
now, if you want an inherently bad GPU: the GMA 3150, which was basically "let's take an outdated GPU and make it 1/4 of the 'speed'" 05:24
i once tried to optimise it, and then i had to close that issue because of how bad it was. y'know a GPU that can beat the 3150 easily? VC4.
anyway, time to add this thing to my module path however that works 05:25
...actually, how would i do that? 05:26
moon-child invoke with raku -Ipath/to/glarkum 05:27
GreaseMonkey yeah alright i'll go with that
huh, it does take a while to actually get stuff together once the window frame is created 05:29
moon-child yeah
I'm thinking lazy loading might be the solution to that 05:30
also tried using nativecall directly (is native(...)) but that was even slower
GreaseMonkey lazy loading is definitely worthwhile from what i'm seeing in top 05:31
i also wonder how different glx and wgl are... i can vouch for glx being "somewhat OK i guess" or more accurately "not as bad as you'd think"... but in practice, vs SDL you don't actually save that much RAM 05:33
moon-child no idea, I've never used either 05:34
there's also egl, and I think arcan and mac both use their own thing 05:35
huh, I tried using is native again. Apparently it's actually much faster 05:40
only problem is...it takes 16gb of memory to compile!
06:02 reportable6 left 06:05 reportable6 joined 06:07 Doc_Holliwould joined
Xliff moon-child / GreaseMonkey: github.com/Xliff/p6-COGL 06:17
It's also not-quite-ready for zef, but not for lack of trying. 06:18
Depends on my p6-GLib and p6-GIO which also aer not-quite-ready for zef
But that's more of a CURI problem. 06:19
Geth doc: 4e071eccdf | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Allomorph.pod6
Document Allomorph class

ref #3653 #3888 #3346
doc: 45420b74ff | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | 4 files
Adapt allomorph classes documentation for Allomorph class

  - Condense the introduction and link to the Allomorph class documentation
  - Remove documentation for methods inherited from the Allomorph class
  - While here document the === operator for the allomorph classes
linkable6 Link: docs.raku.org/type/Allomorph
doc: 4e2a82bbb7 | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Allomorph.pod6
Fix pastos
06:23 linkable6 left
nine moon-child: note that NativeCall can be very fast when the call is JIT compiled, but not all calls are. I basically only implemented the cases (data types) I needed for Inline::Perl5. E.g. there is no JIT support for floats in native calls. 06:23
06:23 linkable6 joined
moon-child bad news, opengl is basically all floats! ;) 06:24
but yeah, not so worried about runtime perf as compile time (and esp. compile time memory usage)
06:47 stoned75_ left 06:48 stoned75 joined, stoned75 left 06:54 kjp left 06:55 kjp joined 06:59 stoned75 joined 07:00 guer joined 07:05 guer left 07:28 Sgeo left
Xliff Why is it that when I have a trait defined as such: 07:40
"multi sub trait_mod:<is> (Attribute:D $a, :accessor_less($)!)" 07:41
I get a type mismatch error on the :accessor_less parameter, when said trait is used in a class like so: "class A is reor<CStruct> { has $!a is accessor_less; }" 07:42
07:43 dakkar joined 07:49 guer joined
raydiak if you're seeing the same error I am, it has nothing to do with the trait. CStructs don't handle arbitrary types, you have to add a type declaration to the attribute like it says in the error, so it knows how to represent it in a C struct 07:53
m: class A is repr<CStruct> { has $!a } 07:54
camelia 5===SORRY!5=== Error while compiling <tmp>
CStruct representation only handles attributes of type:
(u)int8, (u)int16, (u)int32, (u)int64, (u)long, (u)longlong, num32, num64, (s)size_t, bool, Str
and types with representation: CArray, CPo…
raydiak m: class A is repr<CStruct> { has uint8 $!a }
camelia ( no output )
07:55 p6steve left
raydiak besides that, your code works for me 07:55
m: multi sub trait_mod:<is> (Attribute:D $a, :accessor_less($)!) {}; class A is repr<CStruct> { has uint8 $!a is accessor_less; }
camelia ( no output )
GreaseMonkey alright, i'll take a look at that 07:56
Xliff radiak++ -- Thanks./ 08:00
raydiak yw :)
08:08 morayj joined 08:17 Doc_Holliwould left 08:19 patrickb joined 08:21 p6steve joined 08:40 guer` joined 08:43 guer left 08:53 holly joined 09:13 sono left 10:13 evalable6 left, linkable6 left 10:14 linkable6 joined, evalable6 joined
xinming releasable6: status 10:31
releasable6 xinming, Next release in ≈17 days and ≈8 hours. 1 blocker. 0 out of 3 commits logged
xinming, Details: gist.github.com/be316a40d10e7c5da8...a6f4becfa9
11:14 linkable6 left, evalable6 left 11:16 evalable6 joined 11:17 linkable6 joined 11:22 guifa left 11:26 morayj left 11:42 morayj joined 12:02 reportable6 left, reportable6 joined 12:11 abraxxa left
holly There's an Adventure game room in Solstice now, just needs exact collision detection for derived classes 12:32
AdventureRoom.pm6 12:33
lizmat do you have an algorithm already for the collision detection ? 12:36
holly It depends on what adventure game room you're in but you can collide with e.g. boxes on the room 12:37
then you just check coordinates in the boxes
x > xx && x < xx + width && y > yy && y < yy + height for example 12:38
where xx,yy,width, height are the box coords
x,y the player character coords 12:39
my Solstice tile engine checks which tile you're on, then checks height for colliding
using diamonds 12:40
It still needs work though for having tilemap collision
there's 2 tilemaps in now
for the starting room of the NES Solstice game
see Nestopia
which has a mac version 12:41
and linux 12:42
It also has a nice icon :-)
I tended to use mac and fedora versions
I'd rather like the python pygame icon 12:46
boxes are a bit stupid though, somwhat brute force but it'll do 12:47
you just collide a list of boxes as described above
@!boxes = (); @!boxes.push(ox); 12:48
then iterate over boxes and you're done
boxCollide(ox) 12:49
From my LISP/Scheme programming days 12:50
@!boxes in AdventureRoom.pm6
then AdventureRoom->collideBoxes(); 12:51
As clear as my fucking ass
undomove in the code is also nice 12:54
after collide 12:56
Anyway it's compileable 13:00
lizmat m: sub foo() { ... } # also compiles :-) 13:02
camelia ( no output )
13:07 Doc_Holliwould joined 13:22 stoned75 left 13:23 stoned75 joined 13:29 RaycatWhoDat joined 13:40 p6steve left 13:51 p6steve joined
andinus m: sub foo() { ... } foo() 13:56
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3sub foo() { ... }7⏏5 foo()
expecting any of:
infix stopper
statement end
andinus m: sub foo() { ... }; foo()
camelia Stub code executed
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
rba The virtual server with most of the *.raku.org/*.perl6.org websites will be down for maintenance today 8pm CEST for approximately an hour... 13:58
vrurg m: sub foo {...}; say foo.WHICH; # this is what is little known about ... 13:59
camelia Failure|73238648
Xliff How can I get access to the deserialized META6.json data? 14:00
ugexe docs.raku.org/language/variables#$?DISTRIBUTION 14:02
Xliff ugexe: Is that available at the MAIN level or just the CompUnit? 14:03
ugexe if you put your MAIN in a module it'll work. or provide a module that just returns $?DISTRIBUTION and call that from your script 14:04
Xliff Thanks!
14:28 frost left 14:41 Sgeo joined 14:45 Doc_Holliwould left 14:48 Doc_Holliwould joined
stoned75 Str.Num is not documented, I guess it should be, right ? I'm asking confirmation because Cool/Str/Numeric/... is a maze ;-) ':) 15:15
holly OK enough Solstice for me todaay, need to fix collision detection thoroughly 15:17
will start on it tomorrow 15:18
thingies are at github.com/theholyghost2/Solstice
bmp tile images also need fixing 15:19
96x48 15:20
Thanks a lot for the support :-) 15:21
holly grabs a beer 15:24
stoned75 am I missing something or find_method's documentation is wrong/out of date: it says it return the method obj closest in mro but I tend to see the opposite ':) 15:26
m: my Str $s = ""; say $s.HOW.^find_method("find_method").package 15:33
camelia No such method 'package' for invocant of type 'NQPRoutine'
in block <unit> at <tmp> line 1
stoned75 ETOODEEP
definitively too deep, I found myself reading 6model.c 15:45
dakkar I think you fell off the edge of the MOP 15:46
stoned75 looks like it :-} 15:47
15:48 linkable6 left, evalable6 left
dakkar `find_method` is probably set up in the "early" bits of the MOP, so it's a NQPRoutine, not a full Method 15:48
(I'm sure there's a bunch of well-known bugs in rakudo about bits of the implementation leaking through the mop) 15:49
15:49 linkable6 joined 15:50 evalable6 joined
stoned75 OK plan B, add a couple of debugging say() and recompile rakudo, I'll find where is my method ! :-} 15:52
dakkar bit drastic ☺ 15:55
stoned75: what are you trying to achieve?
stoned75 I want to be sure which method is called in something like the following 15:58
m: my Str $s = "10"; say $s.Numeric
camelia 10
stoned75 so I'm stargazing, trying to ascertain what are those shining little lights :-}
there now I know it's really Str.Numeric that is called 16:03
but... 16:04
m: my Str $s = "10"; say $s.^find_method("Numeric").package
camelia (Mu)
stoned75 and that surprises me
dakkar there's a `proto method Numeric` in Mu 16:05
so I think you get the full multi method back from `^fiind_metdo
from `^find_method` 16:06
stoned75 and when considering the following, I tend to believe find_method() does not return the closer method in the mro:
my Str $s = "10"; say $s.^find_method("Numeric").candidates.map({.package})
evalable6 ((Mu) (Str))
dakkar that's what I just said
you get a multi
with candidates defined in different packages
stoned75 yes, hence my first question... I guess find_method's documentation could use some love :) 16:08
dakkar it's not wrong, but it is incomplete, yes
m: class A { method foo() {} };class B is A { method foo() {} }; B.^find_method('foo').package.^name 16:09
camelia ( no output )
dakkar m: class A { method foo() {} };class B is A { method foo() {} }; say B.^find_method('foo').package.^name
camelia B
dakkar B, as documented 16:10
[Coke] yawns.
dakkar m: class A { multi method foo() {} };class B is A { multi method foo($a) {} }; .say for B.^find_method('foo').candidates>>.package 16:11
camelia (A)
dakkar you get the closest method, which sometimes is a multi
stoned75 OK but what about Str.^find_method("Numeric").package ?
dakkar it's exactly the same as my last example 16:12
stoned75 but I fail to make sense of it ':)
dakkar m: .say for Str.^find_method('Numeric').candidates>>.package
camelia (Mu)
dakkar there is 1 `multi method Numeric` reachable from the Str class
it has 2 candidates
one is defined in the Mu class, the other in the Str class
m: .say for Str.^find_method('Numeric').candidates>>.signature
camelia (Mu:U \v: *%_)
(Str:D: Bool :$fail-or-mu, *%_ --> Numeric:D)
dakkar they have (of course) different signatures 16:13
m: say Str.Numeric
camelia Use of uninitialized value of type Str in numeric context
in block <unit> at <tmp> line 1
dakkar m: say '10'.Numeric
camelia 10
stoned75 yes but find_method() does not return the closest in mro, or there something I still did not understand
16:13 patrickb left
dakkar that "use of unitialized…" is printed by Mu::Numeric 16:13
I think the confusing bit is "how do multis interact with inheritance" 16:14
stoned75 that may be the thing I did not quite get yes
dakkar the Str class has a `Numeric` method 16:15
so `find_method` returns that
that method is a multi
so the Method object you get back refers to all the candidates of that multi
this is necessary, because…
m: my $m = Str.^find_method('Numeric');say '123'.Numeric; say '123'.$m() 16:16
camelia 123
dakkar those two *must* work the same way
m: my $m = Str.^find_method('Numeric');say Str.Numeric; say Str.$m()
camelia Use of uninitialized value of type Str in numeric context
in block <unit> at <tmp> line 1
Use of uninitialized value of type Str in numeric context
in block <unit> at <tmp> line 1
dakkar including the multi-dispatch
are you still with me?
stoned75 ok please lemme process this 16:17
ok get it
dakkar I agree that it's confusing, and some more examples in the documentaton wouldn't hurt 16:18
stoned75 otoh if get a method object for a given object, hence type. and try to call that method on another object, like in your example, aren't you being adventurous ? 16:19
*if you get a method...
dakkar no, as long as the types are the same
16:19 guer` left
dakkar methods are tied to types, not values 16:19
stoned75 of course of course
holly class methods etc. 16:20
dakkar m: say ''.^find_method('Num') =:= Str.^find_method('Num')
camelia True
dakkar they're the same method
on the other hand…
m: my $m = Str.^find_method('Numeric');say (1.25).$m() 16:21
camelia Cannot resolve caller Numeric(Rat:D: ); none of these signatures match:
(Mu:U \v: *%_)
(Str:D: Bool :$fail-or-mu, *%_ --> Numeric:D)
in block <unit> at <tmp> line 1
stoned75 but hum... I mean.. holding a method object for a multi defined on Mu should be really be a problemwhen trying to call it on a random object
dakkar why?
stoned75 wehll with your last example, I take that back :)
dakkar calling a method is a normal dispatch ☺
16:22 p6steve left
dakkar of course, if the signatures match, you will get what you ask for (which may well be nothing like what you meant) 16:22
but hey, raku isa perl, that's what we do 😜 16:23
stoned75 eh :-)
I'm still thing that "which is closest in the method resolution order" is misleading ;-) 16:26
*still thinking 16:27
otoh find_method is defined for *various* classes and this sentence is about Metamodel::MROBasedMethodDispatch.find_method() 16:28
dakkar it's not misleading when you're not looking at multis 16:29
stoned75 I guess so
dakkar m: class A { method foo() {} };class B { method foo() {} }; class C is A is B {}; say C.^find_method('foo').package.^name
camelia A
dakkar m: class A { method foo() {} };class B { method foo() {} }; class C is B is A {}; say C.^find_method('foo').package.^name
camelia B
dakkar see? closest in mro 16:30
stoned75 yes indeed.
dakkar also, asking a multi Method "what's your package" is actually asking "what's your proto's package"
m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A {}; say C.^find_method('foo').package.^name 16:31
camelia A
dakkar m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A {}; .say for C.^find_method('foo')>>candidates.package.^name
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing dot on method call
at <tmp>:1
------> 3s A {}; .say for C.^find_method('foo')>>7⏏5candidates.package.^name
expecting any of:
dakkar m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A {}; .say for C.^find_method('foo')>>.candidates.package.^name
camelia No such method 'package' for invocant of type 'List'
in block <unit> at <tmp> line 1
dakkar m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A {}; .say for C.^find_method('foo').candidates>>.package.^name
camelia List
[Coke] vaguely wonders if he can get the camelia newline to show up in win 10 powershell/powershell/ssh/mac/tmux chain
dakkar m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A {}; .package.^name.say for C.^find_method('foo').candidates 16:32
camelia ( no output )
dakkar m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A {}; dd C.^find_method('foo').candidates
camelia ()
dakkar ah, right, I forgot a bit
m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A { multi method foo() {} }; .say for C.^find_method('foo').candidates>>.package.^name
camelia List
stoned75 dakkar: ;-)
dakkar m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A { multi method foo() {} }; .package.^name.say for C.^find_method('foo').candidates
camelia C
dakkar m: class A { proto method foo {*} };class B is A { multi method foo() {} }; class C is A { multi method foo() {} }; .package.^name.say for B.^find_method('foo').candidates 16:33
camelia B
dakkar so when you ask for the method's package, you get where the proto was defined
when you ask each candidate, you get where the candidate was defined
which is more-or-less the only sensible way to expose all that info 16:34
stoned75 dakkar: I see and I think I get it. thanks for your explanations and your patience
holly I've hacked in collision detection into 16:35
dakkar stoned75: no worries, I've also learned a few things along the way ☺
holly Solstice. Now to debug it.
stoned75 I write down that find_method really need to be a bit more documented
otoh it may be a rakudo implementation detail...
dakkar no, it's not 16:36
find_method must return the whole multi method
and multi methods work the way I described (directly refer to the proto, contain candidates)
stoned75 ok i'm definitively writing this down in my personal backlog then :) 16:37
16:37 p6steve joined
dakkar for example, github.com/Raku/roast/blob/master/...hing.t#L91 mandates the behaviour of find_methods with multis 16:38
(I'm sure there's better tests, this is just the first one I found)
anyway, I'm disconnecting now, have fun! 16:39
stoned75 thanks again
16:43 dakkar left
[Coke] m: "does this work".words.join("\n").say; 17:00
camelia does
[Coke] huh. apparently it all works fine-ish if I use 'git bash' instead of of cmd or powershell.
ugexe maybe depends on your quoting 17:01
in cmd i would do `raku -e "'does this work'.words.join(qq|\n|).say"
[Coke] ... if I ssh to the machine running tmux; if I run 'uni -n cat face', I get mojibake. cannot win. 17:02
ugexe: just trying to see the NL char in my IRC session.
holly I'm gonna go now, too much IRC cases. CYA! 17:34
17:34 holly left 17:40 lasse joined, lasse left 18:02 reportable6 left 18:03 reportable6 joined
kybr i have a grammar with `token split { '.' }` because "split" is the name i want for the '.' but Raku does not like this: Cannot resolve caller split(Mu:U, Foo::Thing:D); Routine does not have any candidates. Is only the proto defined? 18:04
using `token splyt { '.' }` works fine. 18:07
Altreus In lieu of an actual answer I would go as far to recommend that tokens be nouns, not verbs
I expect this is still going to cause an issue at some point but, well, you know
kybr split is a noun. in this case.
but that seems like a sound recommendation. 18:08
Altreus I suppose it can be used as a noun in the sense of gap 18:09
ugexe you will have to show your code, as an example with no such token gives a different error 18:39
m: grammar Foo { token TOP {.}; token split { die }; }; say Foo.parse("a").split
camelia #<failed match>
ugexe there are gotchas like you cant use a `token to { }` or any other name that already exists as a member on match cursor object 18:42
to, from, etc
18:47 morayj left
lizmat . 19:05
19:08 hankache joined
stoned75 commit: releases my $n = <2e0>; say $n.^find_method("Num").candidates>>.package 19:08
committable6 stoned75, gist.github.com/0afa13fa5b079a0397...e6f70254b5
stoned75 commit: releases my $s = ""; say $s.^find_method("Num").candidates>>.package 19:09
committable6 stoned75, ¦releases (54 commits): «((Str))␤»
stoned75 ah and somehow Str.Num was never documented :-} 19:11
wait... I was already following thought earlier today! I'm lost in a maze of strings and numbers :-} 19:16
*that thought
[Coke] stoned75: can you see if there's a ticket about Str.Num not being documented? on github.com/raku/doc/issues? 19:19
(and open one if not?)
stoned75 I'll check and I was going to add it anyway :)
[Coke] Should be listed under the large # of (Cool) routines.
oh, sure, a commit would be even better. thanks! 19:20
stoned75 you're welcome :) 19:21
19:24 sono joined
stoned75 coke: hum... what do you mean by "Should be listed under the large # of (Cool) routines." ? 19:30
19:30 intothewild joined, intothewild left
[Coke] It's inherited from Cool, so should show up with the other methods from Cool (the navigation on the left with all the method names shows ()'s with the Class/Role that provides the method. 19:31
stoned75 ah I see what you mean, but Str.Num is not inherited from Cool: it is overridden in Str 19:34
[Coke] fair enough 19:42
stoned75 but Cool.Num is not documented either :-} 19:44
c 19:45
perlbot OakPC pasted a new file at perl.bot/p/bas41s - 19:54
lizmat perlbot: you appear to be posting to the wrong channel 19:55
perlbot lizmat: Stored you appear to be posting to the wrong channel 19:56
stoned75 hum a lot, if not all, of the of Numeric related coercing methods are missing from Cool's documentation 19:59
ah there an issue :) github.com/Raku/doc/issues/3361 20:00
20:05 stoned75 left 20:06 stoned75 joined 20:26 hankache left 20:42 perlbot left, perlbot joined, Util left 20:51 sena_kun left, sena_kun joined 21:25 Manifest0 left, Manifest0 joined 21:47 p6steve left 22:03 p6steve joined 22:29 ilogger2 joined 22:44 Xliff left 22:51 dogbert11 joined 22:52 dogbert17 joined 22:53 dogbert12 joined 22:56 dogbert11 left 22:57 dogbert17 left 23:04 Util joined 23:19 dogbert12 left 23:21 dogbert12 joined