🦋 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 RaycatWhoDat joined 00:02 reportable6 left 00:04 reportable6 joined 00:23 RaycatWhoDat left 00:34 guifa left 01:34 bloatable6 left, committable6 left, notable6 left, linkable6 left, greppable6 left, squashable6 left, evalable6 left, reportable6 left, nativecallable6 left, benchable6 left, releasable6 left, shareable6 left, sourceable6 left, coverable6 left, bisectable6 left, tellable6 left, unicodable6 left, statisfiable6 left, quotable6 left 01:35 quotable6 joined, sourceable6 joined, bisectable6 joined, committable6 joined, unicodable6 joined, linkable6 joined, squashable6 joined, benchable6 joined, statisfiable6 joined 01:36 coverable6 joined, reportable6 joined, releasable6 joined, bloatable6 joined, evalable6 joined, notable6 joined 01:37 shareable6 joined, nativecallable6 joined 01:38 greppable6 joined, tellable6 joined 01:59 guifa joined 02:17 frost joined 03:17 coverable6 left, squashable6 left, bisectable6 left, releasable6 left, greppable6 left, committable6 left, evalable6 left, quotable6 left, reportable6 left, sourceable6 left, notable6 left, shareable6 left, tellable6 left, bloatable6 left, linkable6 left, unicodable6 left, statisfiable6 left, nativecallable6 left, benchable6 left, Doc_Holliwood joined, reportable6 joined, notable6 joined, tellable6 joined 03:18 committable6 joined, shareable6 joined, linkable6 joined, releasable6 joined, benchable6 joined, statisfiable6 joined 03:19 bloatable6 joined, squashable6 joined, coverable6 joined, quotable6 joined, sourceable6 joined, nativecallable6 joined, bisectable6 joined, unicodable6 joined 03:20 greppable6 joined, evalable6 joined 03:23 RandalSchwartz left 03:41 yewscion left 03:55 swaggboi left 04:10 swaggboi joined 04:16 guifa left 04:18 guifa joined 04:34 squashable6 left, squashable6 joined 04:37 alarix joined 04:47 AlexDaniel left, demostanis[m] left, juanfra left, ComplYue[m] left, CIAvash left, tyil[m] left, juanfra joined 04:48 guifa left, guifa joined 04:49 demostanis[m] joined, AlexDaniel joined 04:50 tyil[m] joined, ComplYue[m] joined, CIAvash joined 05:05 guifa left 05:08 guifa joined 05:17 Doc_Holliwood left 05:19 guifa left 05:31 jmcgnh left 05:33 jmcgnh joined 05:36 Sgeo left 06:04 reportable6 left 06:06 reportable6 joined 06:28 stoned75_ left 06:30 stoned75 joined 06:32 ufobat_ joined 07:09 alarix left 07:39 stoned75 left 07:54 morayj joined 08:01 stoned75 joined 08:10 Doc_Holliwood joined 08:49 patrickb joined
lizmat weekly: p6steve.wordpress.com/2021/06/09/c...lace-html/ 09:05
notable6 lizmat, Noted! (weekly)
sjn title hints about a category error :-| 09:06
Altreus that's a useful term 09:07
I feel like I'm constantly spotting logical errors in things people do, and I'm always sure I'm not the first one to see this sort of thing but I have no idea how to express it! 09:08
lizmat I'd suggest reading the article 09:32
I guess a better title would have been: "Can writing Raku replace writing HTML" 09:33
do you agree?
09:36 Woodi_ is now known as Woodi
Altreus Feels like one of several recent articles that are certainly interesting from an academic/learning exercise perspective, but I'm not sure I'd want to combine these worlds 09:37
TBH this is largely because whenever I write HTML it always turns out to be way more complex than I expected 09:38
lizmat Well, fwiw, Cro and specifically Cro::WebApp::Template *are* combining these worlds 09:39
I guess, starting with Computer Based Training in the late 70s, has made me more aware of the frontend aspects of programs than of the backend :-) 09:40
Altreus I have yet to find a templating system that I actually find helps me to write HTML! 09:43
But this is because most of them are actually *text* processing systems
and none of them acknowledges the structure of HTML and works with it
09:43 stoned75 left
Altreus This HTML-in-Raku concept could definitely address that 09:43
09:43 Doc_Holliwood left
moon-child I did a little lisp-syntax-ish html templating thing at one point 09:45
unlike other similar things, it didn't have a concept of interpolation. Instead, everything was represented using functions
lizmat What I like about Cro::WebApp::Template, is that it actually all becomes executable code at some point 09:46
09:46 Doc_Holliwood joined
moon-child e.g.: [p this [em is] text]. That calls the function 'em' with the word 'is' as an argument, then argues the words 'this ' '<em>is</em>' ' text' to 'p' 09:46
so you can also call normal (computational) functions, but it's completely uniform
lizmat this is essentially what the § term does in the article 09:47
09:47 stoned75 joined
moon-child yes but it's ugly, you have to put quotation marks around everything :) 09:47
lizmat you mean the <html> part ? 09:48
moon-child §<p>(:id<demoFont>, 'Your Message (required)'). There are quotation marks around 'Your Message (required)' 09:49
which makes it more of a pain to e.g. emphasize a single word in long-form prose 09:50
lizmat well, you could e.g. apply markdown semantics on strings in the § handler 09:52
§<p>(:id<demoFont>, 'Your Message (*required*)'). 09:53
or just do:
§<p>(:id<demoFont>, 'Your Message (<em>required</em>)').
perhaps ?
09:57 patrickb left
Altreus lizmat: Does that mean there is, in theory, scope for Cro::WebApp::Template to have a "Skip this tag" function? Such that, if you've already started a tag, and later you find it's not required, you can bail on the whole thing? 10:02
This is one of two features I really need any HTML template language to offer me
The other one is a wrap-this-tag-if-condition sort of feature
lizmat well, Cro::WebApp has <?$variable> ... </?> 10:03
but for wrapping something, you'd need two of them atm 10:04
afaik
Altreus: could you give an example, so we're on the same page ? 10:05
Altreus well basically what you said 10:08
I never want to have to do something like [% IF link %]<a ...>[% END %] <whatever> [% IF link %]</a>[% END %] 10:09
I would MUCH rather do <whatever>[% IF link %]wrap <a ...>[% END %]</whatever>
tt2 syntax cos I'm not familiar enough with cro's :) 10:10
But if your template language is for HTML and not just text in general, you can make use of the fact that you can assume a DOM
A good example would be something like: <foreach page><div><span><if page != current_page>wrap <a href="link-to-$page"></if><= page ></span></div></foreach> 10:12
then you get <a><span>page_number</span></a> except for the current page, as is common on many pagination navs
lizmat where does the <a> come from ? 10:13
or did you mean s/a/div ?
10:14 holly_ left
lizmat fwiw, I could envision something like: 10:15
<§div $condition>foobar</§> 10:16
generating "<div>foobar</div>" if $condition is true, and "foobar" if it is false
moritz another common thing is: generate an <ul> with a list of <li>s only if my @array is non-empty 10:20
Altreus <div><a><span> really, yeah
lizmat: yes perfect, except this section sign is something I've been holding my tongue about
10:21 sena_kun joined
lizmat that would be <§ul @choices><@choices><li><$_></li></@></§> 10:21
Altreus The first blog post said "it's up there in the <wherever> on your keyboard" and I've not been able to tactfully say "Yeah on your nonstandard Mac layout"
moritz: at least with that, there's only one if wrapping it
lizmat and then only on a standard US Mac layout :-)
Altreus I just have a pet peeve for languages that make me repeat the if to close the tag
<?$variable <ul ...>> # would this look as horrible as I feel it would? 10:22
or, worse, make parsing hard
I'd proritise keeping the parser simple
lizmat moritz: perhaps even better: <§ul @choices><@choices li><$_></@></§> 10:23
making the wrapping of each iteration with <li> </li> more automatics
*s
Altreus <@choices? ul><@choices<> li> 10:24
This <> was a quick placeholder
But the "unpack" idiom from raku felt nice in this context
is that the right term? unpack?
lizmat <@choices></@> is already idiom in CWT for iterationg on @choices
setting $_ on each iteration 10:25
Altreus is there any existing meaning for <$VARIABLE-HERE WORDS HERE>?
lizmat don't think so
10:28 frost left
Altreus If not then we wouldn't be treading on anything, and the basic meaning would always be to "use WORDS HERE as the HTML tag, and act on it based on VARIABLE" 10:29
I'll ask 10:31
10:33 holly_ joined 11:01 aca joined 11:14 Doc_Holliwood left 11:15 holly_ left 11:26 aca left 11:38 yewscion joined 11:40 patrickb joined 11:45 holly_ joined 11:47 yewscion left 11:55 morayj left 12:00 frost joined 12:03 reportable6 left 12:04 reportable6 joined
stoned75 n 12:04
12:04 sono left
MasterDuke34 n+1 12:08
Altreus .. * 12:10
holly_ o.o 12:14
:o| 12:24
12:35 holly_ left 12:37 holly_ joined 12:40 abraxxa left
Geth ecosystem: stuart-little++ created pull request #592:
Add RakuRename to ecosystem
12:48
ecosystem: eed3caa44f | chirvasitua++ | META.list
Add RakuRename to ecosystem

