🦋 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 inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:07 reportable6 left, reportable6 joined 00:42 frost joined 01:42 committable6 left, statisfiable6 left, benchable6 left, bisectable6 left, notable6 left, quotable6 left, greppable6 left, shareable6 left, linkable6 left, evalable6 left, reportable6 left, releasable6 left, tellable6 left, sourceable6 left, unicodable6 left, nativecallable6 left, coverable6 left, bloatable6 left 01:43 statisfiable6 joined, benchable6 joined, notable6 joined, greppable6 joined, sourceable6 joined 01:44 evalable6 joined, coverable6 joined, bisectable6 joined, reportable6 joined 01:45 releasable6 joined, tellable6 joined, shareable6 joined, nativecallable6 joined, bloatable6 joined, committable6 joined, linkable6 joined, quotable6 joined 01:46 unicodable6 joined
[Coke] codesections: is there some process that needs to occur to accept github.com/Raku/problem-solving/pull/325 ? 01:56
tonyo where's JJ goin? 02:13
02:35 Sankalp left 02:47 Sankalp joined 03:01 razetime joined 03:22 Guest35 left 03:27 Kaiepi left 03:56 melezhik joined
melezhik .tell SmokeMachine I've added badges to SparkyCI , you need to go "My repos"-> "Badge" link . The service itself is still not stable, so sometime API becomes unavailable, sorry ahead of time, I am working on it, however not sure how soon I can nail it down ... 03:58
tellable6 melezhik, I'll pass your message to SmokeMachine
03:59 razetime left
melezhik .tell SmokeMachine an example of badge for test GH project is here - github.com/melezhik/rakudist-teddy.../README.md 03:59
tellable6 melezhik, I'll pass your message to SmokeMachine
04:00 razetime joined 04:01 coleman left 04:03 melezhik left 04:17 Kaiepi joined 04:46 abraxxa-home joined 04:51 abraxxa-home left 04:52 abraxxa-home joined 05:01 mavles joined 05:02 Xliff left, Xliff joined 05:03 Xliff1 left
mavles Rolls a 6 sided dice and gets 1 05:03
05:09 mavles left
CIAvash skimmed over www.reddit.com/r/rakulang/comments...n_object/, I'd appreciate it if people avoided down-votes and snarky comments 05:14
05:57 mexen joined 06:07 reportable6 left 06:10 reportable6 joined 06:16 Sgeo left 06:26 frost left 06:38 jjido joined 06:39 poyo joined 06:42 poyo left 06:59 grondilu joined
grondilu hi 06:59
07:05 jjido left 07:14 sftp left
Nemokosch Hello 07:16
I think you guys are putting way too much effort into reddit people who know everything better but it turns out there is one thing they really know better: shitposting 07:17
Anyway, if this is a way to get elaborate answers, I will collect the things that bother me and put them into one reddit post :) 07:23
07:25 jmcgnh joined
Geth problem-solving: 4fc031ba7d | (Will Coleda)++ (committed using GitHub Web editor) | 2 files
Volunteer for Doc wrangling (#325)

Resolves #324 Force merged to be able to keep momentum.
07:28
grondilu m: sub ($a) { { my $a = $a; } } 07:32
camelia ===SORRY!=== Error while compiling <tmp>
Cannot use variable $a in declaration to initialize itself
at <tmp>:1
------> sub ($a) { { my $a = $⏏a; } }
expecting any of:
term
grondilu thought this was ok
I mean I'm creating a new lexical scope 07:33
Xliff P6-GLib just exceeded 680,000 LOC with raku-Dazzle's 112th commit! :> 07:34
github.com/Xliff/raku-Dazzle/commi...4d97102dd6 07:35
07:39 yauhen joined
grondilu m: sub ($a) { { my $a = $OUTER::a; } } 07:43
camelia WARNINGS for <tmp>:
Useless use of anonymous sub, did you forget to provide a name? (line 1)
grondilu m: sub ($a) { { my $a = $OUTER::a; } }(pi)
camelia ( no output )
07:44 abraxxa-home left 07:48 abraxxa joined 07:50 frost joined
yauhen Uploaded file: uploads.kiwiirc.com/files/a78454df...pasted.txt 07:51
hi people. i have two versions of recurse 'dir'.
SmokeMachine .tell melezhik thanks! I’ll add that to Red! 07:52
tellable6 SmokeMachine, I'll pass your message to melezhik
yauhen found mistake. forget ))) 07:53
07:53 yauhen left, abraxxa left 07:54 abraxxa joined 08:06 razetime left 08:13 dakkar joined 08:16 lichtkind_ joined 08:32 yauhen joined
yauhen hi. i have problems with 'run' any process on windows. if i go it after starting raku from inside cmd after 'chcp 65001' everything works ok. but if i just start raku that i see incorrect symbols for non-unicode chars. can somebody help? i use command 'c:\rakudo\bin 08:35
i use command 'c:\rakudo\bin\raku.exe -I c:\rakudo\lib'. 08:36
08:57 razetime joined
dakkar "non-unicode"? 08:58
do you mean "non-ASCII"?
(printing non-ASCII characters in terminals is generally a mess, doing it portably to every OS/terminal/setting is sadly nearly impossible, but maybe rakudo can do it better than it does currently, sometimes) 08:59
also, what version of rakudo are you using?
yauhen default encoding was 866 (chcp) 09:02
v2022.04.
dakkar looks up what 886 is 09:06
866, even
ah yes, that would screw things up
so, keep in mind I haven't touched Windows in over 20 years… 09:07
my understanding is:
* your terminal (before `chcp 65001`) expects to receive bytes representing latin+cyrillic characters
* rakudo sends bytes representing the utf-8 encoding of any character 09:08
* you see apparently-random symbols on screen
I do not believe there is a way for rakudo to know what encoding your terminal expects, and I'm not sure it's a good idea for rakudo to forcibly change your terminal encoding 09:09
but I hope to be wrong on that
short version: you need `chcp 65001`
or a time machine to go back to the '70s and explain to software people back then that every byte stream needs to declare its encoding, even when it feels like it's a waste of bandwidth 09:11
Nemokosch 😂 09:12
grondilu maybe you can use 'run' in binary and do the encoding of the output yoursely 09:18
*yourself
yauhen "short version: you need `chcp 65001`"
yes. i use sometime cmd and starting raku from inside cmd. but i'd like start raku immediately and use correct output for 'dir'
dakkar oh, I may have mis-understood your problem
yauhen "maybe you can use 'run' in binary and do the encoding of the output yoursely" 09:19
i think 'shell <dir>' would work but i'd like use builtin functions
grondilu you could also make a batch file that starts raku in cmd 09:20
dakkar so the problem is that the strings returned by `dir` look wrong? can you show us a minimal program that exhibits the problem?
yauhen minimal program is `dir` :-)
grondilu so `run 'dir'`, right? 09:21
grondilu realizes `dir` is a raku routine too 09:22
m: dir
camelia Failed to get the directory contents of '/home/camelia': Failed to open dir: Permission denied
in block <unit> at <tmp> line 1
yauhen Uploaded file: uploads.kiwiirc.com/files/1fabce5e...%D0%B5.png
Uploaded file: uploads.kiwiirc.com/files/4e94a42e...%D0%B5.png
dakkar ooh, nice, thank you
so, I'm pretty sure everything I said above still stands 09:23
the `dir` function returns a list of `IO::Path` objects, each containing the name of an entry in the on-disk directory you asked for 09:24
09:24 razetime left
grondilu isn't there a $*ENCODING variable or something, to specify specific default encoding? 09:24
09:24 razetime joined
dakkar when *printing* them, rakudo sends to the terminal a sequence of bytes representing the utf-8 encoding of the characters in strings 09:25
your terminal thinks it's getting cp866 bytes instead, and dutifully interprets them that way
result: apparent garbage
yauhen "so, I'm pretty sure everything I said above still stands"
it works so only because i made change for cmd on startup `chcp 65001`
@chcp 65001>nul
dakkar I'm pretty sure `chcp` tells *the terminal* what to expect 09:26
yauhen "I'm pretty sure `chcp` tells *the terminal* what to expect" 09:27
yes. and how can i say to Raku what to expect? something like `enc => 'this is Microsoft, Dude'`
dakkar you need to tell raku what to *produce*, not what to expect ☺
I'm checking if `$*OUT.encoding(...)` does anything useful
it should, but your preferred terminal encoding is almost certainly not supported 09:28
docs.raku.org/type/IO::Handle#method_encoding 09:29
so, summary:
* the data inside the program is "correct", you can check the length of the various path names, match them with regexes, &c
* rakudo can't (at the moment) produce the encoding you use for your terminal 09:30
* `chcp 65001` (in other words, using UTF-8 as terminal encoding) is the "correct" way to see the correct symbols when rakudo prints them out
yauhen there is no useful encoding for my case. something changes only for 'windows-125[1,2]' and 'windows-932'. another encodings causes error. 09:31
dakkar (and yes, I understand this is not a great situtation, I've already expressed my thoughts on the general mess…)
09:31 frost left
dakkar yes 09:31
the thing is not "this is Microsoft", the thing is "I'm using a Microsoft-specific encoding from the '90s that can't represent most of the characters that rakudo wants to use" 09:32
yauhen i'm understand
but if i can start Raku in correct encoding from outside cmd why i cannot start it correct without cmd? maybe there is some variable or process string that REPL use when start and i can modify this for myself? 09:34
dakkar as I understand it, you are changing the encoding of your *terminal*, not of rakudo
have you tried running `shell <chcp 65001>` from inside rakudo? 09:35
(I may be wrong here, as I don't use Windows…)
09:38 sftp joined 09:39 frost joined 09:42 zmoment left 09:44 zmoment joined
yauhen Uploaded file: uploads.kiwiirc.com/files/987898c7...%D0%B5.png 09:54
dakkar well, *something* changed
but at this point I've reached the end of my understanding of Windows, so you'll need to wait for someone else to help 09:55
(btw, `dir <d:\>` is probably better written as `dir 'd:\'`, the <> produce a list, which is not always what you want/need) 09:56
yauhen i'm understanding how it works. works fine but i just need use correct environment encoding. i don't want changing whole system encoding for that purpose. 09:57
09:59 yauhen left 10:09 Guest76 joined, Guest76 left 10:25 euandreh left 10:57 peder left 10:59 peder joined 11:32 wingfold joined
SmokeMachine is anyone else also having this problem? github.com/FCO/Red/runs/6369311220...focus=true 11:53
tellable6 2022-05-10T03:59:43Z #raku <melezhik> SmokeMachine an example of badge for test GH project is here - github.com/melezhik/rakudist-teddy.../README.md
hey SmokeMachine, you have a message: gist.github.com/c78c07d24c8744f27f...da851facd0
11:56 jjido joined
SmokeMachine .tell melezhik Thanks! Just added that to Red's README! 11:59
tellable6 SmokeMachine, I'll pass your message to melezhik
12:04 frost left
Geth ecosystem: f764e8dd1c | (Elizabeth Mattijsen)++ | META.list
Freeze Netstring

While we move it to the fez ecosystem
12:04
12:06 reportable6 left 12:09 reportable6 joined
CIAvash SmokeMachine: `:` in `https%3A` is encoded in that version in REA, I think that's why it fails 12:13
lizmat: ↑ 12:14
lizmat argh.. did I screw up ? 12:15
CIAvash too much encoding 😀 colon in `https:` gets encoded as well, not just the name of the files 12:17
lizmat updated the META on the REA, a zef update should give you fixed URLs 12:20
CIAvash SmokeMachine: It should work now, lizmat++ 12:25
12:30 jjido left
Geth ecosystem: b1196385fc | (Elizabeth Mattijsen)++ | META.list
Remove Toaster

It will continue to live in the REA
12:44
13:23 Guest35 joined 13:25 Sgeo joined 13:26 patrickb left 13:27 patrickb joined, jjido joined
SmokeMachine thank you CIAvash and lizmat ! 13:33
13:40 Sankalp left 13:41 coleman joined 13:47 euandreh joined 13:49 Sankalp joined 13:54 coleman left 14:01 jjido left 14:10 wingfold left 14:17 discord-raku-bot left, discord-raku-bot joined 14:28 Kaiepi left 14:48 somebody joined
somebody hi. this example doesn't work. examples.raku.org/categories/inter.../calc.html 14:56
returns '()'.
I don't have working example that had made today. But when I had used this example as 'unit module Calc;' then 'my grammar Arith { * }' and 'sub calc($input)', this example worked fine
tellable6 2022-04-18T19:54:14Z #raku <[Coke]> somebody stackoverflow.com/questions/271563...from-perl6
dutchie somebody: that example appears to use the deprecated `$()` where `$/.made` should be used now docs.raku.org/language/variables#T.../_variable 15:00
alternatively change `use v6;` to `use v6.c;` 15:03
somebody works. thanks 15:04
15:20 somebody left 15:34 Kaiepi joined 16:14 kaskal joined 16:24 razetime left 16:29 grondilu left 16:31 grondilu joined 16:35 somebody joined, dakkar left 16:49 somebody left 16:51 Kaiepi left
grondilu sometimes I hate programming. 16:54
I thought I was making progress on my protobuf library. 16:55
16:56 vrurg left
grondilu even though I had to write what I consider ugly code. Lots of arbitrary hash structures, if/then test on these structures, and `die` at pretty much every steps to check hash values. 16:56
I thought I had written the worst part of it. 16:57
16:57 londoed__ left
grondilu and then I realize I have to implement the equivalent of lexical scopes. 16:57
which I will have to do with yet an other set of if/then/die and so on.
I'm sure it would be simpler with MOP, but I can't resolve myself to try that for some reason. 16:59
16:59 mexen left
grondilu japhb: you there? 17:00
honestly I wish someone would write this library instead of me. Such a hassle to design. 17:01
17:05 dogbert11 left 17:09 Kaiepi joined 17:13 jjido joined
grondilu All implementations of this library do code generation. I somehow try not to because I don't understand the MOP, but damn that makes it hard. I guess there is a reason they do code generation. 17:15
17:15 londoed joined 17:26 Kaiepi left
kaskal maybe it is a good chance to test RakuAST? 17:45
lizmat fwiw, I was thinking the same thing 17:47
17:48 Kaiepi joined 17:49 bigdata joined
japhb grondilu: I am now. What's up (I haven't backlogged in this channel) 17:52
?
grondilu: Protocol Buffers and their API were literally *designed* with code generation in mind. The experience of which is why one of the original protobuf authors went off and did Cap'n Proto. 17:53
grondilu yeah
I think it's doable without code generation but I'm getting discouraged 17:54
japhb Protocol Buffers are so badly statically designed, that's why I eventually said (even *with* MOP help) that it wasn't worth it to me to finish the work I was doing with samuraisam.
So ... I certainly understand the sentiment. 17:55
grondilu yet, raku is supposed to be great at generating code.
but the MOP is kind of non-beginner friendly, I think
japhb I mean, it is, but you have to realize: The protobuf people designed it in such a way that eventually java compilers couldn't even *compile* the code that protobuf generates. There was an emergency get-all-the-principle-engineers-together meeting to work around that one, let me tell you. 17:56
grondilu: Yeah, it takes some time to get any comfort with the MOP -- and I don't even use it all that often. 17:57
grondilu I've seen in your code that you used nqp. I don't want to have to do that :/ 17:58
japhb I will say that it is worth the time investment -- I find just being able to use it for *inspection* is pretty valuable for really deep debugging. And it makes automatic code generation way easier. :-)
Well part of that is stuff that didn't have a non-NQP API back then.
grondilu would you consider modernizing your code so I could re-use part of it, if not all? 17:59
japhb And as kaskal and lizmat were saying, this is one of those places where a lot of effort is being put into RakuAST to *have* a decent API for a lot of that stuff, rather than hacks or NQP delving.
grondilu yeah but I don't want to wait for RakuAST to be ready
who knows how long it could take 18:00
japhb grondilu: I would say yes if my time weren't very much spoken for right now by $day-job.
kaskal AFAIK a whole lot is ready in rakuAST right ?
tonyo why we're replacing macros with code generation boggles my mind 18:01
lizmat indeed.. I'd say code generation is pretty feasible atm, I already did the work to make sprintf formatting generate code
japhb grondilu: nine++ has been doing a ton of work on it recently. He's gotten to the point (as of last weekend, I think) that he's working on precomp for it.
Kaiepi code generation...?
lizmat rather than parsing the format over and over again
tonyo or, why go does, specifically
lizmat there are two aspects to RakuAST branch:
japhb tonyo: Difference between semantic macros and syntactic macros.
lizmat 1. creating an API to create code
2. use that API to build a new grammar to parse Raku code 18:02
the first part is largely done
and that's the part you'd need
grondilu "a new grammar to parse Raku code" you mean you're going to write a new raku grammar?
a new STD? 18:03
japhb tonyo: To be clear, RakuAST allows you to directly build the *structure* of the code, rather than the *strings* that would need to be parsed.
El_Che no matter the language, when I get the message "you need to generate code" I back away
japhb El_Che: What I said to tonyo. :-)
lizmat grondilu: a new grammar in the sense of a new Grammar class, which would support what the Raku grammar supports today 18:04
grondilu ok
lizmat grondilu: this is *not* about creating a new language, the farthest away from that
composability of this new grammar is the most important goal
so, there will no longer be a src/Perl6/World.nqp to keep state 18:05
grondilu look what I wrote to encode a protobuf : github.com/grondilu/protobuf-raku/...kumod#L157 18:06
I don't think I have ever been so disgusted by something I wrote
but right now, it's the only raku code I know of that can encode protobufs :/ 18:07
18:07 reportable6 left
grondilu as I've said, I'm getting discouraged. Maybe I should wait for rakuAST indeed. 18:07
18:08 reportable6 joined
japhb grondilu: github.com/samuraisam/p6-pb/blob/m.../Writer.pm -- or are you working at a different level in the protobuf stack in your code? 18:08
grondilu oh I thought you weren't doing encoding 18:09
japhb Hah! That code is so old that #| hadn't been fixed yet
grondilu: github.com/samuraisam/p6-pb/tree/m.../PB/Binary is the binary R/W layer in the code I worked on 18:10
grondilu I'll look at it more 18:11
japhb: do you know about the conformance test program?
japhb (Yes, it contains nqp code for writing to the buffers -- the native-value-writing Raku API hadn't been created yet when I wrote that.) 18:12
grondilu looks at github.com/samuraisam/p6-pb/blob/m...official.t 18:13
japhb grondilu: We just used tests from Google's docs, plus some of our own.
We hadn't reached the stage of a full conformance suite. 18:14
*of using a
grondilu the conformance program might be the way to go, still. You can skip all the tests you want.
japhb Well, feel free to use what you like from our code and/or tests. 18:15
grondilu your code really is old. Not trying to be mean. 18:17
like you don't even write 'unit module', just 'module'. I think that alone will throw an exception nowadays, no? 18:18
I suppose since I have plenty of time, I could fork it and modernize it myself.
but then again I'm scared of the NQP stuff 18:20
Kaiepi uint would be more appropriate in some spots nowadays 18:22
18:23 ProperNoun left, ProperN[out] joined
lizmat clickbaits www.reddit.com/r/rakulang/comments...ence_2022/ # Raku Conference Poll 18:28
lizmat also clickbaits rakudoweekly.blog/2022/05/09/2022-19-docublast/ 18:29
18:30 jjido left
grondilu you have no package method in your Action class? 18:31
grondilu was struggling to figure out how to deal with that 18:32
the name resolution thing is what discouraged me
japhb grondilu: I absolutely do not take offense at that code being called old. It's from before 6.c, so ... yeah, it's showing its age for sure. 18:38
grondilu do you see what I mean by name resolution and if you do, how did you deal with it? 18:41
(or how were you planning to) 18:42
grondilu goes to sleep 18:56
18:56 grondilu left
tonyo japhb: not sure i understand your response 19:07
19:24 sena_kun left 19:25 sena_kun joined 19:34 Kaipei joined 19:37 Kaiepi left 19:51 jaguart joined 19:56 jjido joined
tonyo .tell japhb i understand how macros work, referring mostly to the trend of code generation vs just using macros (whether it's syntactic or semantic). go's use of code generation, in practice, is abhorrent 20:29
tellable6 tonyo, I'll pass your message to japhb
20:34 Kaipei left 20:53 sena_kun left 20:55 sena_kun joined
ecocode___ is there some tool like `perldoc` for raku ? 21:01
MasterDuke there's a `rakudoc`, but i'm not 100% sure it's easy to get working right now. some of the doc infrastructure is in a bit of a mild upheaval 21:03
[Coke]: is probably the best person to ask 21:04
21:09 jjido left
ecocode___ I installed raku with rakubrew, but I don't seem to have that executable 21:11
(rakudoc)
MasterDuke yeah, it's a separate thing, not part of rakudo 21:12
ecocode___ hmm ok 21:13
MasterDuke i don't remember how it's installed, rakubrew, zef, something else... 21:14
ecocode___ found this on stackoverflow: `zef install 'rakudoc:auth<github:Raku>'` 21:19
which ends in `No candidates found matching identity: rakudoc:auth<github:Raku>` 21:20
MasterDuke what about just `zef install rakudoc`? 21:21
ecocode___ lol, how could I not think about that ? 21:25
still, gets an error ... 21:26
www.irccloud.com/pastebin/seYDOetP/
forcing now ... 21:27
seems to do the job 21:28
thx
MasterDuke i think you can just follow the suggestion and override the tests and it will install and work for the most part, i don't remember what exactly is causing the test fails
ecocode___ yep, it works 21:29
21:45 Kaiepi joined 21:47 vrurg joined 21:54 vrurg left 22:03 vrurg joined 22:14 discord-raku-bot left 22:15 discord-raku-bot joined 22:16 discord-raku-bot left, discord-raku-bot joined 22:23 jmcgnh left 22:31 jmcgnh joined 22:39 lichtkind_ left 22:43 melezhik joined 22:45 melezhik left 23:07 jaguart left 23:11 Manifest0 left 23:14 Manifest0 joined 23:42 Sgeo left 23:44 Sgeo joined