šŸ¦‹ 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, reportable6 joined 00:02 jpn left 00:15 rypervenche left 00:19 rypervenche joined 00:47 daxim left 00:50 ll joined, ll left 00:52 jpn joined 00:57 jpn left 01:02 daxim joined 01:03 xinming left 01:05 xinming joined 01:35 kybr left 01:37 kybr joined 01:46 jpn joined 01:51 jpn left 02:18 teatime left 02:19 teatime joined 02:33 teatwo joined 02:36 teatime left 02:37 bigdata joined 02:51 MasterDuke left 03:01 cm left 03:02 cm joined 03:19 rf left 03:29 bigdata left 03:34 jpn joined 03:39 jpn left 03:47 greaser|q is now known as GreaseMonkey 04:28 derpydoo joined 04:30 jpn joined 04:35 jpn left 05:27 jpn joined 05:31 jpn left 05:59 zara joined 06:00 reportable6 left, reportable6 joined 06:11 human_blip left 06:12 human_blip joined 06:16 jpn joined 06:34 zara left 07:13 abraxxa joined 07:16 jpn left 07:31 jpn joined 07:38 jpn left 07:57 Sgeo left 07:59 sena_kun joined 08:14 dakkar joined 08:30 abraxxa left 08:40 abraxxa joined 08:50 jpn joined 09:26 sena_kun left 09:53 perlmaros left 09:58 perlmaros joined 09:59 razetime joined 10:04 derpydoo left 10:48 razetime left 11:18 Xliff joined
Xliff m: class X::E is Exception { method new ($m) { self.bless( message => $m ); }; }; sub a { CATCH { when X::E { .message.say }; }; X::E.new("Bloop!").throw }; a 11:19
camelia Stub code executed
in block at <tmp> line 1
in any at <tmp> line 1
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
tellable6 2023-05-16T19:52:48Z #raku-dev <nine> Xliff: what do you mean by the Need RakuAST node "not working"?
Xliff Is that right?
11:25 jpn left 12:00 reportable6 left 12:01 jpn joined 12:02 reportable6 joined 12:06 jpn left 12:17 jpn joined 12:43 El_Che left 12:45 El_Che joined
gfldex lolibloggedalittle: gfldex.wordpress.com/2023/05/17/pl...g-strings/ 12:50
13:22 jgaz joined 14:18 tea3po joined 14:20 pusha joined
pusha hi! I'd like to ask some Qs about Raku 14:21
14:21 teatwo left
dutchie pusha: in irc, you should just ask your question. no need to request permission first 14:25
pusha ok mb
asked it in #raku-beginner 14:26
14:27 tea3po left, tea3po joined 14:37 tea3po left, tea3po joined 14:44 Sgeo joined 14:45 xinming left 14:47 xinming joined
Xliff gfldex: "Again, I need a way to turn words into Sets. I shall do so be invoking the coercion-protocol with new-method." shouldn't "be" be "by" ? 14:53
lizmat Xliff++ oops, missed that :-) 14:54
gfldex Xliff: thanks! 14:55
Luckily the intarwebs are full of nitpickers or I would never know that anybody reads the nonsense I write. :-> 14:57
Xliff gfldex: Nice article, tho. 14:58
TIL that type constraints are valid in Array refs.
gfldex Coersion types turn out to be really useful when you think functional but program object oriented. 14:59
15:00 jpn left
tbrowder__ lizmat: disregard my comment ref ending- 15:01
lizmat ?
tbrowder__ type pod paras. 15:02
i'm confusing extracting $=pod and doing things with it for doc layout. 15:03
lizmat ah, ok
FWIW, I think the future of rakudoc rendering is by walking the RakuAST tree 15:04
tbrowder__ if you have solved the table cell problem for embedded tables and formating codes you are light-years ahead of the current capability
lizmat did you gist me an example of embedded tables already ? 15:05
tbrowder__ no, i never got to that poont
*point,
15:05 jpn joined
lizmat ok, then I cannot tell you whether solved it 15:06
wrt to formatting codes in cells, that should be emininently doable
tbrowder__ at the time i never thought of it, but someone, maybe leont, wanted it. and we would all like formatting codes in table 15:07
Xliff gfldex: It is. I use it extensively in my NativeCall stuff.
lizmat tbrowder__: ok, then I will make that so, depending on :allow setting 15:08
I've got that part of the code in my head now, better make efficient use of that now
tbrowder__ roger! 15:14
patrickb What ways are there to generate classes at runtime? 15:16
Except EVAL that is.
lizmat with RakuAST?
tbrowder__ hm, i need to see tonyo's Data::Dumpl used on $=pod
patrickb I guess RakuAST could do this. But is there some other way with some mop trickery? 15:17
tbrowder__ *Data::Dump
lizmat patrickb: look for new_type in src/Perl6/Metamodel ? 15:18
tbrowder__ i just found "constant $foo = MyClass.new;" works 15:19
15:20 abraxxa left
patrickb lizmat: Thanks! I'm brainstorming how a runtime generated Gtk binding could work. I guess there are options. 15:23
leont patrickb: I've been considering writing such a thing for years but never had the tuits. I assume you know about gobject introspection? 15:24
patrickb leont: I do. 15:25
leont Excellent!
patrickb Gnome::Gtk3 might take that direction.
lizmat patrickb: fwiw, I think going the RakuAST way would be preferable over the mop way at this point 15:26
gfldex Africa still doesn't like Raku much: gist.githubusercontent.com/gfldex/...-there.png
leont gfldex: or is largely not privileged enough to spend effort on a language that won't earn one money on the short term 15:29
tbrowder__ m: enum Foo <a b>; sub f(Foo :$type) { say $type.gist} ; f(:type(Foo<a>)); 15:30
camelia Type check failed in binding to parameter '$type'; expected Foo but got Any (Any)
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
Nemokosch "short term" might even be euphemistic here
lizmat Nemokosch snarky! 15:31
gfldex patrickb: Please note that the MOP is not well documented. You may have to read Rakudo /src/Perl6 15:35
/Metamodel/ to get everything you need.
leont It's very abstracted IME, which is probably good from a DRY POV but can make it hard to figure out what's going on 15:37
Nemokosch no need to apply value judgements like that onto facts 15:38
15:45 xinming left 15:48 xinming joined
Xliff patrickb: GIR is probably the way to go. 15:48
I went the long way.
Plus....run-time generation will be ... slower.
patrickb: github.com/Xliff/p6-GtkPlus 15:49
lizmat: Wouldn't RakuAST still have the benefit of being precompiled?
lizmat it could, but we currently have no way to do that at runtime 15:51
patrickb Xliff: But your bindings are hand written, right? Does your recommendation of GIR mean that you have given up on your bindings? 15:53
Xliff Nope. 16:01
Hand written bindings have the advantage of tighter integration with Raku.
GIR won't get you that without some work.
lizmat: Couldn't you EVAL the tree at BEGIN ? 16:02
lizmat eys
yes
Xliff That would still be a part of the precompile payload then. Right? 16:03
lizmat no, not by itself
Xliff Oh.
lizmat BEGIN code is run and then discarded
Xliff Um.
m: my $data; BEGIN { $data = 1 }; $data.say 16:04
camelia 1
patrickb Xliff: There is some discussion at github.com/MARTIMM/gnome-source-sk...l/issues/1
Xliff lizmat: So the tree can be precompiled, but not the bytecode... 16:05
Hmmm...
lizmat if you do something like:
my $mainline = BEGIN $ast.EVAL; $mainline()
that might work
Xliff lizmat: That's what I am hoping for. Thanks! 16:08
16:39 dakkar left 17:19 jpn left 17:21 GreaseMonkey left, jpn joined 17:22 greaser|q joined 17:26 jpn left 17:29 jpn joined 17:46 bigdata joined 18:00 reportable6 left 18:03 reportable6 joined 18:20 pusha left 18:27 sena_kun joined 18:31 rf joined
rf Afternoon folks 18:31
lizmat rf o/ 18:32
rf I am assuming it is morning or evening for you liz?
lizmat evening 8:32pm
rf Well, good evening in that case :-) 18:33
lizmat :-)
18:36 jpn left 19:29 jpn joined 19:53 jpn left, uzl[m] left, sena_kun left, uzl[m] joined
tonyo tbrowder__: ? 20:05
20:12 bigdata left 20:15 jpn joined 20:19 jpn left
tonyo patrickb: a lot of stuff can be done just using .^compose 20:41
m: ub gen-class(%fields) { my $class = class :: { }; for %fields -> $pair { $class.HOW.add_attribute($class, Attribute.new(:name("\$!{$pair.key}"), :type($pair.value), :package<Anon>)); $class.HOW.add_method($pair.key, $pair.key, method { 5 }); }; $class.^compose; $class; }; my $cls = gen-class({ :a(Int), :b(Str) }); dd $cls.a; # patrickb this can be extrapolated upon 20:56
camelia ===SORRY!=== Error while compiling <tmp>
Variable '%fields' is not declared. Perhaps you forgot a 'sub' if this
was intended to be part of a signature?
at <tmp>:1
------> ub gen-class(ā%fields) { my $class = class :: { }; for
tonyo m: sub gen-class(%fields) { my $class = class :: { }; for %fields -> $pair { $class.HOW.add_attribute($class, Attribute.new(:name("\$!{$pair.key}"), :type($pair.value), :package<Anon>)); $class.HOW.add_method($pair.key, $pair.key, method { 5 }); }; $class.^compose; $class; }; my $cls = gen-class({ :a(Int), :b(Str) }); dd $cls.a; # patrickb this can be extrapolated upon 20:57
camelia 5
tonyo this is how xoos hydrated data from a db, fwiw
21:12 Oshawott joined 21:15 archenoth left 21:34 rf left 21:46 sena_kun joined
tbrowder__ tonyo: the failed attempt was a try at passing an enum member to a sub. i could pass just the key, but i think there is a more rakuish way to do it 21:54
21:55 greaser|q left, greaser|q joined, greaser|q is now known as GreaseMonkey 21:57 tobs left 22:06 jpn joined 22:12 jpn left 22:19 tobs joined 22:26 sena_kun left 22:44 rf joined 23:27 sftp left 23:28 sftp joined 23:54 jpn joined 23:59 jpn left