See github.com/stuart-little/RakuRename
12:55
ecosystem: 766c4adbb9 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | META.list
Merge pull request #592 from stuart-little/RakuRename

Add RakuRename to ecosystem
12:59 abraxxa joined 13:02 Xliff left 13:21 patrickb left 13:30 RandalSchwartz joined 13:39 morayj joined
Geth doc: 54b178d544 | (Stoned Elipot)++ | doc/Type/Num.pod6
Add missing 'method' words
13:46
linkable6 Link: docs.raku.org/type/Num
14:00 sena_kun left 14:07 Sgeo joined 14:11 sena_kun joined 14:19 morayj left 14:31 frost left 14:38 ufobat__ joined 14:42 ufobat_ left 15:12 kylese joined 15:18 cnx joined 15:26 holly_ left 15:30 stoned75 left 15:37 holly_ joined
cnx hi, could sb remind me how to call a method with functional syntax? 15:41
15:43 holly_ left
cnx nvm i found it, it's call indirect invocant syntax, but why doesn't `add $*HOME: '.cache'` work? 15:50
moritz how does it not work? what does it do? what did you expect it to do? 16:26
16:33 japhb left 16:37 eseyman_ is now known as eseyman 16:41 ingy joined 16:45 monkey_ joined 16:54 kst left 17:03 lucerne joined 17:04 greyrat joined
greyrat Is the perf of raku better than perl? 17:05
moritz it always depends on what you do 17:15
there are cases where rakudo is faster than perl 5 (like tight loops with natively typed variables), and things where perl5 wins out hands down, like regexes 17:16
greyrat I was thinking of simple one-liners for data processing (`perl -lpe`) 17:24
It seems perl5 is still best there?
MasterDuke34 probably, raku's startup time is a bit slower than perl's 17:34
Altreus I would expect (he says, carefully) that you are more likely to run across unoptimised Raku than unoptimised Perl5 given an arbitrary thing
program 17:35
17:39 Raycat|Work joined 17:52 monkey_ left 17:53 ufobat__ left 17:54 monkey_ joined
jdv compilation and relatedly regexes tend to be slow 17:55
17:56 ufobat__ joined
m6locks www.youtube.com/watch?v=Kba9HqqBopA 18:02
18:02 reportable6 left 18:05 reportable6 joined 18:23 Doc_Holliwood joined 18:30 sono joined 18:32 colomon joined
colomon o/ 18:33
hi gang, I’m trying to figure out if the behavior I’m seeing in Hash.append is intentional or a bug
m: my %a = a => [1, 2, 3]; my %b = a => [4, 5, 6], b => [7, 8, 9]; %a.append(%b); say %a; %b<a>.push: 100; %b<b>.push: 200; say %a; 18:35
camelia {a => [1 2 3 4 5 6], b => [7 8 9]}
{a => [1 2 3 4 5 6], b => [7 8 9 200]}
colomon basically, when you do the append, if the original hash already has a member, then the values from the appended version are just pushed onto the existing array in the original. But if the original doesn’t have a member, the new member you get is just the original array. 18:37
I think I can work around it by prestaging, just wondering if I should have to or not; to me, the current behavior feels very inconsistent. 18:38
Altreus I guess the worst part of that is that the b array is copied by ref 18:39
codesections I'm not sure I followed, but aren't you describing the difference between .push and .append? 18:40
colomon @codesections nope 18:41
codesections m: say ^10 .grep: (:is-prime)
camelia (2 3 5 7)
colomon well, actually I think with push it would explicitly be a ref in both cases?
codesections rw
Altreus colomon: I guess I'm not sure what you want it to do 18:42
colomon I don’t want to have some of the arrays add their values and others a ref to the array 18:43
Altreus so the ref thing is the problem, not the recursive append? 18:44
colomon I don’t think it’s recursive?
Let me see if I can make a gist example which is clearer.
(we can still use evalbot with gists, right?) 18:45
m: gist.github.com 18:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3https:7⏏5//gist.github.com
expecting any of:
colon pair
colomon m: gist.github.com/colomon/1588c66596...83ab135fdf
camelia {a => [1 2 3 4 5 6], b => [7 8 9]}
{a => [1 2 3 4 5 6], b => [7 8 9 200]}
18:47 Shaeto joined
colomon The point being, even though I’ve done apparently the samy thing to %b<a> and %b<b>, only the change to %b<b> is reflected in %a, because %b<a> is added by values to %a, while %b<b> is added by ref. 18:47
obviously can be worked around by getting all the keys from %b and making sure they are also there in %a 18:48
but I can’t think of why you’d ever want append to behave the way it does? 18:49
18:52 monkey_ left
codesections Interesting; I see what you mean 19:01
19:04 kylese left
lizmat colomon: I think that qualifies as a bug 19:07
nine I think the displayed behaviour is consistent both internally and with the specification 19:14
codesections Without weighing in on whether it's a bug, I think you could get the behavior you want with %a.append: %b».clone 19:35
19:36 patrickb joined
codesections (which is easier than fooling with checking the keys is %a) 19:36
S/is/in/
lizmat afk again&
20:01 swaggboi left
raydiak do we have a way to search for modules by dependency? or any other way to know how much our modules are being used? noticed one of mine in some code in a conference talk, makes me wonder if I should pay more attention to some of them 20:05
I generally operate under the assumption that I'm off in a corner doing my own thing. If I thought any of it was being used by other people, I'd put more focus in those areas 20:08
20:09 swaggboi joined, stoned75 joined
MasterDuke34 jmerelo has created river diagrams before 20:15
raydiak any idea where I can see that, or the thing which generates it? even if it's outdated it'd at least be one data point 20:18
[Coke] be nice to get dependency searching on the web interface 20:19
MasterDuke34 i think it was in one of his personal repos. maybe just try looking in github
raydiak github.com/jmerelo shows zero public repos or even activity. maybe he'll see the mention here and chime in the next time he's around 20:23
oh wait, zef has rdepends. is that for installed modules, or the whole ecosystem? 20:24
20:24 Shaeto left
[Coke] cd 20:24
20:25 Shaeto joined
raydiak seems to be for the whole ecosystem, cool 20:26
Geth doc: 31bad392f4 | (Stoned Elipot)++ | doc/Type/Num.pod6
Add Num.Num
20:27
linkable6 Link: docs.raku.org/type/Num
m6locks MasterDuke34: what about here github.com/JJ 20:29
MasterDuke34 yep, github.com/JJ/raku-river
raydiak cool, thank you 20:30
SmokeMachine Hi there! it seems Perl6::TypeGraph is required by Documentable, but ref can't find it... 20:31
usercontent.irccloud-cdn.com/file/.../image.png 20:32
20:33 ufobat__ left
m6locks aye getting the same error 20:35
raydiak it was renamed: github.com/JJ/Raku-Doc-TypeGraph/c...517cffe0e5
and there is an issue: github.com/Raku/Documentable/issues/155 20:38
20:55 thundergnat joined 20:59 thundergnat left 21:15 thundergnat joined
thundergnat radiak: I use Image::Png::Portable quite a bit. I originally added the Barnsley fern example from Util's talk. 21:18
21:19 patrickb left
thundergnat So it's out in the wild. 21:19
Util_ thundergnat++
thundergnat Oh! hi Util++ Enjoyed your talk. 21:20
Util_ thundergnat: Thanks! I owed you a heads-up that I would be showing your code. I can only plead personal chaos for the failure. 21:21
thundergnat No problem, it's public code on a public site. I'm just glad there wasn't too much to dislike about it. 21:23
It was pretty much just a direct translation of the Perl entry. 21:24
[Coke] Util_: Hi there! 21:27
Looking forward to the next con where I can buy you a coffee or something. :)
Geth doc/real-coercers: 9fc1402f43 | (Stoned Elipot)++ | 2 files
Add Real.{Int,Num,Rat} coercers ref #3782

  ... and remove non-existent Numeric.{Int,Num,Real} ones
