🦋 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
Nemokosch well, if wrap mutates, it mutates... 00:02
01:01 evalable6 left 01:02 evalable6 joined 01:03 xinming left 01:05 xinming joined 02:05 jpn joined 02:10 jpn left 02:19 deoac joined
rf What is the point of wrap 02:34
You can achieve the same as wrap with a closure if you want to preserve the original 02:35
02:51 razetime joined 03:04 cfa left 03:33 deoac left 03:50 derpydoo joined
tonyo you could probably commit this heinous crime 04:30
m: sub a {"a".say;}; &a.wrap(sub { "b".say; callsame; }); &a.HOW.method_table(1)<WRAPPERS>.(&a)[*-1].() #xinming
camelia a
04:36 razetime left 04:55 bigdata joined 05:34 razetime joined 05:36 bigdata left 06:00 reportable6 left 06:02 reportable6 joined 06:30 razetime left 06:32 xinming left, xinming joined, razetime joined 06:55 derpydoo left, gcd left, Maylay left, Sgeo left, rf left, squashable6 left 06:56 derpydoo joined, gcd joined, Maylay joined, Sgeo joined, rf joined, squashable6 joined, tib joined, committable6 joined, quotable6 joined, coverable6 joined, shareable6 joined, bisectable6 joined, peder joined, Ekho joined, sjn joined, gabiruh_ joined, perryprog joined, synthmeat joined 06:58 kaskal joined 07:04 Sgeo left 07:05 Sgeo joined 07:21 Sauvin left 07:32 Sauvin joined 07:35 Bocaneri joined, Bocaneri is now known as Guest9469 07:36 Sauvin is now known as Guest5002, Guest5002 left 07:37 Guest9469 is now known as Sauvin 07:38 abraxxa joined 07:39 derpydoo left 07:47 abraxxa left 08:04 jpn joined 08:06 Sgeo left 08:07 razetime left 08:10 jpn left 08:27 razetime joined 08:45 sena_kun joined, ab5tract left 08:46 ab5tract joined 08:50 destroycomputers left, destroycomputers joined 08:54 kylese joined 09:00 bigtestaccount[m left 09:25 rf left 09:26 rf joined 09:52 jpn joined 10:43 razetime left 10:58 Geth joined
Geth doc/main: bd6c4c8538 | (Tom Browder)++ (committed by Will Coleda) | util/create-brackets-table.raku
Modify the 'Brackets' table generator to always read the data source file

The following changes have been made:
  + removed hard-wired file paths
  + ensured the output table has no trailing spaces
  + eliminated the 'Reorder' and 'original' options
... (9 more lines)
10:59
doc/main: cf466799ec | (Tom Browder)++ (committed by Will Coleda) | 2 files
ensure module is available, use local NQP source if available
doc/main: cd8914361a | (Tom Browder)++ (committed by Will Coleda) | util/create-brackets-table.raku
add another possibility for location of NQP
doc/main: e099f8252f | (Will Coleda)++ | doc/Type/Complex.pod6
Add Complex.sign for v6.e

Closes #4199
11:01
doc/main: e099f8252f | (Will Coleda)++ | doc/Type/Complex.pod6
Add Complex.sign for v6.e

Closes #4199
11:02
doc/main: 58d64f0d6d | (Elizabeth Mattijsen)++ | doc/Type/Complex.pod6
Add documentation for Complex.sign
11:03 ab5tract left, ab5tract joined
Geth doc/main: 90025302b1 | (Elizabeth Mattijsen)++ | doc/Type/Unicode.pod6
Document new Unicode class
11:04
doc/main: 966a99d473 | (Elizabeth Mattijsen)++ | doc/Language/variables.pod6
Document $*EXIT and $*EXCEPTION
11:05 xinming left 11:07 xinming joined 11:12 ab5tract left 11:13 ab5tract joined
Geth doc/finanalyst-patch-1: 89e8bc4be8 | (Richard Hainsworth)++ (committed using GitHub Web editor) | doc/Type/DateTime.pod6
Update DateTime.pod6

typo in href
11:15
doc: finanalyst++ created pull request #4237:
Update DateTime.pod6
doc/finanalyst-patch-5: 6a2d8091e6 | (Richard Hainsworth)++ (committed using GitHub Web editor) | doc/Language/modules-extra.pod6
Update modules-extra.pod6

Rename p6doc to rakudoc
11:18
doc: finanalyst++ created pull request #4238:
Update modules-extra.pod6
doc/main: 50c7b8a533 | (Elizabeth Mattijsen)++ | doc/Type/RakuAST.pod6
Add RakuAST package stub
11:20
doc/finanalyst-patch-3: 7af34eea6d | (Richard Hainsworth)++ (committed using GitHub Web editor) | doc/Language/faq.pod6
Update faq.pod6

change malformed links and change to rakudoc
11:23
doc: finanalyst++ created pull request #4239:
Update faq.pod6
11:24
11:27 ab5tract left, ab5tract joined 11:38 ab5tract left 11:39 ab5tract joined
Geth doc/main: e41bf648fb | (Elizabeth Mattijsen)++ | doc/Language/experimental.pod6
Document "use experimental :rakuast"
11:41
11:45 ab5tract left 11:50 thundergnat joined
thundergnat m: say $*TOLERANCE 11:51
camelia 1e-15
thundergnat m: say 0.000000000000000000000101 ≅ 0 11:52
camelia True
11:53 thundergnat left 11:58 rf left, rf joined
Nemokosch m: say 0.000000000000000000000101 > $*TOLERANCE 11:59
Raku eval False
12:00 reportable6 left 12:01 reportable6 joined 12:06 rf left, rf joined
Geth doc/main: 952c044cca | (Elizabeth Mattijsen)++ | doc/Language/create-cli.pod6
Document %SUB-MAIN-OPTS<allow-no|numeric-suffix-as-value>
12:10
lizmat bisectable6: use nqp; say nqp::time 12:16
bisectable6 lizmat, Will bisect the whole range automagically because no endpoints were provided, hang tight
lizmat meh.... that won't work :-( 12:17
bisectable6 lizmat, Output on all releases: gist.github.com/f85d18d2a1a6b61570...7d8286f5ff
lizmat, More than 4 changes to bisect, please try a narrower range like old=2023.02 new=HEAD
Geth doc/main: fbb97b6ffb | (Elizabeth Mattijsen)++ | doc/Language/terms.pod6
Document nano term
12:19
doc/main: c1871a78a6 | (Elizabeth Mattijsen)++ | doc/Type/IO/Path.pod6
Document IO::Path.created
12:37
doc/main: bc3d233986 | (Elizabeth Mattijsen)++ | doc/Type/Dateish.pod6
Document Dateish.days-in-year
doc/main: 93fd8d182d | (Elizabeth Mattijsen)++ | doc/Type/Any.pod6
Elaborate on Any.are
12:49
13:01 QhpAptyj9hj0RQwM joined 13:14 jpn left 13:45 QhpAptyj9hj0RQwM left
rf Morning folks 13:54
13:56 jpn joined 14:08 jpn left 14:10 lichtkind joined 14:11 jpn joined 14:59 cfa joined 15:02 jgaz joined 15:04 nort left 15:08 tonyo left 15:09 tonyo joined 15:23 eseyman left
rf tonyo: I am really liking protone, I will definetley be using it in the future 15:27
tonyo rf: thanks, i forgot to find/upload the _thing_ i had for it to allow looping, etc 15:28
rf Let me know when it goes in :^)
tonyo maybe i'll other-userify it tonight 15:29
(write some documentation, etc)
rf tonyo++ 15:30
Geth doc/main: e6fcf63e92 | cfa++ | doc/Language/variables.pod6
Fix typo
15:31
doc/main: e670a5bc84 | cfa++ | xt/pws/words.pws
Add 'nano' and 'rakuast' to the dictionary.
rf shmup: Thanks for that irssi script for the discord bot lol 15:36
shmup lol np, it aint perfect yet but it's still better 15:37
rf Yeah I don't have a lot of screen real-estate so sometimes it would wrap now it looks good 15:38
15:39 Guest10 joined
cfa shmup++ 15:44
i still haven't updated to the latest but it's been super handy here too
now if we can get tellable6 to not queue up messages for users talking with a discord prefix... 15:45
shmup rf i came across your github ln. you're impressive. only 3 years professionaly? what are you, some kinda turbonerd? rf++ 15:52
15:53 Sgeo joined
shmup u goin places, boy 15:53
rf Thanks, it's probably because I've sat at a computer for 8 hours a day the last 9 years lol.
I also have good teachers to thank for making me practice a lot 15:54
Only been programming for about 3 years though 15:55
shmup keep crushin' it. love that you landed on "raku, ocaml, c++, perl" out of all the options. 15:56
rf I'm a big fan of languages that work well with how I think, mostly functional + imperative 15:57
I am not a big fan of OOP as a few people in here already know :^)
shmup let me add 2 books to your bookshelf, unless you've already read. blindsight and three body problem. 15:59
peter watts and cixin liu
rf Thanks, I i'll add it to my backlog :)
16:01 Guest1 joined
Geth doc/main: 442a6cb764 | cfa++ | xt/headings.rakutest
Add RakuAST and package checks to xt/headings.rakutest
16:01
doc/main: 43dbbbcd25 | cfa++ | doc/Type/Unicode.pod6
Fix link typo
16:08
rf shmup: Local place has three body problem for 5$ I may read that one sooner than I thought 16:09
shmup dare you
that's a really good deal :)
rf Lol, I'm just about to finish my current books 16:10
16:10 Guest1 is now known as Sussysham 16:11 Guest10 left
Geth doc/main: 874de5de52 | cfa++ | xt/link-checker.rakutest
Remove trailing whitespace from xt/link-checker.rakutest
16:14
16:18 derpydoo joined
rf If anyone is interested, the next major iteration of Humming-Bird is trying to improve performance (even though its pretty darn good), I'll pretty much take an PR that passes all of the tests and makes things faster :) 16:18
Looking mostly for small, isolated performance changes. 16:19
16:25 nine left, nine joined
Voldenet rf: I mentioned this before, but this will really hog performance github.com/rawleyfowler/Humming-Bi...akumod#L17 16:38
it will steal one thread from thread pool for sleeping
wait a moment, it will 16:39
spawn a thread :O
so… it adds 100kb overhead per request
rf Hmm, how can I do this concurrently without a sleep though. 16:40
Voldenet await Promise.in(1);
rf That will live in the event loop ahhh, I see 16:41
Good catch, you can PR if you'd like or I can throw it in
Make sure all the tests pass and such, prove6 -I. it/ t/ 16:42
Voldenet in fact, `now - $_<last-active>` is something horrible to do
I remember writing websockets server over a decade ago and this was the hot code in perf tests 16:43
Nemokosch why though
Voldenet it was replaced with storing cpu tick in the connection
It turns out that fetching time does a lot of things to accomodate for drift and so on
on windows, at least 16:44
on the other hand, cpu ticks are easy to work with and monotonic
rf Can you get ticks in Raku?
Geth doc/main: ce3d70d95d | (Elizabeth Mattijsen)++ | 2 files
Document the 6.e features of Seq.skip

  - move some of the Any.skip doc to Seq.skip
  - correct output of existing examples (spaces instead of commas)
