🦋 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:08 reportable6 left 00:10 reportable6 joined 00:25 eseyman_ joined 00:27 eseyman left, eseyman_ is now known as eseyman 00:39 eseyman left 01:29 melezhik joined
guifa oooh 01:42
I may not have been able to get /…/ quotes to work as expected but thankfully adding ecma regex to a grammar is pretty easy 01:43
02:13 Sankalp left 02:38 melezhik left 02:47 frost joined 03:05 Sankalp joined 03:37 Tirifto left 03:39 Tirifto joined 04:19 human-blip left 04:28 human-blip joined 05:28 nativecallable6 left, greppable6 left, sourceable6 left, evalable6 left, committable6 left, unicodable6 left, coverable6 left, benchable6 left, quotable6 left, releasable6 left, statisfiable6 left, shareable6 left, bisectable6 left, notable6 left, bloatable6 left, linkable6 left, reportable6 left, tellable6 left 05:29 sourceable6 joined, committable6 joined, evalable6 joined 05:30 nativecallable6 joined, greppable6 joined, benchable6 joined, reportable6 joined, statisfiable6 joined, coverable6 joined, releasable6 joined 05:31 unicodable6 joined, notable6 joined, linkable6 joined, quotable6 joined, bisectable6 joined, tellable6 joined, bloatable6 joined, shareable6 joined 05:34 swaggboi left 05:52 swaggboi joined 06:08 reportable6 left, swaggboi left 06:10 reportable6 joined 06:20 swaggboi joined 06:21 lizmat_ joined 06:22 vasko_ joined, Geth__ joined 06:23 Furor joined 06:24 vasko left, oodani left, corwin left, lizmat left, Colere left, Tirifto left, Furor left, oodani joined, Geth left, Furor joined 06:26 Tirifto joined 06:36 swaggboi left 06:37 mexen joined 06:48 Furor is now known as Colere 06:50 corwin joined 06:55 swaggboi joined 06:57 Sankalp left 07:03 linkable6 left 07:05 linkable6 joined 07:13 jaguart joined 07:14 Nemokosch joined
Nemokosch okay, here we go... 07:14
tellable6 2022-06-29T12:08:27Z #raku <patrickb> Nemokosch: I don't understand.
2022-07-06T09:32:09Z #raku <guifa> Nemokosch: Yeah. EMCA does flat ordering, and Raku nests
2022-07-09T14:51:33Z #raku <Xliff> Nemokosch: Howso? $dirs should just be a list of '/tmp', '/' and '~/tmp'
2022-07-11T08:56:35Z #raku <lizmat> Nemokosch: good spot, was watching the text more than semantics
2022-07-11T20:23:32Z #raku <guifa> nemokosch: ah. In that case, I'd still do a multi, and just have the whatever return a whatever returning the object itself (via .self)
2022-07-11T22:28:12Z #raku <guifa> Nemokosch: you can do a true call on * by encasing it in parentheses
Nemokosch good enough xD
07:17 Sgeo left 07:28 lizmat_ is now known as lizmat 07:40 abraxxa joined 07:57 Sankalp joined 07:58 dakkar joined 08:31 linkable6 left, linkable6 joined
Nemokosch What module would you use for accessing a REST API over HTTPS? 08:48
09:31 linkable6 left, evalable6 left 09:32 linkable6 joined, evalable6 joined
moritz Cro::HTTP::Client 09:42
Nemokosch okay, let's see 09:57
Nemokosch oh it supports authentication as well, nice 09:59
10:09 swaggboi left 10:10 swaggboi joined
jjatria Nemokosch: I'm biased (since I wrote it) but I use HTTP::Tiny for pretty much anything these days 10:10
Nemokosch I have used HTTP::Tiny a couple of times myself 10:11
but now that I downloaded the known universe for Cro, I might as well try it, lol
jjatria lol 10:12
Yeah, that's one of the reasons I wanted to write that one: fewer deps
Nemokosch does it support HTTPS and basic authentication? 10:15
jjatria If you have IO::Socket::SSL installed, then it will use it for HTTPS 10:20
And basic auth should work if your URL has a user:password stanza in it: raku.land/zef:jjatria/HTTP::Tiny#request 10:21
Or you can set the header yourself
Nemokosch makes sense 👍 10:34
10:41 swaggboi left 10:42 swaggboi joined
Do you know an alternative for Terminal::Getpass? 10:42
Something that doesn't break on unicode, lol
jjatria Yikes, not good. That's the one I use in `rakurl`, so I don't know. But if you find a better one, I can switch as well :D 10:52
Nemokosch ``` my $c = $*IN.read(1); 11:01
last if $c.decode("utf-8") ~~ /\n/;```
now this, this is not a wise thing to do
indeed it cuts actual utf-8 in half
11:15 frost left 11:16 nine left, nine joined, frost joined 11:23 frost left 11:33 swaggboi left 11:34 swaggboi joined
I think it could be fixed 11:37
can I edit a module locally? 11:49
guifa Nemokosch you'd just need to download the source and make edits and then `zef install .` 11:51
11:55 discord-raku-bot left, gcd left, discord-raku-bot joined
Nemokosch well the fix seems to work for my case 11:57
simply changed 11:58
```my $c = $*IN.read(1);```
to
```
my $c = buf8.new;
$c.append($*IN.read(1)) until try $c.decode('utf-8');
```
12:01 swaggboi left 12:02 swaggboi joined 12:08 reportable6 left 12:10 gcd joined 12:11 reportable6 joined 12:25 swaggboi left 12:42 swaggboi joined
guifa heh, conversions to Raku regex when you want it to be straightforward / one pass-y look hideous but they work 13:02
13:06 frost joined
guifa (especially the infamous e-mail validator) 13:10
13:14 swaggboi left 13:15 swaggboi joined 13:29 ismustachio joined 13:33 swaggboi left 13:45 morte_` joined 13:47 discord-raku-bot left, discord-raku-bot joined 13:50 swaggboi joined 13:53 morte_` left 13:56 monkey_ joined
japhb Nemokosch: Terminal-LineEditor does password masking and handles at least left-to-right Unicode. 13:58
Speaking of which, if anyone in channel can read and write a right-to-left language, I'd love to pick your brain. 13:59
14:05 saint- joined
saint- When printing out a match object, is there a way to limit the depth that it prints? 14:05
14:09 frost left 14:13 perlbot left
saint- Oh nvm, I can just call .Str on it, thanks 14:14
14:15 simcop2387 left
Altreus I have a class with a lot of properties for which default behaviour is fine, and one property where I need to intercept the value provided to the constructor before it's set on the object - so TWEAK is too late. But it also looks like if I implement BUILD I have to put all of the properties in the signature! Is there something like BUILDARGS from p5's Moose, where I can transform what is given to the 14:16
constructor befoer it's used to construct?
Nemokosch japhb: if Terminal::Getpass doesn't get a fix, I will look into using LineEditor 14:18
again, the complexity
Altreus Specifically, I have an Int property, which is a bitmask, which I can construct from strings; so I'd like the user to be able to pass a list of strings, or a bitmask of their own
I need to do that transformation before any of the default processes try to assign that array of strings to the property 14:19
14:22 saint- left 14:23 Sgeo joined 14:25 wcs joined 14:26 swaggboi left 14:27 swaggboi joined
nine A list of strings sounds like a very Perlish solution. Why not declare an enum where the numeric value is actually the bit that value should set. Passing Foo +| Bar to that constructor isn't much different to passing a list of strings. 14:28
14:33 simcop2387 joined
Altreus it's already an enum, but it's much more cumbersome to use that module and put ENUM:: on the front of everything, when one could simply do <x y z> 14:33
The idea was that I would do that ENUM::«$_» myself and reduce it 14:34
14:34 perlbot joined
Altreus That's also why I would like to continue to support just passing an int - because that's how it's already done 14:34
wait, I might have overcomplicated my base case 14:35
yes I think I might have tbh 14:36
japhb Altreus: enums can be exported, so that their short names are available in the using code 14:38
Nemokosch: Sadly, my experience is that doing line editing even half-decently is decidedly not as easy as one might think. 14:39
But adding password handling was easy in comparison, so ... if you have a use for a line editor, you get the password input for "free". :-) 14:40
My reason for writing Terminal-LineEditor was actually that Linenoise did such a terrible job of it ... and the reason for *that* is because the authors were trying to write a smaller line editor than Readline, and bit off more than they could chew, Unicode-wise. 14:41
Altreus japhb: that was my overcomplication :)
japhb Altreus: :-) 14:45
14:45 melezhik joined
japhb Oh, to be clear, I should mention that the Linenoise problem is not due to the Raku wrapper for it, the problems are in the underlying C library, which is just ... broken. And anglocentric. 14:46
melezhik Hi jjatria - thanks for github.com/melezhik/Tomtit/issues/2 , you took some interest in Tomty, don't you?   😁
14:53 saint- joined
Nemokosch Well, all I really need is a password input 14:56
and even for that, it's enough if it doesn't break for me and potentially colleagues 14:57
15:02 swaggboi left
japhb My experience is that minimalist libraries don't tend to handle Unicode well. :-) I'd wager there's a cliff between "minimal password entry" and "does more than just password entry, but at least can handle Unicode and duospace glyphs" with not very much in between. Still, if you find such a thing, more power to ya. 15:02
15:06 Sankalp left 15:09 Sankalp joined
Nemokosch I think I have told you about the problems I've come across when using Terminal::LineEditor as the REPL line editor, so there's still where to grind 😛 15:12
Right now, the only reason unicode failures bother me with the password prompt is that the password I'm using contains non-ascii characters (that are otherwise pretty generic Latin alphabet characters) 15:14
It's better to know about this stuff and fix it but it's not worth too much for me.
15:18 swaggboi joined 15:19 Sankalp left
melezhik lizmat I made some comment on my PR to App::Rak 15:21
I'd interested to see your opinion ))) 15:22
15:23 Sankalp joined
[Coke] does zef install everything in bin/ ? I just realized I never declare that in something like meta6.json/provides. 15:25
melezhik [Coke] it does so by default
jjatria melezhik: starting a new difficult project means trying out the new tools! :D 15:26
melezhik everything you have in `bin/` will be installed by zen, you don't have to declare  anything explicitely
jjatria ahh, ok , I wonder how you are thinking use of Tomtit? You need a task runner? 15:27
jjatria Same problem: PublicSuffix. I'm currently prototyping the autobuilds using ake but I'm not sure I'm totally sold on it 15:28
melezhik so, it's ake vs tomtit? HA-HA  😁 15:30
overall if you don't need make like things likes tasks dependencies, tomtit could be simple way to go, as it's just task runner with Sparrow6 plugins support
jjatria So far, just trying stuff out :) 15:31
melezhik that means batteries included - every from sparrowhub.io just works with Tomtit ....
are you sold? HA-HA 😂
jjatria I tried a simple placeholder task and I got an inexplicable `Failed to copy '/home/user/repo/api/v1/index' to '/home/user/sparrow6/index'` so not quite there yet 15:33
melezhik it's simple to fix - `export SP6_REPO=sparrowhub.io/repo` 15:34
jjatria Neither of those directories exist so not sure where they are coming from 🤔
melezhik also please upgrade Sparrow6 to the latest version, as a new version of Tomtit requires the latest version of Sparrow6
by default tomtit ( well actually Sparrow) looks for repository of plugins at local directory (~/repo), it works well if one has this on their machine, however , most of the user don't - so just redefine SP6_REPO var to point to http public repository 15:36
export SP6_REPO=sparrowhub.io/repo
jjatria Maybe it should test if that exists and ignore it otherwise? 15:37
melezhik please fill a ticket and think about it ... 15:38
think -> I will think 15:39
I also might change repo default setting to sparrowhub.io/repo to avoid this confusion 15:40
jjatria melezhik: github.com/melezhik/Tomtit/issues/3 15:43
15:44 swaggboi left, swaggboi joined
melezhik jjatria ++ 15:50
jjatria put my comment 16:02
guifa TIL <-ident> for "anything that's not in the <ident> character class 16:11
m: grammar Foo { token bar { <[a..f]> }; token TOP { <+[a..z]-bar>+ } }; say Foo.parse: 'xyz'; say Foo.parse: 'abc'; 16:13
camelia 「xyz」
Nil
guifa whoa
This is… not documented but very cool 16:15
only seems to work in a grammar though 16:19
m: my token nothex { <[g..z]> }; say '1920abc' ~~ / <[0..9]+[a..z]-nothex>+ / 16:20
camelia No such method 'nothex' for invocant of type 'Match'. Did you mean
'note'?
in block <unit> at <tmp> line 1
japhb Nemokosch: I remember you asking me if I was the author of Terminal-LineEditor, but I don't remember what you were concerned with. GitHub Issues welcome (github.com/japhb/Terminal-LineEditor/issues) :-) 16:21
guifa hmm so it looks like even though the <[foo]> is supposed to be for character classes (emphasis on character, singular), it'll happily take a multi-char match there 16:26
16:27 monkey_ left 16:29 vrurg_ joined, vrurg left
guifa it's not entirely intuitive though: 16:29
m: grammar A { token b { <[a..c]> <[d..f]> }; token TOP { <+ident -b>+ } }; A.parse($_).say for <a ad aad>;
camelia 「a」
Nil
「aad」
guifa actually, make that buggily unintuitive 16:31
how in the world does this match for aad? 16:32
m: grammar A { token b { <[a..c]> <[d..f]> }; token TOP { <+ident -b> } }; A.parse($_).say for <a ad aad>;
camelia 「a」
Nil
「aad」
16:32 melezhik left
guifa summons the regex magus 16:33
moritz: any ideas what's going on there? 16:34
16:34 monkey_ joined 16:37 dakkar left
Nemokosch what the hell, b isn't even a character class 16:37
guifa yeah. I figured it would only try to maybe match a single character to <b> (which should be an always fail), but no, not doing that 16:38
Nemokosch what about adad? 😄 16:41
guifa m: grammar A { token b { <[a..c]> <[d..f]> }; token TOP { <+ident -b> } }; A.parse($_).say for <a ad aad adad>;
camelia 「a」
Nil
「aad」
Nil
guifa m: grammar A { token b { <[a..c]> <[d..f]> }; token TOP { <+ident -b> } }; A.parse($_).say for <a ad aad adad aadad>;
camelia 「a」
Nil
「aad」
Nil
「aadad」
16:58 abraxxa left
Nemokosch we can notice a... kind of pattern 17:03
guifa m: grammar A { token b { <[a..c]> <[d..f]> }; token TOP { <+ident -b> } }; A.parse($_).say for <a ad aad adad aadad aaadad>; 17:04
camelia 「a」
Nil
「aad」
Nil
「aadad」
「aaadad」
guifa I figured it was taking them in two at a time (aa, and then doing da da), but it's not that 17:05
something weird is going on, and I'm not sure if it's worth fixing before an eventual regex overhaul 17:06
(iirc that's the one of the next big projects after RakuAST) 17:11
Nemokosch also 17:12
> token TOP { <+ident -b> }
this grammar looks like something that consists of single characters?
like what even
guifa That's the character class syntax 17:15
<+[a..z]-[h..z]>
Add a..z, then subtract h..z. 17:16
That's a bit of a pointless example since you could just write <[a..g]>
token anything-letter-but-eszett { <+alpha -[ß]> } is much easier to write than, ugh, I dunno know what the start and end ranges would be 17:17
Nemokosch okay but that still only makes one character 17:18
guifa yeah. the bug is clearly that somehow it's looping even though it shouldn't
Nemokosch okay but in your very first example, at least there was a quantifier after the character group
since then, I have no idea what the behavior should be 17:19
17:58 evalable6 left, linkable6 left 17:59 linkable6 joined 18:00 evalable6 joined 18:08 reportable6 left 18:09 reportable6 joined 18:32 monkey_ left 18:50 sena_kun left 18:53 sena_kun joined 19:22 Nemokosch left 19:54 swaggboi left 19:55 swaggboi joined 19:59 vrurg_ is now known as vrurg 20:09 [Coke]_ joined 20:12 [Coke] left 20:19 saint- left 20:21 Sgeo_ joined 20:23 vasko joined, vasko left, vasko joined, vrurg_ joined 20:26 gcd_ joined
[Coke]_ I want two executables that do the same except for one thing keyed off the name of the executable. Is there a clever way to do this other than 1) two scripts identical but for the one thing, 2) one script that exec's the next one and have the condition check for the name of the executable? 20:28
20:28 [Coke]_ is now known as [Coke]
[Coke] The Naive #1 version is fine for now. 20:28
(but feedback welcome)
20:31 vrurg left, Sgeo left, gcd left, Geth__ left, vasko_ left, merpaderp left 20:34 merpaderp joined, Geth__ joined
guifa Why not just have the name check in the small part that's different? 20:44
[Coke] but duplicate all the code in both? 20:49
[Coke] tries to dig back into creating a viewport in a command prompt and remembers why he stopped. 20:52
japhb perks up 20:54
What do you mean "creating a viewport"?
guifa: I think the problem that [Coke] is having is that the classic way of solving the problem is to have one script plus a link farm, and have that one script detect the name it was called with to figure out which link was used. Except zef doesn't know how to install links, I suspect. 20:56
(user-level links in bin/, not internal links, of course, which are a necessary part of doing the basic Raku install job)
guifa aaah 21:10
21:11 [Coke]_ joined 21:14 [Coke] left 21:18 swaggboi left 21:19 swaggboi joined 21:20 maettu left 21:59 swaggboi left 22:07 perlbot left 22:11 perlbot joined 22:12 p6steve left 22:16 swaggboi joined 22:26 p6steve joined
[Coke]_ (links) also probably not workable on windows easily 23:02
23:02 [Coke]_ is now known as [Coke]
[Coke] (viewport) have a console window split into multiple sections, kind of link an irssi window 23:02
want to have scrolling output on top, and a status bar at the bottom 23:03
23:31 jaguart left
japhb Working on something that would help with that. Just my off-hours project, so not exactly moving screaming-fast, but I manage to put in a few hours most weekends. 23:48
23:58 gcd_ is now known as gcd