21:29
doc: stoned++ created pull request #3896:
Add Real.{Int,Num,Rat} coercers ref #3782
21:30
raydiak thundergnat: thanks for the feedback! I'll have a look at it, make sure it's current, start versioning it properly, all that. Let me know if you have any requests 21:31
21:31 linkable6 left
thundergnat radiak++ 21:31
raydiak Util++ good talk, I enjoyed it 21:32
21:32 linkable6 joined
thundergnat err raydiak++ (on mobile ) 21:32
[Coke] someone have a link to the talks? 21:33
(are they on YT yet?)
domm www.youtube.com/yapcna 21:34
codesections They were/are streamed live (the last set of lightning talks is going on now)
[Coke] ... that seems like an obvious link now that I see it. Thanks. :) 21:35
codesections and then are posted with a bit of a delay
[Coke] I think we need to agree to pronounce it like R(www.youtube.com/watch?v=gX13o7sovaY) 21:40
21:58 stoned75 left 21:59 hankache joined
SmokeMachine @codesections is there a link to épée? 22:08
raydiak hah, I like it
SmokeMachine that's not slack... sorry...
codesections: is there a link to épée?
22:10 xinming left 22:12 xinming joined, Shaeto left
codesections There isn't yet. I hope to release an alpha version soon – I had a usable version, but it required you to write too much JS, and I decided to re-do a portion of the API before presenting it in public 22:12
(which is why I wasn't planning to talk about it at the conference)
22:15 hankache left 22:16 Shaeto joined 22:21 linkable6 left, Shaeto left
Util_ raydiak: thanks! 22:22
22:23 linkable6 joined 22:34 Shaeto joined 22:38 Shaeto left
leont Released the Raku version of my module 30 minutes before my lightning talk, JIT conference-oriented programming 😅 22:40
22:43 Shaeto joined 22:48 Shaeto left 22:52 Shaeto joined 22:55 sena_kun left 22:57 Shaeto left 23:00 samcv left 23:01 swaggboi left, Shaeto joined
raydiak m: say Int.does: Numeric; say int.does: Int; say int.does: Numeric; 23:02
camelia True
True
False
raydiak is that right?
23:03 samcv joined 23:06 Shaeto left
codesections Hmm, that doesn't look right. 23:09
m: say int.does: Cool; say int.does: Real
camelia True
False
23:10 thundergnat left 23:11 Shaeto joined
raydiak I thought maybe it's because Numeric (and Real) are roles composed into parent classes of int, but that shouldn't be it either because this works: 23:11
m: role R {}; class A does R {}; class B is A {}; say B.does: R
camelia True
moon-child a guess: some cheating going on with native types
codesections Maybe it's something to do with the auto boxing for natives
yeah, that
m: my int $i = 1; say $i.does: Numeric 23:12
camelia True
raydiak ah...hm
m: my int $i = 1; say $i.WHAT 23:13
camelia (Int)
23:14 swaggboi joined
raydiak m: my int $i = 1; say $i.VAR.WHAT 23:14
camelia (IntLexRef)
raydiak m: my Int $i = 1; say $i.VAR.WHAT 23:15
camelia (Scalar)
raydiak now I'm in over my head :)
23:15 Shaeto left 23:20 yewscion joined 23:29 Shaeto joined 23:33 Shaeto left 23:38 Shaeto joined 23:42 Shaeto left 23:53 Doc_Holliwood left 23:56 Shaeto joined