16:45
Nemokosch >websockets server over a decade ago 16:46
sounds kinda sus
lizmat rf: the closest thing is in 6.e the nano term (or the nano module on older Rakudos raku.land/zef:lizmat/nano)
rf Websockets have been around for a long time Nemo
Nemokosch the protocol itself is like 12 years old
Voldenet Yes, I had to implement it from scratch in ancient C# 16:47
and it was pain
rf Humming-Bird doesn't support web-sockets atm, just HTTP
Voldenet It was cutting-edge technology at the time, but way better than http long polling 16:48
16:48 swaggboi left
rf Thanks for the tip on the Promise.in vs sleep, just bumped my performance in another application by almost 15% 16:48
Voldenet wow 16:49
I sort of expected that, but still
Nemokosch that's good to know 16:50
rf That app uses sleep more aggresively though 16:52
So probably wont be 15% for humming-bird
Also lizmat++ thanks for that library 16:53
Voldenet In fact, I looked at the code carefully and maybe the !timeout doesn't even have to start its own thread
in http servers you want to use all cores on handling requests after all 16:54
and it solves that pesky data race
> @!connections = @!connections.grep({ !$_<closed>.defined });
> @!connections.push: %connection-map; 16:55
those lines can use random timings
and if grep returns new instance, that push might get overwritten
and the access to connections itself isn't locked 16:56
So, if you just use `whenever Supply.interval(1) { … remove dead connections }`
you might notice slight delay in handling some connections
but at least no concurrency bugs 16:57
17:01 razetime joined
rf Yeah I think connections push needs a lock 17:01
Voldenet in which case you don't really use that thread
hm, you do for non-new connections 17:02
rf Hmm, do I need a lock with non-thread asynchronous code, start blocks
Not sure how the task scheduler works in Raku
Voldenet `react whenever … { }` is supposed to use single thread 17:03
rf Holy crap, that is ridicuously fast
like almost 10x
Let me run my benchmarks
And that's with a lock on the push still 17:04
Geth doc/main: 185749469f | cfa++ | xt/link-checker.rakutest
Fix xt/link-checker.rakutest: s/fail/flunk/
17:05
Voldenet tbh. single thread is really fast
rf On avg case it is saving 35ms, on edge cases closer to 120ms
CPU time is down a lot too 17:06
Voldenet I'm wondering what if everything was in one loop instead of starting threads 17:07
lizmat note that "start" is not necessarily starting threads 17:08
rf Yeah, its adding a Task right? 17:09
lizmat it is basically adding jobs to a queue
and if there are not enough threads, the scheduler will start new threads
rf Gonna hit it with 500k requests in 2 minutes and see what happens, before we dropped about 2/3 17:10
17:11 razetime left
Voldenet I'm used to saying `$*SCHEDULER.cue` instead of start, but I'm not sure if there's any point to it now 17:15
lizmat Voldenet: .cue doesn't give you a Promise, it gives you a Cancellation object 17:16
so less overhead with .cue, but also no assurance the code completed ? 17:17
Voldenet indeed
so if I need fire-and-forget sort of job, I use cue
lizmat sounds about right :-) 17:18
rf lizmat: Do you know if you need a lock when just using `start`? No actual threads with Thread.new.
tonyo for shared variables?
rf Yeah 17:19
my %foo; start { await Promise.in(2); %foo<bar> = 123; }; start { await Promise.in(1); say (%foo<bar> ?? 'foo' !! 'bar') } 17:20
Idk but imagine they mutate some how
17:20 derpydoo left
tonyo Lock 17:20
rf Hmm, not sure why though. I guess the scheduler could run multiple threads? 17:22
Voldenet yes
tonyo m: my $a = 0; my Lock $l.=new; my $p = start { $l.protect(-> { sleep 3; $a = 3; }); }; $l.protect({ $a = 5; }); await $p; dd $a
camelia Int $a = 3
Voldenet but consider this: my %foo; react { whenever Promise.in(2) { %foo<bar> = 123; }; whenever Promise.in(1) { say (%foo<bar> ?? 'foo' !! 'bar') }};
effectively, since the lock would be in place, the code is not that different 17:23
but faster since you don't need memory barrier
tonyo m: $*SCHEDULER.max_threads
camelia ( no output )
Geth doc: cfa++ created pull request #4240:
link-checker: Check for the existence of directories as well as pod6 files
tonyo m: $*SCHEDULER.max_threads.say
camelia 64
tonyo you can also use those as pools and create different schedulers, `start` just uses that one in $*SCHEDULER by default
rf Oh neat! 17:24
tonyo m: say $*SCHEDULER.WHAT
camelia (ThreadPoolScheduler)
Geth doc/main: 0b21b1dbe2 | cfa++ | 3 files
Remove .html from links failing xt/link-checker.rakutest
rf The async stuff for Raku is super mature it feels like, even though I haven't seen it used a ton
lizmat Raku was built with async stuff in mind from the start :-) 17:25
tonyo you need to be cognizant of how many threads you've started versus the capacity of the TPS
otherwise it'll hang the TPS
or, it did ~6 years ago
Voldenet oh, you could also solve any concurrency problems without locking using the node-js way 17:27
my %foo; my $*SCHEDULER = CurrentThreadScheduler.new; start { await Promise.in(2); %foo<bar> = 123; }; start { await Promise.in(1); say (%foo<bar> ?? "foo" !! "bar") };
evalable6 foo
Voldenet ;)
what an unexpected output, isn't it? 17:28
Geth doc/main: d0492c509e | cfa++ (committed by Will Coleda) | xt/link-checker.rakutest
xt/link-checker.rakutest: check for the existence of a dir as well as .pod6 file
17:29
rf Is that because you are using a CurrentThreadScheduler?
Vs pool
Voldenet yes, and the `await` simply blocks in that case :/
rf Hmm I would expect a current thread scheduler to schedule around a block like that 17:30
17:30 SqrtNegInf joined
lizmat note that the CurrentThreadScheduler is pretty braindead 17:30
as it will just "do" any start block and wait for it to return
tonyo feels like maybe you need to wear a business formal to use that 17:32
s/ a //
SqrtNegInf m: say 1.0000000000000001
camelia 2
Voldenet …what 17:33
Geth doc/main: 409389831b | (Will Coleda)++ | doc/Language/faq.pod6
Update rakudoc link

