🦋 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.
01:36 hulk joined 01:37 kylese left 02:11 silug left 02:12 silug joined 02:15 hulk left, kylese joined 02:18 silug left 02:19 silug joined 02:29 guifa left 02:30 kylese left 02:32 silug left 02:33 silug joined 02:35 kylese joined 02:42 guifa joined 02:45 ACfromTX joined 03:54 beastieboo__ left 03:55 beastieboo__ joined 04:46 jpn joined 05:01 beastieboo__ left, beastieboo__ joined 05:27 CIAvash joined 05:56 jpn left 07:31 jpn joined 07:35 jpn left 08:22 Sgeo left 08:46 wayland left, wayland76 joined 09:22 jpn joined, sena_kun joined 09:42 soverysour joined 09:51 thaewrapt left 09:53 soverysour left 09:58 thaewrapt joined 10:15 CIAvash left 10:17 vrurg_ joined 10:20 vrurg left 10:22 oodani left 10:23 oodani joined 10:43 Geth joined
tbrowder antononcube: any raku ppl beside you down south? 11:01
you giving any public presentos this year? 11:02
11:05 jpn left 12:27 thaewrap1 joined 12:30 thaewrapt left
tbrowder i’m using “$proc = run <<locate -q $f>>, :out, :err;” to test for existence of a system file. when the file is found, exitcode is 0 and i can get the :out lines fine. however, when NOT found, exitcode is 1 (as expected), but i can’t seem to capture the err lines in :err. 12:58
this is debian with latest raku 13:01
hm, it doesn’t explain the problem above, but the locate command does have a “—limit” option which can be used to quell an exitcode of 1 when nothing is found. i can live with that, but it still begs question of non-capture of :err. 13:13
13:33 soverysour joined 13:37 soverysour left
tbrowder no, i can’t live with that. why am i not capturing stderr: $p=run “…”, :err;” 13:55
m: my $p=run <<locate blahZx>>, :err 13:56
camelia ( no output )
tbrowder double hm 13:57
14:01 jpn joined 14:07 jpn left
ugexe ...are you reading the .err handle? 14:08
m: my $p = run "ls", "--asdfasfd", :err; say $p.err.slurp(:close) 14:10
camelia ls: unrecognized option '--asdfasfd'
Try 'ls --help' for more information.
ugexe does locate actually output to stderr?
tbrowder let me try on cmd line on my host 14:12
ugexe m: my $p = run "locate", "-q", "blahZx", :err, :!out; say $p.err.slurp(:close)
camelia
ugexe i dont know why that output blank here, but on my computer it outputs the usage 14:15
tbrowder on the command line i NO output when locate doesn’t find anything
ugexe locate: illegal option -- q
tbrowder i’m using debian 11 14:17
ugexe what output do you actually expect to capture with `run`? you stated 14:21
tbrowder the options have to precede the pattern
ugexe i just copied your code
if i run `locate filethatdoesntexist` it doesnt output anything 14:22
tbrowder i’m writing a test for a module to see if the locate command is installed
ugexe ok, but what do you expect it to output when a file is not found?
you seem to be expecting something, whereas from what i see from using the locate command directly i would expect no output 14:23
i also get exit code 0 when the file does not exist
tbrowder nothing i assume. maybe i’m running “run” improperly
ugexe i think you're using locate wrong 14:24
$ locate asdfasdf
$ echo $?
0
no output, exit code 0
tbrowder ok, let me give it another try…
ugexe -q is not going to work on macos (and thus probably bsd in general) 14:27
14:36 jpn joined 14:40 Xliff joined
Xliff \o 14:40
How difficult would it be to bundle rakudo into a shared library? 14:41
antononcube @tbrowder "you giving any public presentos this year?" -- Yes, I have a scheduled talk next month in Miami. (Titled "Robust LLM pipelines.") 14:54
tbrowder ugexe: thnx for the help. it’s working correctly now. a cpl of things: i wasn’t slurping :out, just reading .lines before closing (not sure that makes a diff). this time i only read :out and ignored :err. i checked exitcode both times: got 0 when file found, 1 when file not found. i was using :err when exit code was 1.
antononcube: gonna be broadcast, or put on youtube? 14:55
Xliff Would it work something like this? A new shared library is created that bundles all of the .moarvm files into blobs. The entry point into moar is... from my filesystem is /home/cbwood/Projects/rakudo/install/bin/moar. We take the essentials of bin/moar and convert that into a loader that takes in index of the .moarvm bundle and converts them into offsets. These offsets are then used instead of filenames. 14:56
antononcube @tbrowder Yes, it should end up in YouTube. That presentation is done through a meetup, I assume they going to record it. If they done I will do a recording anyway. 14:57
@tbrowder Thank you for your interest! Here is the extended abstract of the presentation: github.com/antononcube/RakuForPred...gineers.md 15:01
The fifth technique listed there (i.e. point 5), "Filtering of multiple outputs", is actually about using grammars. I plan to replace it with "Using Grammar-LLM chain of responsibility." 15:03
patrickb Xliff: re rakudo shared lib, look at github.com/rakudo/rakudo/blob/main...ner/main.c 15:39
Just compile that to a lib instead of exec and you're done. 15:40
inline::perl6/5 does the same. You'll find a very similar source file in it's repo. 15:41
Both are adaptions of the github.com/MoarVM/MoarVM/blob/main/src/main.c 15:42
Xliff patrickb: Excellent! Thanks for the first part. That's MoarVM as a shared lib. Now we need to get NQP and Rakudo in there somehow. The fact that they will be inside of a BLOB is the tricky part, but it looks like that's the file to handle that in. 15:47
15:53 jpn left
Xliff Another idea...: sub a ($a, $b, $c, ...) { $*EXTRA.head # first arg in ... } -- Would people be interested in this? Could we get it in 6.e or 6.f? 16:13
Meanwhile... directly related to my previous topic... gist.github.com/Xliff/563246e22ea8...e58051e79f 16:18
16:32 silug left 16:46 Sgeo joined 17:02 silug joined
Xliff m: role T[Str $s] { method t { $s.say } }; class A does T["meh"] { }; say A does T; say A does T[Str] 17:06
camelia Cannot use 'does' operator on a type object A.
in block <unit> at <tmp> line 1
Xliff m: role T[Str $s] { method t { $s.say } }; class A does T["meh"] { }; say A ~~ T; say A ~~ T[Str]
camelia True
True
tbrowder ugexe: my problem was not closing the slurp on the :err pipe. thnx so much for reminding me 17:10
SmokeMachine Hi! From inside Attribute's container_initializer and auto_viv_container, is there a way to get the actual object I'm creating to be able to pass it to build()/build_closure()? 17:35
I mean, I was able to make it work with default values using auto_viv_container... usercontent.irccloud-cdn.com/file/.../image.png 17:39
but it won't work if I try to use a attribute value inside of it... I supose that's like that because I'm passing Attribute's package to it instead of the actual object... but I can't find a way to get the object... does anyone know how I could do that? usercontent.irccloud-cdn.com/file/.../image.png 17:41
I’ve been reading rakudo code, but I couldn’t find where build is called to be able to copy how it’s done… I found where it’s created… but not where it’s called… 17:46
lizmat perhaps a --ll-exception stack trace is more informative 17:47
SmokeMachine I don't quite understand that output... :( 17:50
lizmat can you gist it somewhere as text? 17:53
SmokeMachine I tried something like this: raku --ll-exception -e 'class C { has $.a = $!wrong }; say C.new' but it pointed out to grammar...
adding that on that code before pointed to my code... 17:54
let me show you...
www.irccloud.com/pastebin/FsMukK39/ 17:55
17:56 soverysour joined
SmokeMachine this is my current Attribute class... www.irccloud.com/pastebin/rdy0pAZX/ 17:57
lizmat hmmm that stack trace is from 2024.05, can't be sure the location in World.nqp is correct for 2024.06
I guess rakubrew hasn't been updated yet? 17:58
SmokeMachine I'm building 2024.06 to run again 17:59
Also, I don't know what should be the 2nd parameter to build... I'm passing anything... but I don't know what should be passed... 18:02
[Coke] rakubrew build moar 2024.06 18:04
SmokeMachine oh, sorry... no I mean Attribute's build... the method... not rakubrew... 18:05
I mean this, the `$build.($.package, 1)`... the 1, I don't know what that should be... www.irccloud.com/pastebin/FEDjiH1x/ 18:08
lizmat: with 2024.06 www.irccloud.com/pastebin/zwmDcr54/ 18:09
lizmat ok, same line number in World...and that's just a call there... 18:12
so it's somewhere deep in the bowels :-( 18:13
sorry, I'm currently not in that headspace :-( 18:15
SmokeMachine if I understand this correctly (github.com/rakudo/rakudo/blob/7190...p#L64-L66) the auto_viv_container is run on compose... so it will not have access to the obj itself... :( 18:17
lizmat: thanks
np
I think my real problem is to find out how usual code avoid this: github.com/rakudo/rakudo/blob/7190...#L148-L150 18:39
18:42 synthmeat left 18:43 synthmeat joined
SmokeMachine I suppose usual Attribute does not have container_initializer? 18:45
guifa is currently trying to find a way to muck with a cursor's .orig / .target 18:53
it's.... not as easy as I'd've thought
18:54 silug left, silug joined
lizmat has just found a JIT issue :-( 18:54
github.com/MoarVM/MoarVM/issues/1817
19:01 soverysour left
patrickb rakubrew/rakudo.org builds are in progress. 19:25
files are available 19:40
jdv lizmat: nice 19:51
Xliff lizmat! Did you see my questions above? What do you think of the possibility? 20:05
20:48 gabiruh_ left 20:49 gabiruh joined
lizmat Xliff: isn't that what the GSOC project of pamplemousse was about a few years ago ? 20:50
Xliff I think so. I don't know how far she got, or what limitations she had. 20:54
Maybe I'll see if I can grab a copy of what she did and check.
pamplemousse's was more about making Raku executables. Mine is more about making Rakudo something reusable. 20:55
My ultimate plans revolve around making Rakudo a drop-in addition to things like PL/SQL... or anywhere you might use LUA
antononcube Always, there are some lurking Lua likers. 20:57
lizmat Xliff: perhaps your approach is different. But in the end, you'd want something (directly) executable, no? 20:59
which could be an very thin layer around a shared lib
afk again& 21:10
patrickb I think one part that is salvageable of pamplemousses work is a change that allows running byte code directly. (I.e. allows recompiling the top level script). it's a rather small change actually. 21:11
*precompiling
21:13 fulkunber34 joined 21:14 fulkunber34 left
Xliff patrickb: Actually, you'd still need to write a loader for that. 21:35
lizmat: Actually, no. You'd just link to a shared lib and pass the script as a string to some entry point. 21:36
SmokeMachine Does anyone have any idea on where I can find an explanation (or the code itself) for nqp::p6attrinited? 21:55
I think I found it: github.com/rakudo/rakudo/blob/main...#L976-L995 21:58
I think I finally found where build is called... github.com/rakudo/rakudo/blob/7190...3832-L3836 22:13
but it didn't help... because it only runs if nqp::p6attrinited returns 0... and I can't find a way to make that return 0... :( 22:16
what mean that an attribute was initialized? 22:18
tbrowder can any mac user tell me the mac equivalent for linux system’s “locate” which is used to find patterns in the file system paths? ugexe said his mac has locate, so how do i install it on .github/workflows? 22:19
guifa locate exists on my mac 22:26
didn't need to install it afaict
tbrowder maybe “myfind -literal”? 22:27
lizmat rak foo / --find 22:32
22:41 sena_kun left
[Coke] /usr/bin/locate exists on my mac 23:57
I have never used it. 23:58
(and it requires some kind of setup I've never run)