🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | 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 8 June 2022.
00:00 reportable6 left, reportable6 joined 00:03 BinGOs left 00:04 bingos joined 00:05 bingos is now known as BinGOs 00:27 perlbot left, simcop2387 left 00:43 lichtkind_ left
SmokeMachine m: gist.github.com/FCO/333914ae1c6369...90eb5bc9b2 00:53
camelia (signal XCPU)
01:43 linkable6 left 01:44 linkable6 joined, simcop2387 joined 01:45 perlbot joined 02:45 nativecallable6 left, committable6 left, reportable6 left, benchable6 left, quotable6 left, linkable6 left, releasable6 left, greppable6 left, coverable6 left, bloatable6 left, evalable6 left, sourceable6 left, statisfiable6 left, unicodable6 left, shareable6 left, notable6 left, bisectable6 left, statisfiable6 joined 02:46 bisectable6 joined, greppable6 joined, notable6 joined, quotable6 joined, bloatable6 joined, sourceable6 joined 02:47 coverable6 joined, nativecallable6 joined, shareable6 joined, reportable6 joined, releasable6 joined, evalable6 joined, benchable6 joined 02:48 committable6 joined, unicodable6 joined, linkable6 joined 03:13 melezhik joined
melezhik o/ 03:13
looks like whateverable Rakudo builds are not accessible? - gist.github.com/melezhik/3f2364643...b7d32c81e1
^^ AlexDaniel
sparrowhub.io:2222/report/899 - init section 03:15
03:16 melezhik left 04:05 Kaipii joined, ismustac1 joined 04:08 ismustachio left, Kaipei left 04:31 tellable6 joined
AlexDaniel melezhik: I ran out of space again 😭 04:41
but it's fixed now
should be
tellable6 AlexDaniel, I'll pass your message to melezhik
04:44 Kaipii left 05:20 Kaipii joined 05:26 chickenwings joined 05:37 chickenwings left 06:07 reportable6 left, reportable6 joined 07:07 linkable6 left, evalable6 left 07:08 evalable6 joined, linkable6 joined 07:35 sena_kun joined 07:42 Kaipii is now known as Kaiepi 07:49 Sankalp joined, lichtkind_ joined 08:05 Sgeo left 08:15 sena_kun left 08:17 sena_kun joined 08:59 Kaiepi left 09:14 Kaiepi joined 09:15 lichtkind__ joined 09:18 lichtkind_ left, Sankalp left 09:19 Sankalp joined
Nemokosch Is there a situation where one should prefer @$array-actually over $array-actually[] ? 09:21
09:22 jaguart joined 09:25 sena_kun left
lizmat I think the former does $a.list and the latter returns $a itself 09:34
Nemokosch I think the latter is essentially what is also known as "decont" 09:45
lizmat could well be, would have to check :-) 09:49
10:08 sena_kun joined 10:35 Geth left 10:36 lizmat_ joined, Geth joined 10:38 lizmat left, lizmat_ is now known as lizmat
lizmat . 10:39
10:40 Geth left, Geth joined
Voldenet I prefer @$array-actually because it's more perl style 11:07
+ when i tested it with for @$ was actually faster, but I wouldn't bet on it 11:08
11:30 jercos_ left, jercos joined 12:06 reportable6 left 12:08 reportable6 joined
lizmat SmokeMachine: rak with default option value replacement and --json-per-line just uploaded 12:10
SmokeMachine lizmat: great news! \o/ 12:13
have you used the hyper one for --json-per-line?
12:18 jgaz joined
lizmat only at file level 12:21
12:49 sena_kun left 12:57 sena_kun joined
Nemokosch How would you write the data of a Supply to a file? 12:59
oh right, that may not even be the wisest way, so I could just say the issue 13:03
I want to generate a huge HTML file. By huge I mean that it could easily go up to dozens of megabytes 13:04
13:05 morte_ joined
The way HTML::Tag currently does it is by concatenating all strings of the world. I think this is a very obvious performance issue. 13:05
Since it's really just appending, it would be better to produce the data some different way than one humonguous string created by concatenating all strings on earth
This could be a buffer, too
or a supply
Something that I can write to, without building yet another several megabytes string 13:06
and then eventually I want to write it to a file
Voldenet I'd just tap .say or .write method into the supply with out-buffer set on the handle 13:07
japhb Nemokosch: concatenating on MoarVM is efficient; it uses strands internally
tellable6 japhb, I'll pass your message to Nemokosch
Nemokosch I only know that I had no patience for it to finish... 13:10
and I have the impression that after the last step, the slowdown was worse than linear
we will see... the other possibility is that the entity encoder/decoder module is slow but now that really has no reason to be slow... 13:16
Voldenet profile first, don't reason ;) 13:29
13:46 morte_ left 14:10 saint- joined
Nemokosch I don't hate my life enough for that, lol 14:16
Xliff m: use experimental :macros; macro S { quasi {{{ |&?ROUTINE.signature.params }}} }; sub a ($a, $b, $c) { say [$a, $b, $c] }; sub b ($a, $b, $c) { S.gist.say; }; b(1, 2, 3) 14:20
camelia ()
Xliff Hmmm... why is that not printing out [1,2,3]?
Is &?ROUTINE referring to S instead of b?
14:27 kbtz joined 14:35 xinming left 14:36 xinming joined 14:38 sena_kun left, kbtz left, kbtz joined
jaguart Just wondering - do the gods of Raku have any opinion either way on Dependency Injection vs Service Container? 14:43
14:46 sena_kun joined
Nemokosch The situation is worse than I imagined: this file that took me minutes to generate was somewhat less than 1 megabyte 15:14
not an outrageously big size even for a text file
15:28 ab5tract joined
ab5tract o/ 15:28
tellable6 2020-08-04T08:20:00Z #raku-dev <JJMerelo> .tell ab5tract how's your article for the 20th anniversary going?
2020-08-07T09:36:00Z #raku-dev <JJMerelo> .tell ab5tract amazing. Good luck.
2020-08-10T07:51:00Z #raku-dev <JJMerelo> .tell ab5tract will do. Also, online now.
ab5tract oof 15:29
I have not been around for a while :/
I hope everyone is doing well.
I was lurking in the logs and found that nine mentioned "low-hanging fruit" existing for the new-disp branch
I'm curious to make a few grabs for said fruit. 15:30
Xliff \o 15:31
ab5tract I've also got what I think is a bug: 15:34
m: my &w = *.contains('foo') && *.contains('bar'); say w("bar"); my &c = {$_.contains('foo') && $_.contains('bar')}; say c("bar") 15:36
camelia True
False
Nemokosch and indeed - the "naive" concatenation is faster than building a buffer from the string parts; not much faster but the fact that it's not slower is more than enough
Xliff my &c = sub { $^a.contains('foo') && $^a.contains('bar')}; say c("bar") 15:37
evalable6 False
ugexe m: my $a = 1 && 2; say $a
camelia 2
ab5tract IMO the WhateverCode version should require two arguments, just like other WhateverCodes that have two Whatever stars in them.
Xliff m: my &c = -> $_{ .contains('foo') && .contains('bar')}; say c("bar")
camelia ===SORRY!===
Shape declaration is not yet implemented; please use whitespace if you meant something else
at <tmp>:1
------> my &c = -> $_⏏{ .contains('foo') && .contains('bar')};
Invalid typename 'say' in parameter declaration.…
Xliff m: my &c = -> $_ { .contains('foo') && .contains('bar')}; say c("bar") 15:38
camelia False
Xliff Hmm.,
Voldenet >my &w = *.contains('foo') && *.contains('bar')
ab5tract m: my &w = *.Int * *.Int; say w(5); say w(5,5);
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
Xliff m: my &c = -> $_ { .contains('foo') && .contains('bar')}; say c("foobar")
camelia True
ugexe m: my $a = 1 && 2; say $a
camelia 2
Xliff Which is right.
ugexe that is why
Voldenet this probably equals to `my &w = *.contains('foo')`
m: my &w = *.contains('foo') && False; w("foo").say 15:39
camelia Type check failed in assignment to &w; expected Callable but got Bool (Bool::False)
in block <unit> at <tmp> line 1
ab5tract Xliff: yes, "foobar" should be the only thing that passes the whatevercode
Voldenet …or not
15:39 Sgeo joined
Xliff m: my &w = *.contains('foo') && *.contains('bar'); say w('foo', "bar"); 15:40
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
ab5tract I'm assuming some special case was made for whatevercode's that do a &&/||, for the sake of given/when
but if that is the case, it is broken
Xlifff: and that is what I would _expect_ the whatevercode to act like 15:41
I wonder if some elder Rakoon can shed some light
Voldenet m: my &w = True && *.contains("foo"); w("foo").say 15:42
camelia True
Voldenet Ah, it's as I thought
WhateverStar just doesn't support && at all
ab5tract m: my &w = *.so && *.contains("foo"); w("foo").say
camelia True
ab5tract m: my &w = (!*.so) && *.contains("foo"); w("foo").say 15:43
camelia True
ugexe m: my &w = -> {False} && *.contains("bar"); say w("bar");
camelia True
Voldenet m: my &w = *.say && *.contains("foo"); say "uh"; w("foo").say
camelia uh
True
Voldenet m: my &w = *.so.say && *.contains("foo"); say "uh"; w("foo").say
camelia uh
True
Voldenet wut
ab5tract Something fishy indeed
m: my &w = *.contains('foo') && *.contains('bar'); say w("foobrrr"); 15:44
camelia False
ab5tract m: my &w = *.contains('foo') && *.contains('bar'); say w("foo");
camelia False
Voldenet first Callable turns into True (and never gets called) and second Callable gets assigned
m: my &w = *.very-fancy-syntax.for-comments && *.contains("foo"); say "uh"; w("foo").say
camelia uh
True
ab5tract I have expect that the construction of whatevercodes will look very different in implementation in new-disp 15:45
They were very Dark Arts when I looked at them before
Voldenet probably rakuast could be relevant
ab5tract yup, I'm thinking the same. 15:46
it really should create a block that expects two arguments, in the case we are testing
that's how it works for every other multi-whatever whatevercode
m: my &w = *.contains('foo') & *.contains('bar'); say w("foo"); 15:47
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
ab5tract :)
.ask nine I'd be interested in perusing a list of low-hanging fruit for new-disp, if you have the tuits to put one together 15:48
tellable6 ab5tract, I'll pass your message to nine
ab5tract m: my &w = *.contains('foo') & *.contains('bar'); say w("pho", "foobar"); 15:49
camelia all(False, True)
ab5tract m: my &w = *.contains('foo') & *.contains('bar'); say so w("pho", "foobar");
camelia False
ab5tract m: my &w = so *.contains('foo') & *.contains('bar'); say w("pho", "foobar");
camelia False
16:01 Furor joined 16:04 vrurg_ joined, vrurg left, Colere left
ab5tract m: my &w = so *.contains('foo') and *.contains('bar'); say w("pho", "foobar"); 16:09
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
ab5tract m: my &w = so *.contains('foo') and *.contains('bar'); say w("foo");
camelia True
ab5tract m: my &w = *.contains('foo') && *.contains('bar'); say w("foo");
camelia False
16:09 dogbert17 left
ab5tract the plot thickens... 16:10
16:10 dogbert17 joined
japhb ab5tract: HI THERE! 16:12
Long time no see
ab5tract Hey japhb, great to see you 16:17
Voldenet I'd assume that * would turn expression into 'magic expression' where every * would become a separate parameter 16:18
ab5tract Voldenet: That is indeed what happens in every other case (that I know of, at least) 16:19
Voldenet so `my &x = *.contains(*.map(*))` would be valid
ab5tract m: my &x = *.contains(*); say x("hihi","hi") 16:20
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
ab5tract m: my &x = *.contains(*.Str); say x("hihi","hi")
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
Voldenet actually *.Str gets passed as WhateverCode to contains
`my &w = "foobar".contains(*)` isn't valid either 16:21
ab5tract m: my &x = *.contains(*.Str); say x("hihi")("hi")
camelia Cannot resolve caller contains(Str:D: WhateverCode:D); none of these signatures matches:
(List:D: Cool:D \needle, *%_)
(Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> Bool)
(Cool:D: Cool:D $needle, :m(:$ignorema…
Voldenet Well, it sort of is, but not in a way you would expect
16:22 morte_ joined
ab5tract m: my &x = "foo".contains(*); say x("f") 16:22
camelia Cannot resolve caller contains(Str:D: Whatever:D); none of these signatures matches:
(List:D: Cool:D \needle, *%_)
(Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> Bool)
(Cool:D: Cool:D $needle, :m(:$ignoremark)!…
ab5tract Right, there's something about needing some operators in the mix that creates a proper whatevercode 16:23
The best question is whether or not the current limitations were by design or due to implementation constraints
Voldenet because of such cases I don't use much WhateverStar outside of trivial use cases
ab5tract Yeah, it's got a bit too many curious corners for heavy use 16:24
m: my &x = { "foo".contains(*) }; say x("f")
camelia Cannot resolve caller contains(Str:D: Whatever:D); none of these signatures matches:
(List:D: Cool:D \needle, *%_)
(Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> Bool)
(Cool:D: Cool:D $needle, :m(:$ignoremark)!…
Voldenet {"foo".contains($^a)} isn't that much longer
ab5tract m: my &x = { "foo".contains(*.Str) }; say x("f") 16:25
camelia Cannot resolve caller contains(Str:D: WhateverCode:D); none of these signatures matches:
(List:D: Cool:D \needle, *%_)
(Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> Bool)
(Cool:D: Cool:D $needle, :m(:$ignorema…
ab5tract m: my &x = { "foo".contains($_.Str) }; say x("f")
camelia True
ab5tract Yeah, it's honestly a bit strange, the way it works now... it's a bit more consistent "just" as a whatever
japhb ab5tract: I've got to run in a couple minutes, but would you mind dropping me an email? Got some Terminal::* stuff to chat with you about ... 16:26
ab5tract The reason that contains(*) isn't working is because that is actually passing Whatever as an argument to the method, which the method could create a candidate for
japhb: Sure thing! 16:27
m: my &w = * - 1; my @f = ^5; say @f[w(@f.size - 1)] 16:29
camelia No such method 'size' for invocant of type 'Array'. Did you mean any
of these: 'sign', 'sin', 'sinh', 'sink', 'slice'?
in block <unit> at <tmp> line 1
ab5tract m: my &w = * - 1; my @f = ^5; say @f[w(@f - 1)]
camelia 3
Voldenet it's really useful when you do code like .map(*.a.b.c)
ab5tract m: my &w = * - 1; my @f = ^5; say @f[w(@f)]
camelia 4
ab5tract ^^ that's more or less the code that makes @array[*-1] work 16:30
Voldenet: yup. 16:31
my @a = ^5; dd @a.kv.map: [*,*] 16:32
m: my @a = ^5; dd @a.kv.map: [*,*]
camelia Cannot map a Seq using a Array
Did a * (Whatever) get absorbed by a comma, range, series, or list repetition?
Consider using a block if any of these are necessary for your mapping code.
in block <unit> at <tmp> line 1
ab5tract m: my @a = ^5; dd @a.kv.map: * + *
camelia (0, 2, 4, 6, 8).Seq
16:33 [Coke] left
ab5tract It gets less useful when you add more arguments, but I wonder if that is because of inconsistency and strange constraints than anything else 16:34
m: my @a = ^5; dd @a.kv.map: { [$^a,  $^b] };
camelia ([0, 0], [1, 1], [2, 2], [3, 3], [4, 4]).Seq
Voldenet m: my &f = [+] *; f((1, 2, 3)); 16:39
camelia Cannot resolve caller Numeric(Whatever:D: ); none of these signatures matches:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
Voldenet …also wrong
16:40 [Coke] joined 16:41 discord-raku-bot left 16:42 discord-raku-bot joined 16:44 simcop2387 left, [Coke] left 16:45 [Coke] joined, perlbot left, perlbot joined 16:47 simcop2387 joined 16:54 kbtz left 16:59 jgaz left 17:09 sena_kun left
ab5tract m: my &w = * Z=> True; say w(<a b c>); my &c = { $_ Z=> True }; say c(<a b c>) 17:14
camelia (a => True)
(a => True)
ab5tract m: my &w = * Z=> True; say w(<a b c>); my &c = { @_ Z=> True }; say c(<a b c>) 17:15
camelia (a => True)
(a => True)
ab5tract m: say <a b c> Z=> True
camelia (a => True)
ab5tract ok, I wasn't expecting that.. 17:16
Ahh, doh!
m: my &w = * X=> True; say w(<a b c>); my &c = { @_ X=> True }; say c(<a b c>) 17:17
camelia (a => True b => True c => True)
(a => True b => True c => True)
ab5tract Yeah, it's so weird, what works and what doesn't work with whatevercodes
17:19 melezhik joined
Nemokosch yes, frankly.. 17:19
melezhik AlexDaniel whatevarable builds  work now, thanks
tellable6 2022-07-20T10:04:47Z #raku <jjatria> melezhik: I saw that you had sent it, but I haven't had a chance to take a proper look. I'll try to look at it over the weekend 🙇
2022-07-22T04:41:25Z #raku <AlexDaniel> melezhik: I ran out of space again 😭
SmokeMachine jaguart: I’m not one of these, but I’ve been playing with this (github.com/FCO/Injector) for a while… but I’ve never used that for anything serious… 17:27
ab5tract .ask moritz I'm curious whether you have any recollections as to how whatever's ended up with their current constraints. Were the limitations based on implementation, limits to parsing, or through considered design? 17:31
tellable6 ab5tract, I'll pass your message to moritz
17:32 melezhik left
Nemokosch yesterday I opened an issue for a WhateverCode constraint 17:33
for that matter
github.com/rakudo/rakudo/issues/4995 here it is
okay, I messed up the testing; concatenation seems slower but the difference is rather insignificant still, could be 5% 17:42
jaguart SmokeMachine++ - thanks 17:43
17:46 sena_kun joined 17:51 saint- left
Nemokosch I managed to reduce the time to less than half just by making the render function hypered... 17:52
17:53 ismustac1 left
ab5tract Nemokosch: Looks like there is some community impulse towards looking into whatevers going forward 17:56
tellable6 ab5tract, I'll pass your message to Nemokosch
ab5tract Nemokosch: What's this other thing you are working on? 17:57
tellable6 ab5tract, I'll pass your message to Nemokosch
17:57 Kaiepi left
Nemokosch I'm still sure there is something painfully slow about the rendering 17:57
And as my luck goes, perhaps Voldenet was right again and it is in fact the entity replacement 17:58
I can temporarily remove that because I probably don't even have anything to remove
XDDD 18:01
so yeah 18:02
with encode-html-entities: 160 seconds (with hypering)
without encode-html-entities: 20 seconds (again, with hypering) 18:03
this is absurd
ab5tract Is encode-html-entities from a library?
Also, what is this that you are working on? Color me curious 18:04
Nemokosch yes, encode-html-entities is from XML::Entity::HTML 18:05
18:06 reportable6 left
I want to generate a HTML report from Jira data 18:06
18:09 reportable6 joined
moritz ab5tract: erm, limitations of what, specifically? 18:10
tellable6 2022-07-22T17:31:54Z #raku <ab5tract> moritz I'm curious whether you have any recollections as to how whatever's ended up with their current constraints. Were the limitations based on implementation, limits to parsing, or through considered design?
18:10 morte_ left
moritz what, Whatever star? 18:10
ab5tract There doesn't seem to be any hard edged rules that apply to what can be done and what can't 18:11
But yeah, I'm speaking here in terms of the currying functionality
moritz there aren't?
I'm pretty sure there
you can current *.method and * passed to "regular" operators (which exclude things like conditional execution, like &&, and assignment operators) 18:12
ab5tract then I would expect this not to even become a whatevercode 18:13
m: my &w = *.contains('foo') && *.contains('bar'); say w("foo");
camelia False
moritz the currying also stops as sub and method arguments, because you want to able write @a.map(*.sqrt) and get a list
maybe I misremeber the part about short-circuiting operators 18:14
ab5tract nope I expect you remember correctly and something snuck in 18:15
The above behavior would ideally create a two-arg WhateverCode
m: my &w = *.contains('foo') && *.contains('bar'); say w("bar");
camelia True
ab5tract (or generate a failure) 18:16
moritz github.com/rakudo/rakudo/blob/mast...554-L10590
18:24 ismustac1 joined 18:33 Kaiepi joined
ab5tract Those restrictions are clear, yeah. 18:39
But things like:
m: &w = [+] *; say w([1,2,3])
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
w used at line 1
ab5tract m: my &w = [+] *; say w([1,2,3]) 18:40
camelia Cannot resolve caller Numeric(Whatever:D: ); none of these signatures matches:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
ab5tract seem to fail for more unclear reasons. 18:41
18:52 ismustac1 left 18:56 vrurg_ is now known as vrurg 19:11 [Coke] left 19:14 [Coke] joined 19:46 Nemokosch joined
Nemokosch m: my $dummy-data = { testCase => { something => 33 }}; say ($dummy-data{'testCase'; 'objective'} // '-'); 19:46
camelia ((Any))
tellable6 2022-07-19T12:27:09Z #raku <SmokeMachine> Nemokosch: you mean like this 👆?
2022-07-20T13:15:03Z #raku <lizmat> Nemokosch: perhaps, but "rak" is not about speed, but about features :-)
2022-07-20T13:19:32Z #raku <lizmat> Nemokosch: if the outer part of your JSON is an array, you could use raku.land/zef:lizmat/JSON::Fast::Hyper to make things about 3x as fast
2022-07-22T13:07:13Z #raku <japhb> Nemokosch: concatenating on MoarVM is efficient; it uses strands internally
2022-07-22T17:56:44Z #raku <ab5tract> Nemokosch: Looks like there is some community impulse towards looking into whatevers going forward
2022-07-22T17:57:02Z #raku <ab5tract> Nemokosch: What's this other thing you are working on?
Nemokosch let me reiterate 19:47
m: my $dummy-data = { testCase => { something => 33 }}; say ($dummy-data{'testCase'; 'objective'} // '-');
camelia ((Any))
Nemokosch I feel like throwing something against the wall. -Ofun, you said?
m: my $dummy-data = { testCase => { something => 33 }}; say (($dummy-data{'testCase'; 'objective'}) // '-') 19:48
camelia ((Any))
Nemokosch There is just no escape
SmokeMachine m: use v6.*; my $dummy-data = { testCase => { something => 33 }};  say (($dummy-data{'testCase'; 'objective'}) // '-') 19:49
camelia -
Nemokosch you know what the funny thing is 19:51
m: my $dummy-data = { testCase => { something => 33, objective => 'survive Raku' }}; say ($dummy-data{'testCase'; 'objective'} // '-')
camelia (survive Raku)
Nemokosch why is this a godforsaken array 19:52
lizmat Nemokosch: multidim hash access in 6.c and 6.d was meh
SmokeMachine Before v6.e it returned a List…
Nemokosch yes, List, to be precise
lizmat I think I fixed a lot of that to get the same semantics everywhere
yes, and it shouldn't, just as @a[42] doesn't return a list 19:53
Nemokosch It's definitely relieving to know that I'm not the one to explore all this
lizmat so 6.c and 6.d are wrong on that respect
Nemokosch Still waiting for the day when I don't bump into issues that make my head ache 19:54
And this is not an overstatement. I bump into issues every single day I'm using Raku.
lizmat sorry to hear you're bumping your head a lot
:-( 19:55
do you create Github issues for the issues you encounter ?
Nemokosch Today I only created one. :DD 19:56
and even that was for a library... you might know it, XML::Entity::HTML
lizmat github.com/rakudo/rakudo/issues/4996 ?
Nemokosch Oh right, that was yesterday 19:57
Yesterday I created 3 I think
lizmat 2 that I can see? 20:12
Nemokosch One was in problem solving 20:13
lizmat check 20:16
Nemokosch the other thing is, sadly, still the performance 20:17
Bringing back ~ 5 MB from a REST API with Cro: 3-5 seconds; could be better, could be worse 20:21
Parsing it with JSON::Fast: again, say, 2-3 seconds, not competing with the "elite" but not a show-stopper
Building up a HTML structure with HTML::Tag that I took over: similar result, definitely seconds but a forgivable amount of them
And then comes the parsing of HTML tags to normal HTML text... 5MB HTML took second on 4 cores, with almost 4GB memory usage, this is insane
180 seconds*
and this with "optimized usage", that is, I minimized the use of XML::Entity::HTML to basically zero
if I let that encode the characters, it would be easily over 10 minutes 20:22
I could jokingly say that I might write the tags down in that time 20:23
Thankfully this machine is strong enough to run 3 or 4 VMs of railway control systems but come on... 20:25
lizmat Nemokosch: looking at the HTML::Tag code.... it feels like it was ported from Perl a *long* time ago 20:26
and I'm not sure what the logic behind "do-assignments" is ? 20:27
Nemokosch was that the one that just spammed attribute = field if the field is present? 20:28
with the gazillion of callsame dispatches 20:29
lizmat well, for one, I'm not sure why it uses callsame, instead of nextsame at the end 20:32
callsame in sink context is a code smell
Nemokosch When I looked at it, I couldn't even decide if it was correct. Apparently callsame does return but I wouldn't have known by heart 20:33
lizmat callsame returns *and* spends time returning a value 20:34
Nemokosch Changing it to nextsame at the end is a no-brainer, but do you think that can be a significant win?
lizmat I think it will be noticeable 20:35
Nemokosch well, let's try, that doesn't break any test cases :D
lizmat looking at it some more, my fingers start itching, for two reasons 20:40
1. that's a mighty cumbersome interface, with a lot of required typing 20:41
instead of: say HTML::Tag::p.new(:text('This is my paragraph'), :class('pretty')).render
why not:
say p(:text('This is my paragraph'), :class('pretty'))
??
2. this feels like you need a templating engine? 20:42
cro.services/docs/reference/cro-webapp-template is a templating engine integrated in Cro, but can also be used stand-alone 20:43
see cro.services/docs/reference/cro-we...e_language for features
irclogs.raku.org uses Cro::WebAPp 20:44
Nemokosch Look, if Cro, which imports most of the known universe, is the best tool to generate an utterly dumb HTML file, then I might as well stop programming and use Word 20:45
lizmat I think Cro::WebApp is a little leaner on the dependencies: github.com/croservices/cro-webapp/...META6.json 20:46
20:46 evalable6 left, linkable6 left, linkable6 joined
Nemokosch But I don't need a web app, I just need a lot of tables 20:47
lizmat ah, ok, Cro::HTTP drags in a lot
ok
Nemokosch it's really just a big dumb file that looks like 1995
patrickb I think it's a good idea to dog food one of our rather important libraries.
Nemokosch I could have used PDF if PDF wasn't mostly like a vectorgraphic sheet one can draw onto
lizmat ok, could you create a gist with the elements that you need? 20:48
because 1995 HTML is HTML I know all about :-)
Nemokosch by the way, it didn't really get faster with nextsame, honestly
patrickb Also the looks of a web page has nothing to do with the complexity of the server side code.
20:48 evalable6 joined
Nemokosch 175 s on the last execution 20:49
lizmat Nemokosch: well, I guess new-disp took care off that
so that's 5 sec better ?
Nemokosch that could easily be within the error margin; there are nondeterministic parts and also, I'm using the computer so the load on different cores can change I guess 20:50
patrickb Ugh, I'm a bit ranty tonight. Sorry for that. I guess I should head for bed...
o/
Nemokosch Me too, man xD
But yeah, if taking over a 5 years old module and refurbishing it is not "dog fooding", I'm frankly not sure what is 20:51
lizmat Nemokosch: if you have time tomorrow, could you write a gist on what you actually need ?
Nemokosch It's not that long really 20:52
html, body, table, tr, th, td, h-elements, maybe hr, em (or span, CSS is a thing after all) 20:53
I think that's it
Anyway, I still can't get over the fact that something this banal needs a nuclear reactor to work 20:54
and not the objects, absolutely not, those are bearable 20:55
the rendering, the rendering and again, the rendering
which is essentially about building one big string and that's about it
lizmat .render should just be .Str really, I'd say
Nemokosch but like what can be so grotesquely slow about it? I can also only think of this do-assignment crap 20:56
lizmat well, there's also 20:57
Nemokosch also what?
lizmat github.com/2colours/HTML-Tag/blob/...akumod#L21 # introduces an additions scope that is not needed 20:58
same for github.com/2colours/HTML-Tag/blob/...akumod#L22
no use of private attributes, they all use the public accessor methods
need to go afk now, will check in again tomorrow 20:59
Nemokosch what scope?
lizmat {encode-html-entities($.attr{$_}.Str)}
that line could be written as: 21:00
Nemokosch you of all people should know how morbidly slow encode-html-entities itself is, in the first place...
21:00 melezhik joined
lizmat qq/ $_="&encode-html-entities($.attr{$_}.Str()"/ 21:00
Nemokosch I made changes about this part, by the way. I not only didn't like this imperative map but it's not very hypering friendly, so to speak 21:01
also, what I don't like about that line is that $_ is already identified as 'value' 21:03
melezhik Hi lizmat I am running tomty tests for App::Rak and they fail on SparkyCI - sparrowhub.io:2222/report/902
lizmat need to be afk now :-)
&
sorry
Nemokosch so it could be written as $.attr<value> and then one wouldn't have to wonder what $_ might be here
melezhik no worries
Nemokosch melezhik: how do Sparky and Sparrow relate to each other? I could never quite follow your activity. 21:05
melezhik SparkyCI is CI server. The way it could be extended is writing Sparrow plugins - github.com/melezhik/sparkyci/blob/...ci-plugins 21:06
well this is not _all_ truth 😁 - there is also Sparky - low CI level server, but you probably asking about SparkyCI - sparrowhub.io:2222 21:07
low -> low level 21:09
Nemokosch yes yes
so what is Sparrow, after all? Is it an automation tool in a broader sense? 21:10
melezhik exactly
this is framework for gluing of many languages into Raku code 21:11
so ones say writes code on Bash ( where it's appropriate ) and Sparrow would glue it and expose it as Raku function
that is it
the same stands for Python/Perl/Powershell/Ruby
japhb tonyo: Are there docs on creating a zef/fez org and populating it with uploaders? 21:12
melezhik plus one has Raku backed DSL to write tests for scripts stdout
it all included into Sparrow
a plenty of examples ( well plugins ) - sparrowhub.io 21:13
Nemokosch I need something happy :D after turning my office computer into a nuclear reactor by rendering a 5MB HTML file 21:14
21:21 melezhik left 21:38 sena_kun left
Quibono Does anyone just write in NQP directly instead of raku, or does that only make sense from the perspective of writing the compiler? 21:42
Nemokosch It can be seen as a means of optimization in certain cases 21:44
like I think you can actually come across NQP calls in some modules
japhb JSON::Fast and CBOR::Simple both use nqp::op() calls, but they are written in Raku. They just break the abstraction. Repeatedly. For great justice. 21:45
Quibono So is there like a use case for writing NQP? 21:46
ab5tract I've considered working through Crafting Interpreters in NQP 21:47
The use case is generally speed.
Nemokosch and speed is, let's be honest, still a very considerable challenge 21:48
khm, after suffering for one day with the nuclear reactor module that I adopted... 21:50
it should generate simple HTML but it turns your computer into a nuclear reactor for minutes instead
xD
Quibono Raku still pretty slow eh? Like how bad is it, I thought it recently got a lot faster 21:52
Nemokosch I wonder how slow it could have been before
usually when they say it got faster, it indeed got faster, the results reacknowledge that the gaps between the obvious way and the tricky way closed
Quibono So like slower than python slow? Are there graphs lol 21:54
Nemokosch Definitely slower
And I think this is especially true for a naively implemented native module
by native I mean pure Raku
The trick is the nuclear reactor part 21:55
it's really easy to run all the cores on max, lol
SmokeMachine Why not `p(‘This is my paragraph’), :class(‘pretty’))` (without the names parameter for text)?
Quibono Lol 21:56
Is it known /why/ raku is so slow? Like python is known for being slow.
Nemokosch and then you can decrease the time for, idk, a quarter
running CPU at 500% be like
sometimes that's still not enough, though, and I just came across a situation like that
> Why not p(‘This is my paragraph’), :class(‘pretty’)) (without the names parameter for text)? 21:58
Other than this has an unmatching number of parens? 😛 I don't know frankly, but tag('p', text => 'This is my paragraph', class => 'pretty' ) isn't that bad anymore
if I were to guess, simply because the author was lazy to write constructors by hand or something
Nobody likes to appear thankless but you know, there is one way bigger problem with that module than the interface. If you ask me, the interface is bearable - that's why I adopted it in the first place. 22:00
I would say, you guys are allowed to make 5 picky remarks *per one performance idea*
because it cannot be that I need the resources of 5 youtube videos in the browser, for generating a banally simple, 5 MB large HTML file 22:02
and very apparently it's not only XML::Entity::HTML that is very slow about it
I'd say that's even less usable in its current condition but that's not meant as an excuse 22:03
22:08 silug left 22:10 ab5tract left
Quibono So is it known if the performance issue is more the compiler not emitting optimized bytecode or moreso the VM being slow? 22:19
japhb Quibono: One of the major intermediate layers of the compiler is being rewritten presently, and among other things should allow easier static optimization. *General* speed improvements (as opposed to specific routines found to be bottlenecks) are essentially waiting behind that. 22:29
There are also WIP improvements to run-time optimizations, but again they are at present waiting for RakuAST to complete and merge. 22:30
Quibono Gotcha. Any ideas on order of magnitude speed improvements from that? I’d love to help but I’m a raku newb lol 22:31
22:39 Nemokosch left 22:40 lichtkind__ left, silug joined
Nemokosch To be honest, RakuAST is so promising that we have a lot of reason to wait for it even without performance considerations 22:40
is RakuAST MoarVM specific, though? 22:43
guifa No
If you look at the source for it, everything RakuAST compiles either (A) to Raku code or (B) NQP/QAST 22:44
And that will work fine on all the backends 22:45
Nemokosch Oh okay 22:50
I tend to ask about this, less because I actually want to use a different backend anytime soon, and more because I want to get a better understanding of the architecture
22:50 kbtz joined 22:52 kbtz left
guifa Yeah. The impetus for RakuAST was to basically allow things that could only be done using QAST 22:59
Except that QAST has been explicitly a Rakudo-only thing
23:03 kbtz joined
SmokeMachine Nemkosch… yes, the first ) is wrong 23:09
Quibono So what is the difference between RakuAST and the current architecture 23:15
SmokeMachine Nemokosch: I have done something that looks like that: github.com/FCO/MemoizedDOM/blob/ma...o/Todo.pm6 23:16
tellable6 SmokeMachine, I'll pass your message to Nemokosch
Voldenet Quibono: without rakuast to generate code you have to use EVAL, with rakuast you can really just generate the code by passing proper parts of it 23:28
Quibono Yeah I found a nice slide deck explaining it. 23:31
I guess like out of curiosity would there be interest in alternative VMs/compilers for Raku? 23:38
japhb Quibono: Alternative VMs is already a thing (though of course, if that's your thing, go for it!) -- so far MoarVM, JVM, and V8 (JavaScript) can all be used. One of the *other* advantages of NQP is that it forms a portability layer. 23:54
Quibono Okay so three VMs one compiler 23:56
23:58 Furor is now known as Colere