š¦ 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: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku Set by lizmat on 1 May 2021. |
|||
00:01
reportable6 left
00:03
reportable6 joined
00:29
softmoth left
00:37
epony joined
00:41
Sgeo_ joined
00:42
Sgeo left
|
|||
codesections | there isn't a method that returns a list of all subscribers to a Tap, is there? | 00:51 | |
01:07
titsuki joined
01:22
titsuki left
01:31
frost-lab joined
01:40
elcaro left
01:41
elcaro joined
01:49
kvw_5 joined
|
|||
[Coke] | isn't the tap *the* subscription? | 01:50 | |
So you'd want all the objects returned when someone called .tap on a Supply? | |||
codesections | er, no, sorry all subscribers to a Supply | 01:51 | |
[Coke] | I think you'd have to wrap a supply's tap to get that. | 01:52 | |
01:52
kvw_5_ left
|
|||
codesections | that makes sense. I guess by default/with `$supply.tap`, a subscriber isn't even given a name in the calling code | 01:54 | |
[Coke] | I'm not sure you can .wrap the tap method. You could add another method that tracked and called, but then you're missing anyone you're sharing the object with | 01:58 | |
m: my $s = Supply.from-list(1, 2, 3); my $tapper = $s.^methods.grep({$_.name eq 'tap'}).map({$_.wrap(-> {say 'hi'})}); my $a = $s.tap; dd $a; | 01:59 | ||
camelia | Tap $a = Tap.new | ||
[Coke] | that looks like it was just ignored. not sure if possible. | 02:00 | |
codesections | yeah, it may not be. I wonder if there's a deeper reason to make sure it's _not_ possible, for concurrency safety or something | 02:01 | |
unrelated question: is it possible to have a dynamic parameter for a block/sub? | |||
m: for (1, 2, 3) -> $*a { say $*a.VAR.dynamic } | 02:02 | ||
camelia | False False False |
||
codesections | m: for (1, 2, 3) -> $*a is dynamic { say $*a.VAR.dynamic } | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Can't use unknown trait 'is' -> 'dynamic' in a parameter declaration. at <tmp>:1 expecting any of: rw readonly copy required raw leadiā¦ |
||
02:52
linkable6 left,
evalable6 left
02:53
evalable6 joined
02:54
linkable6 joined
03:54
greppable6 left,
nativecallable6 left,
committable6 left,
notable6 left,
reportable6 left,
sourceable6 left,
bisectable6 left,
squashable6 left,
coverable6 left,
evalable6 left,
quotable6 left,
releasable6 left,
benchable6 left,
statisfiable6 left,
bloatable6 left,
unicodable6 left,
shareable6 left,
tellable6 left
03:55
benchable6 joined,
tellable6 joined,
releasable6 joined,
sourceable6 joined,
greppable6 joined
03:56
bloatable6 joined,
committable6 joined,
quotable6 joined,
notable6 joined,
coverable6 joined,
evalable6 joined,
squashable6 joined,
statisfiable6 joined
03:57
bisectable6 joined,
reportable6 joined,
nativecallable6 joined,
shareable6 joined,
unicodable6 joined
04:20
wamba joined
04:25
xinming_ joined
04:28
Sgeo_ left,
xinming left
04:42
Sgeo joined
04:51
rindolf joined
05:20
gordonfish left
06:01
reportable6 left
06:02
reportable6 joined
06:03
sno left
06:05
sno joined
06:29
domidumont joined,
jmerelo joined
06:35
sno left
06:41
Sgeo left,
sno joined
06:47
sno left
06:50
sno joined
06:53
brtastic joined
06:57
sno left
06:59
sno joined
07:04
sno left
07:05
sno joined
07:12
sno left
07:15
sno joined
07:22
sno left
07:24
sno joined
07:29
sno left
07:32
abraxxa1 joined
07:36
__jrjsmrtn__ joined
07:37
_jrjsmrtn left
07:39
pecastro joined
07:42
abraxxa1 left
07:43
abraxxa1 joined
07:49
kurahaupo_ joined
07:50
kurahaupo left
08:03
Altai-man_ left
08:07
wamba left
08:18
kurahaupo joined
08:21
kurahaupo_ left
08:48
wamba joined
09:10
dogbert11 left,
dogbert11 joined
09:22
parabolize left
09:28
sena_kun joined
09:38
wamba left
09:49
sno joined
09:51
wamba joined
10:07
ecocode left
10:12
ecocode joined
10:18
ecocode left
10:20
ecocode joined
10:21
jmerelo left,
jmerelo joined
10:28
frost-lab left
10:43
rindolf left
11:09
Xliff joined
11:15
linkable6 left
11:16
linkable6 joined
11:28
wl20 left
11:29
wl20 joined
11:33
Kaiepi left
11:38
timlegge left
11:39
LizBot left
11:43
domidumont left
12:01
reportable6 left
12:02
wingfold left
12:03
reportable6 joined
12:05
wingfold joined
|
|||
Xliff | Is there any way to get the list of types from a subset? | 12:14 | |
tyil | .map(*.WHAT)? | 12:16 | |
Xliff | m: my subset A where Int | Str | Num; A.map(*.WHAT).say | 12:17 | |
camelia | Cannot map a A using 'Whatever' Did a * (Whatever) get absorbed by a list? in block <unit> at <tmp> line 1 |
||
tyil | ah | 12:18 | |
hm | 12:19 | ||
Xliff | Yeah. I think everything after the where code is turned into a block of code. | ||
MasterDuke | m: my subset A where Int | Str | Num; A.map({.WHAT}).say | ||
camelia | ((A)) | ||
Xliff | So you can't introspect a subset as it stands today. | ||
MasterDuke | maybe the eigenstates module might help, but i'd not bet a lot on it | 12:20 | |
Xliff | m: my @types = (Str, Int, Num); our subset A where @types.any; say Str ~~ A | ||
camelia | True | ||
Xliff | ^^ That might be the best way to get what I want, for now. | ||
I just introspect @types. | 12:21 | ||
brtastic | If I'm making a Grammar rule, can I have a named capture group and refer to that capture later in the same rule? | ||
moritz | yes | 12:22 | |
tobs | m: subset A where Int | Str; say A.^refinement; say A.^refinement.($_) for Int, Str, Blob | 12:26 | |
camelia | -> ;; $_ { #`(Block|71081904) ... } True True False |
||
tobs | apparently the junction is even wrapped in a block, so I don't see how you could get at the types, even if you're guaranteed that the subset's where clause is just a junction of types. | 12:27 | |
lizmat | yeah, that's a thunk, a block without its own scope | ||
and we can't inspect code | 12:28 | ||
kawaii | is it not possible to apply traits to submethods? I'm using the Red ORM and trying to make exposing it's $*RED-DB variable a bit easier, but the compiler says what I'm doing isn't allowed (github.com/shuppet/raku-mint/blob/...d#L9-L14). I tried to do `submethod TWEAK() is red-method {}` but got greeted with `Can't use unknown trait 'is' -> 'red-method' in a submethod declaration.`, I assume this is because my trait | ||
doesn't exist yet because TWEAK triggers before the object is fully created? | |||
lizmat | make sure the trait exists ? | ||
kawaii | is there more to defining a trait than what I linked? the current page on traits in the documentation lead me to believe so | 12:32 | |
Xliff | m: say "bleah" ~~ *.ends-with('eah') | 12:45 | |
camelia | True | ||
Xliff | m: say "blea" ~~ *.ends-with('eah') | ||
camelia | False | ||
lizmat | m: say "foo" ~~ True | 12:46 | |
camelia | Potential difficulties: Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead at <tmp>:1 ------> 3say "foo" ~~ 7ā5True True |
||
lizmat | m: say "foo" ~~ False | 12:47 | |
camelia | Potential difficulties: Smartmatch against False always fails; if you mean to test the topic for truthiness, use :!so or *.not or !* instead at <tmp>:1 ------> 3say "foo" ~~ 7ā5False False |
||
lizmat | Xliff ^^ | ||
m: no worries; say "foo" ~~ False | |||
camelia | False | ||
lizmat | m: no worries; say "foo" ~~ True | ||
camelia | True | ||
Xliff | lizmat: I don't understand your caveat. | 12:48 | |
The test cases worked as expected. | |||
lizmat | yeah, but the smartmatch is not needed ? | ||
Xliff | Actually, I was testing if a smartmatch would match against Whatever code. | 12:49 | |
Which it does... | |||
12:49
brtastic left
|
|||
Xliff | So I can: use File::Find; .say for find(dir => "lib/Evolution", name => *.ends-with(".pm6")) | 12:49 | |
And not use a regex... :) | |||
But now I need multiple tests, so I now need a block. *sigh* | 12:50 | ||
m: say "blea" ~~ { .starts-with("b") && *.ends-with('eah') } | 12:51 | ||
camelia | WhateverCode.new | ||
Xliff | :( | ||
The name argument is smartmatched against all IO::Path elements. | |||
So now I need to drop back to regexes.... | 12:52 | ||
leont | m: say "blea" ~~ { .starts-with("b") && .ends-with('eah') } | ||
camelia | False | ||
Xliff | leont: oops! | 12:53 | |
m: say "blea" ~~ { .starts-with("b") && .ends-with('ea') } | |||
camelia | True | ||
Xliff | m: say "clea" ~~ { .starts-with("b") && .ends-with('ea') } | ||
camelia | False | ||
Xliff | \o/ | ||
13:01
jmerelo left
|
|||
Xliff | m: say "subroutine" ~~ /Ā«'sub'Ā»/ | 13:06 | |
camelia | Nil | ||
Xliff | m: say "subroutine" ~~ /Ā«subĀ»/ | ||
camelia | Nil | ||
Xliff | Huh | ||
13:10
lucasb joined
13:31
Black_Ribbon left
13:34
b2gills left
13:40
timlegge joined
13:41
gordonfish joined
13:59
b2gills joined
|
|||
MasterDuke | aren't << and >> word boundaries? like \b in pcre? | 14:00 | |
moritz | correct | 14:05 | |
14:05
doconthe2ocks left
14:06
doconthe2ocks joined
14:12
doconthe2ocks left,
doconthe2ocks joined
|
|||
lizmat | and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/05/03/2021-...ble-comma/ | 14:22 | |
afk for a few hours& | 14:27 | ||
14:28
wl20 left
14:30
wl20 joined
14:36
Sgeo joined
15:00
Xliff left
15:05
brtastic joined
15:10
wamba left
15:13
parabolize joined
15:19
ens joined
16:06
wingfold left
|
|||
brtastic | how can I express a newline in a character class? <-[\n]> does not seem to work | 16:18 | |
16:25
wingfold joined
|
|||
codesections | m: say "ln1\nln2" ~~ /<-[\n]>*/ | 16:26 | |
camelia | ļ½¢ln1ļ½£ | ||
codesections | brtastic: <-[\n]> seems to work? ^^^ | ||
brtastic | codesections: I must be doing something else wrong. I also found :Zl which seems to serve the same purpose but it also doesn't work for my case | 16:29 | |
:!Zl to be exact | |||
raydiak | "it doesn't work" with no code example is very difficult to diagnose :) | 16:32 | |
brtastic | yeah I'm not asking you to diagnose right now, I wanted to know why my character class isn't working, and it was diagnosed already ;) | 16:38 | |
I'll figure it out eventually | |||
by the way, is <:Zl> like vertical whitespace, or am I getting a wrong idea here? | 16:40 | ||
raydiak | hmmm | 16:42 | |
m: say "\x0B" ~~ /<:Zl>/ | 16:43 | ||
camelia | Nil | ||
raydiak | not the same, apparently | ||
just tested everything listed in the docs under \v, looks like U+2028 LINE SEPARATOR is the only character that matches both \v and <:Zl> | 16:47 | ||
brtastic | ahh I've got CR LF line endings, thats why I'm having all these trouble :P | 16:48 | |
raydiak | ah ha. I was just thinking about that nightmare last night...wondering if I've written anything that breaks under windows because of that | 16:49 | |
brtastic | $$ seem to help, but it makes rakudo take all my memory if I place it in some weird places | 16:51 | |
raydiak | odd | 16:53 | |
sometimes I've used \r?\n for portability | |||
codesections | Odd, way the docs talk about \n, I wouldn't have thought CRLF endings would be a problem: docs.raku.org/language/regexes#\n_and_\N | 17:02 | |
(no personal experience with Raku + Windows, though) | 17:03 | ||
m: say ("ln1\r\nln2" ~~ /<[\n]>/).Str.raku | 17:05 | ||
camelia | "\r\n" | ||
17:11
brtastic left
|
|||
raydiak | that's more in line with what I thought I remembered reading somewhere. though I also recall having to use \r?\n somewhere. don't know when or where or why, though | 17:16 | |
17:39
wamba joined
18:01
reportable6 left
18:03
reportable6 joined
18:18
dogbert11 left
18:23
pat_js left
18:24
patrickb joined
18:26
linkable6 left,
dogbert17 joined
18:27
linkable6 joined
18:29
natrys joined
18:37
buffet left
18:38
buffet joined
18:47
wamba left
18:59
sno left
19:00
sno joined
19:21
natrys left,
wamba joined
19:27
pat_js joined
|
|||
patrickb | I'm searching for someone with access to a MacOS machine with Big Sur installed to perform some (trivial) tests to help with solving a ticket (github.com/Raku/App-Rakubrew/issues/34). Does this apply to anyone? | 19:36 | |
ugexe | i cant atm, but im on Big Sur and use rakubrew without any issue | 19:37 | |
although i believe it was installed prior to installing Big Sur | 19:38 | ||
19:39
mowcat joined
19:42
mowcat left
|
|||
raydiak | whenever you have time, we'd appreciate help filling out the blanks in the testing matrix in the last comment on that issue. should only take a single-digit number of minutes. | 19:44 | |
19:53
elcaro left,
moony left,
bdju left,
m_athias left
19:55
elcaro joined,
moony joined,
bdju joined,
m_athias joined,
moony left
19:57
moony joined
|
|||
ugexe | i renamed ~/.rakubrew to ~/.rakubrew.bak/, then ran `curl rakubrew.org/install-on-macos.sh | sh` and it worked and so did raku -v | 20:13 | |
is there a point to doing the rest of the matrix? | |||
raydiak | yes. some people are uncomfortable blindly executing a script from a url, or are otherwise confused, so they download the script to a file first. this causes other issues | 20:14 | |
ugexe | im not clear what /path/to/rakubrew is | 20:15 | |
is that ~/.rakubrew or ~/.rakubrew/bin/rakubrew | |||
raydiak | download the script through a browser instead of curling and piping. that should actually be the path to the install script, not rakubrew. my mistake | 20:16 | |
actually, that's not right. the original person who encountered the error downloaded rakubrew.org/macos/rakubrew and tried to run it | 20:18 | ||
so d/l rakubrew.org/macos/rakubrew from a browser, then try the other things | |||
either way should give the same behavior, if I'm not mistaken. would also be curious what happens if you curl it to a file instead of download through a browser. I'm betting anything in a terminal (e.g. curl) won't show the quarantine problems but idk for sure | 20:21 | ||
patrickb | raydiak: Thanks for explaining more. | 20:27 | |
20:27
HobGoblin left,
HobGoblin joined
|
|||
patrickb | I'll be off to bed soon... | 20:27 | |
20:27
HobGoblin is now known as UukGoblin
20:28
cooper left
20:29
wl20 left
|
|||
raydiak | patrickb: you're welcome, happy to help. I'll update the matrix in my comment as we get more information. sleep well :) | 20:29 | |
20:29
cooper joined
20:31
wl20 joined
|
|||
patrickb | Thank you, raydiak and ugexe as well! | 20:32 | |
patrickb is off to bed | |||
o/ | |||
20:32
patrickb left
|
|||
raydiak | \o | 20:32 | |
ugexe | i downloaded that file through firefox, had to chmod +x the file, then cntrl + click + open (which is how you have to open files from the internet) which gives a warning that you can click OK. that created the ~/.rakubrew directory but there is nothing in ~/.rakubrew/bin. Its all frustratingly more difficult than using curl (and if you are checking the checksums and stuff you probably dont care about | 20:35 | |
downloading things from you rbrowser) | |||
raydiak | so it does run, at least through the gui, just with a warning and for some reason still doesn't actually work correctly | 20:37 | |
what about doing the things in the matrix to the file before you run it? does it work in that case? | 20:38 | ||
so far I'm leaning towards just adding a note like '"curl | sh" is the only method known to work reliably on Big Sur' | 20:40 | ||
20:44
cooper left
|
|||
ugexe | if i run `./rakubrew` from the Downloads directory it does the same thing | 20:44 | |
codesign command -> ./rakubrew: main executable failed strict validation | |||
xattr -c /path/to/rakubrew didnt error but didnt fix it | 20:45 | ||
xattr -d com.apple.quarantine /path/to/rakubrew complained about com.apple.quarantine not existing or something | |||
xattr: ./rakubrew: No such xattr: com.apple.quarantine | 20:46 | ||
echo 'eval "$(/Users/ugexe/Downloads/rakubrew init Zsh)"' >> ~/.zshrc | 20:48 | ||
its telling me to do that, which cant be right | |||
it should be suggesting the non-existing ~/.rakubrew/bin/rakubrew | |||
raydiak | awesome, thanks for the data. I don't think in the direct download case that it's expected to install itself to ~/.rakubrew/bin, it just creates ~/.rakubrew to store the rakudos in, but you're responsible for putting the rakubrew script in your $PATH yourself. does it build a working raku if you do e.g. "Downloads/rakubrew build moar"? | 20:49 | |
the installer script should install like that, but the direct download instructions just say "put it in your path" | 20:50 | ||
ugexe | PATH="$PWD:$PATH" ./rakubrew build moar | 20:51 | |
The shell hook required to run rakubrew in either 'env' mode or with the 'shell' command seems not to be installed. | |||
Run 'rakubrew init' for installation instructions if you want to use those features, | 20:52 | ||
or run 'rakubrew mode shim' to use 'shim' mode which doesn't require a shell hook. | |||
raydiak | try the shim? | 20:53 | |
I don't even recall exactly what that does, I'm just reading the instructions on rakubrew.org under "bare bones" | 20:54 | ||
20:55
HarmtH joined
|
|||
raydiak | If you're out of time to play with it, np. I think we have enough information to clarify the instructions at this point. Thanks a ton for your help! | 21:14 | |
21:27
mowcat joined
21:29
wl20 left
21:30
wl20 joined
21:33
wmoxam_ left,
wmoxam joined
21:36
skipnow joined,
Black_Ribbon joined
21:40
[Coke] left
21:44
skipnow left
21:45
skipnow joined
21:46
skipnow__ joined,
skipnow left
21:47
skipnow__ left
21:49
skipnow joined
21:50
skipnow left,
skipnow_ joined
21:52
skipnow_ left
21:54
skipnow joined
21:56
skipnow left,
skipnow joined
21:57
skipnow left
22:02
skipnow joined
22:04
skipnow left,
skipnow50 joined
22:08
skipnow50 left
22:10
softmoth joined
22:17
pecastro left
22:22
wamba left
|
|||
ingy | o/ | 22:29 | |
22:30
mowcat left
|
|||
softmoth | hi, ingy | 22:31 | |
tadzik | \o | 22:32 | |
22:42
cooper joined
22:52
dataangel joined
22:56
rindolf joined
|
|||
softmoth | Hello! Would anyone please run: zef update && zef install rakudoc; and let me know if it works for you, and how you like it. I'm curious primarily to ensure that it finds your installed modules. The formatting is rudimentary but I do find it very handy already. | 23:11 | |
23:11
edds joined
|
|||
edds | X) | 23:11 | |
softmoth | m6locks, I've removed the external Documentable dependency from rakudoc, and it should be trivial to install now | 23:16 | |
edds | where this language used? | 23:18 | |
softmoth | edds, it's largely used by hobbyists, people interested in language design, and in the Rakudo compiler itself. There are many modules available at modules.raku.org, and resources for learning more about Raku at raku.org/community | 23:26 | |
edds | softmoth what interesting in this lang? | 23:27 | |
raydiak | edds: also read towards the bottom of raku.org homepage, "Successfully use in production at" | 23:28 | |
softmoth | docs.raku.org/language/faq#Why_sho..._about_it? | 23:29 | |
edds | raydiak i not familliar with this logos | ||
raydiak | me neither mostly :) | 23:31 | |
softmoth | It depends on what interests you, but for me personally I like the built-in Grammars for parsing, and the way it makes both functional and object-oriented programming first class paradigms. It is both lazy and eager at the same time, mostly done behind the scenes. It has multi-threading features everywhere. | ||
Unicode support is better than any other language, probably. | 23:32 | ||
edds | you are responsive :) | 23:33 | |
softmoth | rarely, but you caught me at a good time :-) | ||
edds | what you doing now? | ||
softmoth | I just finished an improvement to the long-abandoned 'rakudoc' program, and I was hanging out here looking for feedback from others | 23:34 | |
My wife is a bit late getting home from work, so I'm just hanging out until she arrives.... | 23:35 | ||
edds | hah | ||
softmoth | What's your interest in Raku? Where did you hear about it? | ||
edds | on weird russian forum | 23:36 | |
linux.org.ru | |||
from some news post on habr | 23:37 | ||
guys tell that this language is slow | |||
what is MoarVM | 23:38 | ||
title was 'Racudo released' and im like :what is this | 23:40 | ||
softmoth | MoarVM is a virtual machine designed specifically to run Raku on. That is, its abstractions match the needs of Raku well. So when you run Rakudo, it generates MoarVM bytecode. And running a Raku program is done by the moarvm program. (Or, Rakudo can also generate Java VM bytecode, to run on the jvm instead of MoarVM.) | 23:41 | |
raydiak | for some things, it's true we aren't the fastest. but we're improving performance in various areas with every monthly releaese, often multiplying the speed of some functions by several times in one release | 23:42 | |
edds | so you need moarvm to run raku? | 23:43 | |
softmoth | Hmm, yes, maybe if you're interested in languages you heard a long time ago about Perl 6, a sister language to Perl. Raku is the language that came out of the Perl 6 effort, and its main compiler is called Rakudo. | ||
edds, yes, you need the `moar` interpreter. The JVM output works, too, although with less features. There used to be .NET and Javascript backends also, but I don't think they're maintained anymore. | 23:44 | ||
edds | its works only in special vm | 23:46 | |
its can be used for some computing, ai ? | |||
softmoth | Yes, it needs to run in the VM, similar to many dynamic languages. | 23:47 | |
Yes, it is a very capable, expressive language. | 23:48 | ||
edds | may be its cool to show power of lang in example thats alive and usable project | ||
softmoth | You might look at cro.services/ | ||
japhb | edds: Cro? Red? MUGS? | ||
edds | and itsĀ open possibilities to be in focus | 23:49 | |
japhb im dont understand | |||
japhb | edds: You were asking for projects that might show the power of the language? | 23:51 | |
Here's an early example, one of the first JSON parsers for Raku: github.com/moritz/json/tree/master/lib/JSON | 23:52 | ||
softmoth | edds, Red: modules.raku.org/dist/Red:cpan:FCO#red ; MUGS: modules.raku.org/dist/MUGS:zef:zef:japhb#name | ||
edds | japhb im just imagine this, like you are put your passion in cooperative-project may be like ai algorithms | ||
japhb | github.com/moritz/json/blob/master...Grammar.pm is a good example of how nice and succinct Raku Grammars can be | 23:53 | |
edds: Are you asking if I have put energies into an open source project, or whether Raku is good for AI, or something else? | |||
edds | japhb sprry i cant agree with you because im not understand anything what i see on that page | 23:54 | |
mm yes) | |||
not engineers may be work with | 23:55 | ||
what are you interest? may be space | |||
i tell stranger things | 23:56 | ||
japhb | edds: If you mean the Grammar page, it's pretty much a direct translation of the official JSON grammar. But fair enough. :-) | ||
23:56
clarjon1 joined
|
|||
japhb | In the Raku world, I'm often a "mantle" developer -- writing things that sit on top of the core and support people doing things at the outer layers. Libraries and frameworks and such. | 23:57 | |
softmoth | japhb, would you be able to test `zef update; zef install rakudoc` and see if it works for you? | 23:58 | |
japhb | Sometimes I dip down lower, sometimes I build something for the top level. |