šŸ¦‹ 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 00:01 reportable6 joined 00:33 andydude left 00:45 kjp left 00:51 derpydoo joined 00:52 kjp joined 00:58 andydude joined 01:58 coverable6 left, greppable6 left, benchable6 left, notable6 left, statisfiable6 left, evalable6 left, shareable6 left, tellable6 left, linkable6 left 01:59 statisfiable6 joined, linkable6 joined, greppable6 joined, notable6 joined 02:00 shareable6 joined, tellable6 joined, benchable6 joined 02:01 coverable6 joined, evalable6 joined
[Coke] m: (4...1).List.say 02:08
camelia (4 3 2 1)
02:20 teatwo joined, teatwo left 02:21 teatwo joined, teatwo left 02:22 teatwo joined 02:23 tea3po left 02:24 teatwo left 02:25 teatwo joined 02:35 Maylay left 02:40 teatwo left 02:41 teatwo joined 02:49 Maylay joined 03:49 linkable6 left, evalable6 left, releasable6 left 03:50 evalable6 joined 03:51 linkable6 joined, releasable6 joined 04:51 statisfiable6 left, squashable6 left, sourceable6 left, benchable6 left, evalable6 left, linkable6 left, committable6 left, bloatable6 left, reportable6 left, bisectable6 left, unicodable6 left, reportable6 joined 04:52 unicodable6 joined, benchable6 joined, evalable6 joined, sourceable6 joined, bisectable6 joined, statisfiable6 joined 04:53 linkable6 joined, bloatable6 joined, squashable6 joined 04:54 committable6 joined 05:10 jpn joined 05:14 jpn left 05:33 jpn joined 05:40 jpn left 05:56 jpn joined 06:00 reportable6 left 06:02 reportable6 joined 06:55 jpn left 07:09 jpn joined 07:13 jpn left 07:16 jpn joined 07:29 sena_kun joined 07:35 jpn left 07:38 andydude left 07:39 jpn joined 07:49 sena_kun left
Nemokosch 4..1 is an empty range 07:56
08:00 grondilu joined
Voldenet I confirm, 4..1 is an empty range, I'd expect obvious 2**32-2 elements 08:02
08:37 teatime joined
grondilu Hi all. 08:44
08:46 derpydoo left
grondilu Earlier I tried to compile rakudo/MoarVM with zig, using --moar-option='--compiler="zig cc"' 08:47
that failed, but today I tried --moar-option='--cc=zig cc' and that worked.
Voldenet is it any different though? 08:48
grondilu for some reason, --moar-option='--cc="zig cc"' (mind the double quotes) did not
Voldenet: it seems similar
the main reason I'm interested in zig is that it compiles to WASM
Voldenet it'll probably be very similar to clang ā€“target=wasm32 08:50
grondilu does that work, though? 09:01
Voldenet not at all, apparently standard libs can't be used in that case 09:09
09:14 jpn left
Voldenet amazing if wasm target works on zig cc ootb 09:14
09:40 Sgeo left 10:34 lonewolf-dev joined 10:35 m_athias left 10:36 camelia left
lonewolf-dev why is raku so slow? 10:36
10:36 nine left
lonewolf-dev how can i make it faster? 10:36
a simple for loop that counts to a 100k in perl is so much faster than in raku. 10:37
10:37 m_athias joined
lonewolf-dev how do i compile raku to the jvm? 10:38
10:38 nine joined 10:40 camelia joined
lizmat lonewolf-dev: answering your questions in reverse order 10:45
1. by selecting the JVM as backend 10:46
10:46 camelia left, nine left, m_athias left, nine joined
lizmat 2. generally, if you are using with integers, things will go faster if you're using native integers (what perl does by default) 10:48
10:48 m_athias joined
lizmat 3. you could help by showing what constructs are slower than you expect, and then hope an easy solution can be found 10:48
4. because it doesn't have 30+ of optimizations under its belt yet 10:49
10:56 camelia joined, oodani_ left 10:57 oodani joined 11:05 grondilu left 11:08 MoC joined
lonewolf-dev is rakudo on jvm backend faster than moarvm? 11:11
lizmat I guess for some tasks, I wouldn't know: my focus is on MoarVM as backend 11:15
lonewolf-dev Isnt it possible to port all perl modules to raku? No need to reinvent the wheel. 11:17
lizmat it is possible, and I've done quite a few of them, but perl is no longer of interest to me 11:23
as my efforts were seen as trying to devalue perl by many (prominent) Perl community members
so my taste in doing that, has soured significantly
Nemokosch Please be aware that the "jvm backend" is not like Kotlin, Clojure, Scala and the likes, it does not actually target the JVM the way these languages do 11:24
The term itself is rather unfortunate. It's rather a backend that runs on top of the JVM 11:25
lizmat lonewolf-dev: raku.land/tags/cpan5
Nemokosch It's as if you called MoarVM the "C backend"
lizmat lonewolf-dev: raku.land/zef:lizmat/P5built-ins 11:26
Nemokosch Also, let's call things by their name, at least here: Perl is a language that only hobbyist hipsters learn in 2023. One might say that the same is true for Raku as well but if you look at both languages, I doubt there is any question which one you'd rather enjoy using 11:28
11:32 jpn joined
lonewolf-dev ok 11:33
11:33 lonewolf-dev left 11:39 jpn left 12:00 reportable6 left 12:01 reportable6 joined
tbrowder__ .ask tonyo thnks, inside that example sub will smartmatching work (don't have time to try it, gotta run for a while) 12:15
tellable6 tbrowder__, I'll pass your message to tonyo
tonyo tbrowder__: it should 12:26
tellable6 2023-05-20T12:15:40Z #raku <tbrowder__> tonyo thnks, inside that example sub will smartmatching work (don't have time to try it, gotta run for a while)
tonyo m: enum A <A1 A2 A3>; sub a (A:D $a) { say $a ~~ A2; }; a(A1); a(A2); # tbrowder__ (smartmatching)
camelia False
True
12:27 jpn joined 12:33 jpn left 12:36 jpn joined 12:52 jpn left
tbrowder__ tony: so cool! thnx. that's what i was trying to do but must have murfled the syntax somehow. 13:01
13:04 peder left
tbrowder__ m: enum btype <afm ff>; sub f(btype $typ) { if $typ ~~ afm { say "do afm stuff } else { say "do ff stuff"}}; f(afm); f(ff); 13:06
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> se { say "do ff stuff"}}; f(afm); f(ff);ā<EOL>
expecting ā€¦
tbrowder__ crud, typo :-(
13:07 peder joined
tbrowder__ m: enum btyp <afm ff>; sub f(btype $t) { if $t ~~ afm { say "do afm"} else { say "do ff"}}; f(afm); f(ff); f(bad) 13:09
camelia ===SORRY!=== Error while compiling <tmp>
Invalid typename 'btype' in parameter declaration. Did you mean
'btyp'?
at <tmp>:1
------> enum btyp <afm ff>; sub f(btypeā $t) { if $t ~~ afm { say "do afm"} else
tbrowder__ doing this back at home in my own REPL 13:10
13:24 jpn joined 13:29 jpn left 13:31 sivoais left 13:36 jpn joined 13:42 sivoais joined 13:46 jpn left
tbrowder__ m: enum btyp <a b>; class f { has btyp $.t}; my $o = f.new: :t(a); 13:48
camelia ( no output )
13:49 guifa joined
tbrowder__ m: enum btyp <a>; class f { has btyp $.t = a; }; my $o = f.new; say $o.t 13:50
camelia a
tbrowder__ hm, that's cool, it ought to work the same at home then... 13:52
ok, can we iterate over an enum? 14:00
m: enum btyp <a b>; for btyp.kv -> $k,$v { say $k.WHAT; say $v.WHAT; last} 14:03
camelia (Str)
(Int)
tbrowder__ aha 14:05
m: enum btyp <a b>; for btyp.pairs { say $_. 14:06
camelia ===SORRY!=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:1
------> num btyp <a b>; for btyp.pairs { say $_.ā<EOL>
tbrowder__ m: enum btyp <a b> ; for btyp.pairs { say $_ ~~ a } 14:07
camelia False
False
tbrowder__ ?? 14:09
m: enum btyp <a b> ; for btyp.pairs { say $_ } 14:10
camelia a => 0
b => 1
14:17 teatwo left, teatwo joined, tea3po joined 14:20 tea3po left, teatwo left, tea3po joined, teatwo joined, teatime left 15:08 Henry151_ left 15:14 jpn joined 15:17 andydude joined 15:21 jpn left 15:22 sena_kun joined 16:16 Manifest0 left 16:18 Manifest0 joined 16:25 xinming left 16:28 xinming joined 16:34 Henry151 left 16:35 rf joined 16:43 euandreh left 16:48 euandreh joined
rf Morning folks 16:51
16:54 euandreh left 16:55 euandreh joined 17:40 jpn joined 17:46 jpn left 18:00 reportable6 left
librasteve on my machine its 0.14s (raku on MoarVM) vs. 0.02s (perl) 18:00
18:01 reportable6 joined
took me a lot longer than that to remember how to write perl 18:02
lizmat librasteve: and a bare startup for raku is probably around .11 for you, right?
librasteve 0.08s 18:03
lizmat hmmm.. and what was the code you ran? 18:04
librasteve for the startup?
time raku -e "say 0" 18:05
m: my $counter; for 0..^100000 {$counter++} say $counter; 18:07
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Strange text after block (missing semicolon or comma?) at /home/glot/main.raku:1 ------> my $counter; for 0..^100000 {$counter++}ā say $counter;
lizmat time raku -e ''
and with: my int $counter ? 18:08
librasteve my $counter; for 0..^100000 {$counter++} say $counter; 18:09
^^^ that's 0.14s
my int $counter; for 0..^100000 {$counter++} say $counter; 18:10
^^^ that's 0.13s
raku -e 'say 2**64 + 1' 0.12s
^^^ so not much gain at this scale for native int ... but showing raku uses BigInt vs. perl native int that is one source of slower runtime 18:12
gfldex Does the JIT acutally got enough time to kick in? 18:13
librasteve probably not
lizmat hmmm... feels like we lost an optimization somewhere 18:18
ah no the difference becomes pronounced at ^1000000 (.16 vs .21) or 10000000 (.39 vs .91) 18:20
18:22 Bronco_Creek joined
Bronco_Creek I've hit a snag trying to install Rakudo on my new Mac w/ M2 chip. Ā The install command produces the error rakudo/lib/main.bash: line 30: declare: -A: invalid option 18:25
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
Any advice on fixing this?
lizmat Bronco_Creek: which version of Rakudo ?
Bronco_Creek Latest source for the star bundle 18:26
lizmat hmmm... that *should* have all of the M2 fixes
Bronco_Creek Maybe I should just try again. Ā Delete everything in my /rakudo and start from scratch? 18:29
lizmat nuking the install dir is usually enough :-) 18:38
18:44 andydude left
Bronco_Creek Well, still got the same failure. 18:47
main.bash: line 30: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
fatal: not in a git directory
This is on a Mac Mini, if that matters. 18:48
librasteve hi Bronco_Creek - have you tried rakubrew?
18:48 jpn joined
(that's my goto on my M1) 18:48
Bronco_Creek No, haven't tried rakubrew. 18:49
I will give that a whirl. 18:50
18:55 jpn left 19:11 andydude joined
Bronco_Creek Rakubrew seems to have worked. Ā Thanks lizmat and librasteve. 19:11
19:27 MoC left 19:29 Bronco_Creek left 19:34 euandreh left 19:38 zara joined 19:41 euandreh joined 19:59 jpn joined, andydude left 20:02 zara left 20:03 jpn left 20:05 euandreh left 20:08 euandreh joined 20:29 Sgeo joined 21:02 MoC joined
librasteve šŸ‘ 21:02
21:21 jpn joined 21:26 zara joined, jpn left 21:53 MoC left 22:02 jpn joined 22:08 jpn left
tbrowder__ .tell rf a belated 'hi' 22:20
tellable6 tbrowder__, I'll pass your message to rf
rf Hey tbrowder__ :) 22:22
22:22 zara left 22:29 sena_kun left 22:42 zara joined 23:42 evalable6 left, releasable6 left, linkable6 left 23:43 linkable6 joined, evalable6 joined, releasable6 joined 23:44 zara left