Courtesy finanalyst++
Update zef link to direct link
doc/main: 362b54e69d | (Richard Hainsworth)++ (committed by Will Coleda) | doc/Language/modules-extra.pod6
Update modules-extra.pod6

Rename p6doc to rakudoc
17:34
lizmat SqrtNegInf: % raku -e 'say 1.0000000000000001'
1.0000000000000001
Geth doc/main: 00526c6bca | (Richard Hainsworth)++ (committed by Will Coleda) | doc/Type/DateTime.pod6
Update DateTime.pod6

typo in href
rf m: say 1.0000000000000001
camelia 2
rf Differing versions?
lizmat nope, different architecture most like: on M1 17:35
Geth doc/main: 257d4d343d | (Tom Browder)++ (committed by Will Coleda) | doc/Language/objects.pod6
Correct the intended zero-width index entries
doc/main: 3c8cca2ffb | (Tom Browder)++ (committed by Will Coleda) | doc/Language/objects.pod6
remove TODO which is no longer needed
tonyo on the m2 it prints out the right number
rf M1 is correct too 17:36
Until you get 4 more 0's 17:37
then it becomes 0.099
Voldenet say 1.0000000000000001
evalable6 2
lizmat builds HEAD on an Intel mac
Geth doc/main: 0841a64070 | (Will Coleda)++ | 2 files
word used outside of code
17:40
doc/main: 9f3014c5f6 | (Will Coleda)++ | doc/Type/Seq.pod6
fix typo
doc/main: 6970032b4f | (Will Coleda)++ | doc/Type/Seq.pod6
whitespace
lizmat $ raku -e 'say 1.0000000000000001' 17:41
2
confirmed on Intel
m: say 1.0000000000000001.FatRat
camelia 1.0000000000000001
rf say is coercing to Int? or something? 17:42
lizmat I bet it's the floating point noise check in Rational.Str
Nemokosch This is a regression, right?
lizmat it probably is indeed 17:43
rf Voldenet: Can do 1500 req/sec right now with those changes
Up from around 580 17:44
SqrtNegInf Yes, definitely. See: rosettacode.org/wiki/Approximate_equality#Raku
lizmat SqrtNegInf: confirmed it was my last commit that causes this 17:45
Voldenet rf: pretty good start I say 17:46
rf CPU time is very low which is nice, and memory is down by a fair margin 17:48
lucs When installing for example moar-2023.02 with rakubrew, what's the recommended way to make all the previously zef-installed modules available in that version? 17:49
(I was still using moar-2021.06, eh) 17:50
rf I just reinstall them
cfa perlbrew has clone-modules which would be great in rakubrew 17:51
(i also re-install fairly manually) 17:52
tonyo m: say 1.0000000000000001 == 2
camelia False
ugexe some people have parsed `zef list --installed` and fed it to zef install
tonyo m: say 1.0000000000000001
camelia 2
cfa ugexe: yeah that's what i do
ugexe can't just clone the modules though, the precomp parts of them are different
cfa but with a bit of curation
ugexe for different raku versions
Voldenet `zef install –/test` is the way 17:53
*cough*
lucs ugexe: Oh right, that was my real problem: which modules are already installed (I can parse that). 17:55
cfa ugexe: fwiw clone-modules doesn't actually copy, it re-installs via cpan
Nemokosch That would also be good tbh 17:57
18:00 reportable6 left 18:01 Sussysham left 18:03 reportable6 joined 18:16 ab5tract joined 18:17 SqrtNegInf left 18:18 ab5tract left 18:21 cm left 18:23 ab5tract joined 18:27 cm joined
tonyo vrurg: ping 18:46
18:54 jpn left 19:00 jpn joined
energizer do i remember right that raku offers a bunch of fancy circumfix operators like ⦃ x ⦄ etc? 19:19
gfldex you certainly define your own 19:20
energizer where can i find examples of that? or docs on which ones are available?
gfldex energizer: see: gfldex.wordpress.com/2020/07/24/mi...ng-quotes/ 19:22
energizer that's postcircumfix tho right? as in xs[i] 19:23
gfldex To add real quote constructs you will have to write a slang.
energizer that means macros? 19:24
gfldex Slangs "subclass" the Raku grammar, so they are not really macros. 19:25
you can find examples at raku.land/?q=slang
I wouldn't be surprised if RakuAST enables a simple macro to add new quote constucts. 19:27
vrurg tonyo: will be available later. Saw your reply, my bad – overlooked the option. 19:29
20:00 linkable6 left, evalable6 left, evalable6 joined 20:02 linkable6 joined 20:08 kylese left 20:47 jpn left 20:54 Sgeo left 21:00 Sgeo joined 21:28 swaggboi joined 21:29 jpn joined 21:35 rakuuser joined
guifa_ gfldex: RakuAST won't enable that per se. That's still in the grammar part of the AST 21:36
That said, it will be EASIER with RakuAST, because you will be able to just dump a RAST node in your actions method
(right now, you have to make sure to insert a correct QAST value and those are tricky to get right. The RAST nodes are more intuitive IMO) 21:49
Geth doc/main: 5170cac8b0 | (Will Coleda)++ | doc/Type/Complex.pod6
Combine two versions of .sign we had

  lizmat++
