🦋 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.
avuserow back on the memory investigation train. if I do `for ^100 {CArray[uint8].allocate(bignum)}` then it eats up memory, but it stays under control if I manually use `nqp::force_gc` 02:54
my actual program does much fewer allocations but a much larger number of iterations, so I need to see if I am leaking memory somewhere else first 02:55
MasterDuke --profile-kind=heap will generate heap snapshots, which you can analyze with p6-app-moarvm-heapanalyzer. jnthn, timo, or nine are the best people to ask about how to use it 03:09
hm, `use NativeCall; for ^100_000 {CArray[uint8].allocate(10_000_000)}` does seem to leak a bunch in bind_pos() at the c/moarvm level, even with --full-cleanup... 03:13
and even if i add `VM.request-garbage-collection; VM.request-garbage-collection` before it exits... 03:19
avuserow is VM.request-garbage-collection the different from nqp::force_gc? 03:20
MasterDuke it's just a higher level api for it. all it does is call nqp::force_gc if running on the moarvm backend and warn that it's unsupported on the others 03:22
avuserow thanks, good to know :)
okay so at least some of my issue was a C-side memory leak. I might actually be fine to run this on my entire data set. 03:23
MasterDuke well, i'm not *entirely* sure it's a memory leak. --full-cleanup is not 100% effective. it's pretty good, but there are still some things it doesn't get. and heaptrack (what it am using to detect the leaks) doesn't know anything about moarvm/rakudo's garbage collection. so there's still a chance that what i'm seeing is just a red herring 03:26
but i'd suggest pinging nine. he knows this area (especially NativeCall) much better than i do and might have some suggestions 03:28
avuserow thanks for the insight. I'll see if I can golf something down and drop it in a dev channel 03:31
MasterDuke doh, it may have been killed and that's why heaptrack saw a leak. if i drop it down to 10_000 iterations and allocate(1_000_000) it says there's no leaks, and i see the CArray freeing function being called 03:34
avuserow doing 100 iterations of allocating 100MB (= 10GB total) definitely grabs 10GB of RAM. valgrind says "still reachable: 10,485,763,987 bytes in 114 blocks" 03:39
with a force_gc I get "still reachable: 104,861,587 bytes in 15 blocks" 03:40
(the other losses are the same as an empty program)
running with --full-cleanup makes it all clean, so maybe this is just a pathological use case :) 03:46
lizmat And another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/11/07/2022-...aluersion/ 13:06
Xliff lizmat++ 13:39
in "sub MAIN ( :$a #= HOWDY ) { ... }" is there an easy way to get the parameter object for $a? 13:40
m: sub a ($a) { &?ROUTINE.signature.params.head.name.say }; a() 13:41
camelia ===SORRY!=== Error while compiling <tmp>
Calling a() will never work with declared signature ($a)
at <tmp>:1
------> UTINE.signature.params.head.name.say }; ⏏a()
Xliff m: sub a ($a) { &?ROUTINE.signature.params.head.name.say }; a(1)
camelia $a
Xliff Hmmm...
Nemokosch Re Hackernews on Tcl, Python and GIL 14:25
> Raku is also, unfortunately, the slowest language I've ever used especially, paradoxically, for regex and string handling given its Perl lineage.
ouch
It's kinda weird, though, because the same people tend to take it as an axiom that better language design made Python win over Perl (and Tcl) *despite* worse performance 14:27
This reminds me - vrurg: any news about the Rakudo crashcourse? 14:29
razetime startup time for any language is something a lot of people complain about 15:33
but otherwise raku feels about as slow as any other scripting language i use 15:34
vrurg Nemokosch: stuck with my jobs, barely have spare time. Almost re-started working on it yesterday until a new serious error popped up. :( 15:36
tellable6 vrurg, I'll pass your message to Nemokosch
vrurg razetime: normally, startup is slow due to precomps taking long. Do you update your code often? 15:37
razetime update my code?
like, my raku build or my local code
vrurg your local code.
razetime yeah, I suppose I do. Generally start my work in the repl and transfer over 15:38
vrurg Normally the rule of thumb: move as much as you can of you scripts into modules. A script gets compiled every run while modules are precompiled. I tend to reduce my scripts to something like `use MyApp; MyApp.run` 15:39
Second, if you use rakubrew then better use 'env' over 'shim'. The latter includes perl startup too. 15:40
vrurg is afk again...
Anton Antonov Good to know! I moved to using "shim" a year ago... 15:43
Nemokosch > And, in fact, the ~~ operator works as a small topicalizer; that is, it binds $_ to the value of the left side for the evaluation of the right side. Use the underlying .ACCEPTS form to avoid this topicalization. 16:31
design.raku.org/S03.html#Smart_matching
It's not "Rakudo behavior" at least.
Okay, the design document is clearly not authoritative anymore 16:45
lizmat indeed, they are not
Nemokosch there's loads of useful stuff in there 16:51
is it common that Rakudo fails Roast tests? 16:52
I mean not accidentally but long-term
lizmat there are a few flappers... but generally it should be clean 16:55
All tests successful.
Files=1355, Tests=116442, 206 wallclock secs (16.64 usr 3.97 sys + 1238.14 cusr 59.56 csys = 1318.31 CPU)
Result: PASS
Sat Nov 5 23:55:42 CET 2022
was the last one I ran
Nemokosch I'm still thinking about smartmatch on Matches 17:02
but anyway, these design documents are invaluable regarding the tiny little details and motives that they contain
lizmat agree :) 17:05
Anton Antonov @lizmat I think using Jupyter is many ways like use vi -- if you try the former you might like it. 17:39
lizmat Perhaps... but my fingers were first mangled by Wordstar, then WordPerfect, then vi, then vim.... 17:40
and inbetween all of that, I even *wrote* an editor for a system now long lost in the mists of time :-) 17:41
Anton Antonov @lizmat I understand -- for the record I stay away from Jupyter as much I as it is possible. Also, I prefer using emacs. 🙂 17:44
lizmat :-)
Nemokosch Is there anyone under 40 who is using emacs and doesn't have a degree in mathematics in particular? 17:47
Anton Antonov <@297037173541175296> I definitely have not met anyone using emacs under 35... (I am not sure about < 40.) 17:52
[Coke] I think all the emacs users I know were in college with me (or older), so nope. :) 18:19
though I myself am a diehard vi/m user, having learned vi on the mainframe because it was better than the alternatives and transferable to the *nix boxes.
Is Anton Antonov the person who recently released 2 raku vids on youtube? 18:20
Either way, hello.
Nemokosch that's one way to put it 😉 18:22
El_Che [Coke]: some people have an old soul 18:31
[Coke]: and 20 fingers
xinming Nemokosch: me, 37 using emacs and a junior school drop out. :-) 18:32
tellable6 xinming, I'll pass your message to Nemokosch
El_Che cirrus ci is so slow, that working on a automatic integration with github releases and cloudsmith may be a waste of time. So a simple manual script after the build may suffice to release arm64 builds 18:33
cirrus waited 30 minutes for start building and then build each pkg one by one, so it will take hours :) 18:34
xinming I was a full-day emacs user beforef, there is a time where I need to edit config file on slow network frequently, and I found emacs slowing start is quite boring in this case, I started to use vim. and I don't remember when I switched most of my editing to vim anyway. 18:36
El_Che accordingly, failing tests is extra painful on cirrus 18:38
avuserow Some of my classmates from college picked up emacs and they would be <35. Though vim was the popular editor on campus (due to being recommended in some classes). 18:40
El_Che I picked up vi(m) because it was the only thing you could be sure it was installed on alle the different unix machines 18:43
I have nothing against emacs, but it's good for joking :)
like the :q! jokes for vim 18:44
Nemokosch same tbh
I can easily imagine your average Emacs is actually better than Vim or even Neovim possibly 18:45
but that doesn't create a userbase...
lizmat how many people are using Dvorak keyboard layouts rather than qwerty / qwerzu /azerty ? 18:48
[Coke] qwerty here - I got good enough that it wasn't worth switching to eke out a few wpm
lizmat well, same for me... and I'm still typing with only 5 fingers :-) 18:49
Nemokosch Pretty much the same. I didn't count the amount but I'm definitely not using that cool 10 finger system
never had to type so much that it would become a bottleneck 18:50
but I'm even worse on phone...
lucs I type with most of my fingers, but not especially for speed, more because I don't need to look at the keyboard. 18:51
Nemokosch I'm literally using touch screen like a grandma would. Keep it in one hand, press it with the index finger
lucs And anyway, I can already type faster than I can think (which is not very fast, eh).
Nemokosch: That's how I type on my phone :) 18:52
tellable6 lucs, I'll pass your message to Nemokosch
Anton Antonov vi == kitchen knife; emacs == laser saber | vi == Ford Model T; emacs == Tesla Model S 19:04
My analogies above might appear a little biased… 19:05
tonyo never seen a practical light saber in real life so that seems fair : )
tellable6 2022-11-04T12:59:29Z #raku <tbrowder> tonyo: if you plan to close those pending fixes in CSV::Parser, i will abandon my simple csv parser.
lizmat imagines editing with light saber sounds :-) 19:06
lucs Only just a little bit 🙂
tonyo tbrowder: i do plan to revamp it, i can prioritize it. i'm currently working on my own start up and working full time so i'm working on raku when i need a break from go/typescript/python 19:07
tbrowder ok, no problem, i can use it as is and hide tmp work-arounds, good luck on yr endeavors! 19:09
tonyo thanks my man
tbrowder 👍🏻
Nemokosch . 19:12
tellable6 2022-11-04T18:35:26Z #raku <tbrowder> Nemokosch: no, it’s unpublished, and probably not needed (CSV::Parser::Simple)
2022-11-07T15:36:05Z #raku <vrurg> Nemokosch: stuck with my jobs, barely have spare time. Almost re-started working on it yesterday until a new serious error popped up. :(
2022-11-07T18:32:29Z #raku <xinming> Nemokosch: me, 37 using emacs and a junior school drop out. :-)
2022-11-07T18:52:27Z #raku <lucs> Nemokosch: That's how I type on my phone :)
Nemokosch o.O
Anton Antonov @lizmat There was an MacOS app that would do laser saber effects : osxdaily.com/2006/12/06/macsaber-t...ightsaber/ 19:12
lizmat hehe :-) 19:13
Anton Antonov Of course also consider this appeal to authority : xkcd.com/378/ 19:15
Nemokosch yeah... butterflies
lizmat hehe yeah, nice one 19:16
tbrowder anyone know where 2023 raku conf us or canada will be? i heard site is selected but haven’t heard any more 19:26
heard where
Anton Antonov <@755062053282119803> Interesting question! 19:29
tonyo tbrowder: those fixes are already in, i use the close-pending tag to let someone know i think their issue is resolved and as a reminder to myself that after 7 days of no response i'm okay to close 19:33
if you grab 0.1.3 you should have all of those `close-pending` tags resolved
tbrowder okey dokey 19:34
yea!
melezhik o/ 19:36
.
I've made an example CI build for different Rakudos/Linux Distros for raku-audio-taglib - last 4 builds on ci.sparrowhub.io - this is how one can test Rakudo modules that require distro specific tests and also want to measure tests time change  over recent Rakudo releases 19:39
Nemokosch reiteration: lambert lum is looking for raku speakers for svperl on Jan 5, 2023 19:54
El_Che sverige? 20:00
Nemokosch silicon valley 🙂 20:04
from what I heard, online presentations are also welcome
tonyo what kind of speakers? 20:11
i have some vandersteens
El_Che mr high-end audio 20:12
Nemokosch I don't know a lot about it but as it has "Perl" in the name so I was immediately told that it's good to aim entry-level
tonyo El_Che: a very lucky local record store find 20:13
El_Che nice 20:35
Nemokosch > github.com/rakudo/rakudo/pull/5095 22:58
is something like this tied to the MoarVM runtime or would it be shared across all Rakudo backends? trying to understand the architecture still 23:00
ugexe github.com/Raku/nqp/commit/2e7924c...55b20be443 23:01
Nemokosch so kind of neither, or one could say "shared" as long as the backends properly implement NQP on their own 23:06
ugexe m: say -1.UInt 23:09
camelia -1
[Coke] m: say (-1).UInt 23:12
camelia Coercion to UInt out of range. Is: -1, should be in 0..^Inf
in block <unit> at <tmp> line 1
Nemokosch _points at the decision to not make negative numbers literals_
Nemokosch m: say -1 .Uint 23:16
camelia No such method 'Uint' for invocant of type 'Int'. Did you mean any of
these: 'UInt', 'Int', 'List', 'gist', 'list', 'min', 'print', 'sin',
'sinh', 'sink'?
in block <unit> at <tmp> line 1
Nemokosch nothing that couldn't be fixed with a little hacking
lizmat that should be fixable
now, did you find a reason in the specs that shows why -1 is not codegenned as a literal ? 23:17
Nemokosch not gonna lie, it dropped low on the priority list and I didn't look hard 23:18
sena_kun Nemokosch, hi! re framework for the website: I cannot recommend any, but I'd rather avoid anything heavy. 23:19
tellable6 2022-10-16T21:13:18Z #raku-dev <[Coke]> sena_kun - did you cc me on that email?
2022-10-16T21:13:34Z #raku-dev <[Coke]> sena_kun that is, the infra email
sena_kun .tell [Coke] I certainly did, I believe. 23:20
tellable6 sena_kun, I'll pass your message to [Coke]
sena_kun goes to sleep
Nemokosch well, good night :D that's some speedy sleep 23:20
m: my $works = :1a; my $fails = :-1a; 23:22
camelia ===SORRY!=== Error while compiling <tmp>
Malformed initializer
at <tmp>:1
------> my $works = :1a; my $fails = :⏏-1a;
expecting any of:
colon pair
Nemokosch lizmat: I don't feel stronly about ^ this in particular but it's another consequence of minus-as-operator-only at parsing
lizmat the :42a syntax is only for positive ints anyway 23:23
it was supposed to make things like :3rd and :2nd and :1st more readable, only positive ints 23:24
sleep&
Nemokosch well well, I don't see this as a useful restriction, kinda neither-a-bug-nor-a-feature 23:25
guifa I mean, I suppose :- would be ungrammatical otherwise
at least, I'm trying to think where it would be grammatical
Nemokosch can't say it for sure but I think it only fails because negative numbers don't have literals 23:26
guifa Well I'm thinking where colons are used
they're used for adverbing
and no-parentheses method calling
but foo.bar:arg is invalid, you have to have a space
or it'd be interpreted as a subname thingy maybe 23:27
but an immediate minus would be a parse error there too
oh 23:28
huh
Nemokosch well well 23:29
bluntly put: I think the grammar of Raku has several issues but many of them are by design and it might not be possible/worth it to fix that 23:30
m: [ && ](True, False) 23:31
camelia No such method 'CALL-ME' for invocant of type 'Array'
in block <unit> at <tmp> line 1
Nemokosch do you know this one? :P
either way, with most of the grammar issues, DIHWIDT seems fair. What seems safe is usually indeed safe 23:36