22:01
¦ doc: coke self-assigned is deprecated section missing github.com/Raku/doc/issues/4225 22:02
22:05 gcd left
Geth doc/main: 94c345e387 | (Will Coleda)++ | doc/Type/Routine.pod6
Remove copypasta.

Closes #4225
22:08
doc/main: 24ca95d449 | (Will Coleda)++ | .gitignore
Ignore temporary file
22:08 sena_kun left
tonyo vrurg: the more i read through how gitignore actually uses the globs in .gitignore the more i'm tempted to stuff .gitignore support. the way it works seems insane to me 22:15
vrurg tonyo: not sure I get this locution right. You want it or it's to insane to implement it? 22:20
Anyway, I'm not always sure I have done the file right until `git status` matches my expectations. 22:21
22:21 jgaz left
Geth doc/main: 65c42e0f17 | (Will Coleda)++ | util/new-type.raku
no more vim lines, please
22:26
doc/main: 4118f0c239 | (Will Coleda)++ | 5 files
Cleanup more perl6 references.

Closes #3105
rf Voldenet: So we're about twice as fast in terms of req/sec compared to Ruby's Sinatra so I will call this a win! 22:53
Nemokosch fatality 22:55
xinming tonyo: thanks, It looks a bit terrible, But TIMTODO. :-) 22:56
22:59 derpydoo joined 23:04 jpn left
tonyo vrurg: i may roll it into the project config file and use proper typeglobbing (which i'm realizing .gitignore isn't) and make a separate gitignore matcher 23:05
vrurg: .gitignore is typeglobs but with a lot of special cases and cascading 23:06
vrurg tonyo: The only thing which bothers me is duplication of functionality. Other than that, this is where something is better than nothing. :) 23:08
tonyo yea that bugs me too 23:23
rf tonyo: I may do a little hacking on fez to add reading for global gitignores if you think its worth it. I find myself uploading files I don't mean to even though they're defined in my gitignore global 23:41
tonyo i think we'll end up wanting it and the proper globber that's in there now 23:45
23:58 lichtkind left