01:33
Manifest0 left
02:10
kwolcott joined
|
|||
kwolcott | Newbie here | 02:11 | |
Been learning/using Raku by exploring Rosetta Code. | |||
I use MacPorts (obviously I'm on MacOS) | 02:12 | ||
antononcube | To Raku or programming in general? | ||
kwolcott | I've installed the Primesieve Library. | ||
But I am unable to install the Raku Primesieve module even though I was able to install the Perl Primesieve module. | 02:13 | ||
antononcube | Consider using rakubrew: rakubrew.org | ||
kwolcott | I'm (re)learning Ada, learning Julia, (re)learning Perl, learning Raku, almost everything that I can do on my Mac that is open-source. | 02:14 | |
yes, I tried that once, perhaps I screwed it up :-) | 02:15 | ||
I have a Raku from MacPorts and one that I installed from source. | |||
antononcube | Installed from source!! | ||
kwolcott | When using zef to install Raku packages, how does it know where to install them? I can specify with cpanm when using Perl. | 02:16 | |
antononcube | I kind of know that for rakubrew… But I think this question has been asked before. | 02:18 | |
I.e, search IRC’s logs. | 02:19 | ||
The creator / maintainer of zef @ugexe frequently is seen here, so might answer. | 02:20 | ||
kwolcott | my Mac is using arm, not Intel/AMD, and I do not want Intel/ARM (or hybrid/universal) on the Mac, so I'll try the manual install and try going for the shell approach rather than the shim approach. Learning as I go here :-) | ||
antononcube | Hmmm… do you think it is faster ? | 02:21 | |
I mean, Raku installed from sources on arm. | 02:22 | ||
I am not sure why would anyone learn Ada. Julia is worth knowing, but if one knows or uses R or Mathematica, Julia is (much) less interesting or needed. | 02:24 | ||
kwolcott | Well, I started with BASIC, then Pascal, then C, then Ada (that was in college). Then I used Perl. I've always wanted to re-learn Ada and I'm getting better at it now. I'm also expermining with Maxima and Octave, as well as R. I don't have Mathematica. | 02:27 | |
Where is zef under rakubrew? | 02:28 | ||
I tried ~/rakubrew build-zef which fails because it is trying to install zef where my raku is that I built from source; I'd like to have a zef based on the rakubrew. | 02:36 | ||
I tried rakubrew available, how do I choose MoarVM? The most recent Raku version will be fine. I guess I can't build zef until I have a local Raku installed under rakubrew :-) | 02:38 | ||
ok, building a Mac raku for arm using rakubrew now... | 02:45 | ||
02:48
kylese left,
kylese joined
02:55
leah2 left
|
|||
kwolcott | So, how do I tell zef where to look for the Primesieve Library? zef help spews out lots of info, not grokking it (yet) | 02:55 | |
ab5tract | Why does anyone learn anything? Ada is a great language | 03:05 | |
kwolcott: so did you install `Math::Primesieve`? (raku.land/github:CurtTilmes/Math::Primesieve) | 03:07 | ||
you can configure where zef installs to by using either `--install-to` or via the env var `ZEF_INSTALL_TO` | 03:08 | ||
I recommend using `rakubrew` with defaults | 03:10 | ||
03:15
kylese left,
kylese joined
|
|||
kwolcott | not able to install it, zef complains about not being able to find the library; but cpanm had no problem finding it. | 03:19 | |
ab5tract | ah, I see | 03:20 | |
did you install `primesieve` via brew? | |||
kwolcott | no, I use MacPorts, not brew | 03:21 | |
ab5tract | ah, ok. I think it's the same issue either way | ||
if it's what I think it is, it is related to mac security settings for loading shared libraries | 03:22 | ||
which makes the successful installation of perl's version interesting to note | |||
kwolcott | MacPorts installs stuff under /opt/local | ||
ab5tract | does the perl module work as expected in addition to installing successfully? | 03:23 | |
kwolcott | brief testing of the Perl Priemesieve module was successful, yes. | 03:24 | |
ab5tract | ok thanks for confirming that | 03:33 | |
I have a feeling that the problem is related to what this module is designed to solve: raku.land/zef:lizmat/MacOS::NativeLib | |||
however I'm not getting it to work that way either :/ | 03:34 | ||
03:37
guifa joined
|
|||
ab5tract | ah! I found the problem | 03:41 | |
the version of primesieve installed by brew is 12 | |||
but `Math::Primesieve` is looking for versions v7, v8, and v9 | 03:42 | ||
kwolcott | ah but what version of Primesieve do I have from MacPorts? Looking... | ||
port installed | grep primes | 03:43 | ||
primesieve @12.4_0 (active) | |||
ab5tract | it seems weird to require a hardcoded list of versions for module loading | 03:45 | |
but I've never used the `NativeLibs` module that this code relies on | 03:46 | ||
so, the fastest option to install is `git clone github.com/CurtTilmes/raku-primesieve.git` and adding `v12` to the for loop on line 7 | |||
then `zef install .` | |||
kwolcott | ok, thanks for the debugging and hints; will try later tonight. | 03:48 | |
ab5tract | this is a more comprehensive solution (especially in case there is still an issue with the the macOS library loading) gist.github.com/ab5tract/8aad1605a...594c1cf58b | 03:52 | |
kwolcott: it bothered me enough to clone and fix here : github.com/ab5tract/raku-primesieve | 03:57 | ||
it's not in the ecosystem yet though, so you will need to clone and do a `zef install .` | |||
happy hacking! | |||
04:06
kwolcott left
04:16
Xliff left
04:54
japhb joined
05:08
japhb left
05:10
japhb joined
05:12
zara left
05:28
leah2 joined
06:01
Aedil joined
08:06
japhb left
08:07
zara joined
08:10
japhb joined
08:11
Sgeo left
08:17
zara left
08:25
leah2 left
08:41
leah2 joined
08:47
sena_kun joined
08:48
zara joined
|
|||
SmokeMachine | m: 42.say: "!!!" # LTA Error message? | 08:55 | |
camelia | Cannot resolve caller print(Int:D: BOOTStr); none of these signatures matches: (Mu $:: *%_) in block <unit> at <tmp> line 1 |
||
SmokeMachine | why is that giving a print error? | ||
and shouldn't that work? `say 42, "!!!"`, shouldn't `42.say: "!!!"` also work? | 08:56 | ||
m: say 42, "!!!" | 08:57 | ||
camelia | 42!!! | ||
SmokeMachine | must be related to this: github.com/rakudo/rakudo/blob/dc03...#L843-L845 | 09:05 | |
m: augment class Cool { method say(**@args) is default {say self, |@args} }; 42.say: "!!!" # would something like this make sense? | 09:19 | ||
camelia | 42!!! | ||
09:25
Manifest0 joined
|
|||
timo | SmokeMachine: i think 42.say: "!!!" should not work like say 42, "!!!" | 09:42 | |
SmokeMachine | timo: that's ok, I think... but the error should be better, no? | 09:46 | |
timo | you mean because your code calls say and it's complaining about print? | 09:47 | |
and/or because BOOTStr is an odd detail | 09:48 | ||
SmokeMachine | yes, because a call on "say" errs print... | 09:58 | |
BOOTStr also doesn't help... :) | |||
timo | right, i'm not sure if we have anything for when one call mostly defers to something else, where we could have put the original thing in the error message. i guess a stack trace is kinda that haha | 10:01 | |
10:12
sena_kun left
|
|||
timo | maybe there should be a method more like AT-POS / BIND-POS for the purpose of outputting, that you can manually override instead of having to know you must pick "print" if you don't want to override print, put, as well as say | 10:30 | |
but also i'm still not very happy about .say meaning "the invocant is a file handle and you want to output something into it" and "the invocant is an object that you want to output to $*OUT", but i can understand why it exists, and i don't have a good suggestion how to change it | 10:31 | ||
SmokeMachine | why can't classes where .say will use self as the "where" to implement their own .say? speed wise or something like that? | 10:35 | |
lizmat | m: class A { method print(|c) { say "42" } }; A.say | 11:15 | |
camelia | 42 |
||
lizmat | m: class A { method print(|c) { say "42" } }; A.say("foo") | ||
camelia | 42 | ||
lizmat | m: class A { method print(|c) { dd c; say "42" } }; A.say("foo") | 11:16 | |
camelia | \("foo\n") 42 |
||
timo | can you rephrase that sentence? i'm not parsing it correctly | 11:28 | |
lizmat | Mu.say and Mu.put will call Mu.print | 11:36 | |
so that a class would only need to provide a .print method | 11:37 | ||
m: class A { method print(|c) { dd c; say "42" } }; A.say("foo") | |||
camelia | \("foo\n") 42 |
||
lizmat | ^^^ | ||
SmokeMachine: re "why can't classes where .say will use self as the "where" to implement their own .say? speed wise or something like that?" | 11:40 | ||
m: class A { method say(|c) { dd c; say "my own say" } }; A.say("foo") | |||
camelia | \("foo") my own say |
||
lizmat | m: class A { method say(|c) { dd c; say "my own say" } }; say A | 11:41 | |
camelia | (A) | ||
lizmat | m: class A { method say(|c) { dd c; say "my own say" } }; A.say | ||
camelia | \() my own say |
||
lizmat | hmmmm | ||
SmokeMachine | but it also "prepares" say for cases like when calling it on file handles... couldn't them have theres own say? | 11:43 | |
I mean this: github.com/rakudo/rakudo/blob/dc03...#L859-L868 | 11:44 | ||
lizmat | I'm still not following what you mean *exactly* | ||
SmokeMachine | I mean, why not, instead of this: github.com/rakudo/rakudo/blob/dc03...#L843-L852 don't, we have a role with that that (for example) IO::Handle would "does"()? | 12:00 | |
(but of course I may be misunderstanding everything) | 12:01 | ||
lizmat | and then remove the code that you just highlighted ? | 12:02 | |
pretty sure that would have ecosystem fallout | |||
SmokeMachine | my question was more about the reason that was made that way, not a request for changing... | 12:25 | |
lizmat | the reason was that if a class would like to provide its own output methods | 12:31 | |
it would only need to provide a .print method | |||
and .put and .say would automatically be supported as well, with the expected semantics | 12:32 | ||
I'm not sure adding a Cool.print method would make sense to prevent the error that you saw | 12:33 | ||
the BootStr in that error is caused by nqp::concat, which is an optimization for infix ~ | |||
timo | nqp::concat and nqp::join and such "just" return a native str, what it's boxed to when being passed would be a choice of whatever dispatcher it goes through on the call path i think? maybe the dispatcher is hllizing / autoboxing the native string without the right type object from the raku hll, or maybe only the error reporting path doesn't know or something else | 12:38 | |
SmokeMachine | thanks | 12:48 | |
lizmat | and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/11/11/2024-...ternaries/ | 13:32 | |
SmokeMachine | Odd... I released ASTQuery yesterday and it is not listed at raku.land... | 13:42 | |
lizmat | SmokeMachine: the REA harvester didn't see it either, so I guess the upload didn't work ? | 13:45 | |
SmokeMachine | I didn't see any error (I may have missed...). I'll try to pay more attention on the next release... | 13:46 | |
I think I'm also going to release this module: usercontent.irccloud-cdn.com/file/.../image.png | 14:21 | ||
El_Che | SmokeMachine: add mofo before the exclamation marks :) | 14:34 | |
SmokeMachine | mofo? | 14:35 | |
El_Che | SmokeMachine: short for mother f* | 14:36 | |
something that people say when they overreact :) | |||
SmokeMachine | :) I like it! | ||
El_Che | you need a switch for profanity :) | 14:37 | |
SmokeMachine | There is a alias on that that only brazilians will understand... :) | 14:38 | |
because that function can accept an argument... usually $*CU, and that has a very distinctive meaning in portuguese... | 14:39 | ||
librasteve | SmokeMachine: I usually go zef install My::Module --force-install immediately after a fez upload ... then sense check the the new version made it. Why? Well the fez upload works instantly to the zef repo - then the raku.land indexer will take a while to pick it up - but you know it's on the road. | 14:41 | |
SmokeMachine | and in brazilian portuguese we say that when someone is overreacting they are with "fogo no <bad word>"... | ||
librasteve: thanks for the suggestion! I'll try that next time | 14:42 | ||
librasteve | yw | 14:50 | |
15:18
japhb left
|
|||
tbrowder | howdy. this morning i was thinking about a modules i’m working on and i will need to add test files to check wrappers for system commands—ugh. | 15:55 | |
imho, we need a version of Raku’s built-in lives/dies test that auto-uses “run” and just tests the error code | 15:58 | ||
without any special setup by the use | 15:59 | ||
*user | |||
unless i get a definite “not feasible” or “no” i will file an issue | 16:00 | ||
[Coke] | Would a module that did that be acceptable?\ | 16:05 | |
That seems like an easy module to implement. | |||
16:24
kjp left
16:25
guifa left,
kjp joined
16:32
tejr left
16:34
tejr joined
|
|||
lizmat | weekly: dev.to/lizmat/a-path-to-paths-21b5 | 16:47 | |
notable6 | lizmat, Noted! (weekly) | ||
16:52
orangebot joined
|
|||
lizmat | tbrowder: t/packages/Test-Helpers/lib/Test/Helpers.rakumod might be a good source of inspirationm | 16:56 | |
16:59
manu_ joined
17:01
eseyman left,
manu_ is now known as eseyman
17:07
guifa joined
17:10
japhb joined
|
|||
ab5tract | I don't understand our reticence to expose clearly usable and working implementations that already exist in core with the world | 17:16 | |
lizmat | ab5tract: fwiw, I don't either | 17:22 | |
ab5tract | glad I'm not the only one! | 17:25 | |
antononcube | @lizmat Is there an easy way to get the individual directory names of paths? I.e. using "IO:Paths" metho .parts that gives a list of the (sub-)directories and basename. | 17:31 | |
Of course, I can split the directory path string with "/" (or similar) but maybe there is a more direct way. | |||
guifa | ab5tract : the ENTER wouldn't work, because it'd be before the object itself existed. You could probably move it to BUILD to beat the TWEAK, but then you're back to the problem of what if they override BUILD | 17:35 | |
17:39
japhb left
|
|||
guifa | I guess if COMPOSE were to get implemented it could catch that kind of thing | 17:39 | |
ab5tract | antononcube: what's IO::Path.parts not doing for you? | 17:42 | |
paths(".").map({ $_ => IO::Path.new($_).parts }) | 17:44 | ||
maybe I didn't understand correctly | |||
guifa: ah, yeah makes sense. It would have been cool if it worked symmetrically like that, but at least your approach does the trick! | 17:45 | ||
I wonder if/what is a good location for this in the docs... | |||
17:46
japhb joined
|
|||
guifa | I'm actually taking advance of Raku's async and it's really easy | 17:46 | |
basically my project ingests an article, and then has several modules that all need to run, some are not processor intensive and can be done simultaneously, others are (because launching multiple LLMs would fry my machine) and need to be loaded one at atime. Meanwhile, want to give status updates for which ones are awaiting start, in progress, and finished. And it's really surprisingly few lines of code to get all that logic | 17:47 | ||
ab5tract | that sounds really awesome | 17:48 | |
antononcube | @ab5tract I want to get from the directory "/p/h/alf/" the list <p h alf>. I can do that with string splitting, but I was hoping for some unknown to me option to speedup that. | 17:51 | |
Or for the package "paths" (by @lizmat) to have some sort of related functionality. | |||
lizmat | .say for paths>>.split("/") | 17:54 | |
antononcube | Right, of course. | 17:55 | |
18:06
leah2 left
18:10
leah2 joined
|
|||
ab5tract | Isn't that roughly equivalent to: paths(".").map({ $_ => IO::Path.new($_).parts }) | 18:10 | |
without using the original path as the key | 18:11 | ||
lizmat | pretty much, but the paths>>.split("/") bypasses the creation of the IO::Path object completely | 18:12 | |
ab5tract | right, but in a non-portable manner | ||
anyway, just wanted to make sure I wasn't as confused as I feared I was | 18:13 | ||
lizmat | fwiw, I think on Windows paths are also reported with "/" instead of "\" nowadays | 18:18 | |
sadly I haz no way to test, other than starting some stupid CI job :-) | 18:19 | ||
18:27
japhb left
|
|||
ugexe | i dont think one can assume they can just split on / | 18:30 | |
to show that in a CI you'd have to already know in which scenarios that is relevant | |||
otherwise it is trivial to show examples where it is fine | 18:32 | ||
ab5tract missed the part where antononcube mentioned wanting a speedup, so splitting is probably the best option in that case | 18:34 | ||
ugexe | i'd suggest saving yourself the trouble and using $*SPEC.splitdir("/p/h/alf") | 18:35 | |
antononcube | đź‘Ť | ||
ugexe | as for an example of when it is relevant: windows long paths don't work with / as they bypass the internal windows api that otherwise does that conversion | 18:37 | |
dont forget that windows paths often contain a volume e.g. C:\ when splutting | 18:39 | ||
18:40
sena_kun joined
|
|||
antononcube | @ugexe Right, that is why I was asking for a more bureaucratic way of get the file parts than using split. | 19:14 | |
lizmat didn't realize that antononcube was of the windows persuasion :-) | 19:17 | ||
19:27
guifa left
19:33
japhb joined
19:35
Aedil left
19:36
abraxxa-home joined
|
|||
antononcube | 🤣 | 19:44 | |
tbrowder | antononcube: i hear you’re a heavy Raku and Windows user. the chocolatey packager folks could sure use your talents! | 20:00 | |
antononcube | @tbrowder My talents a graphed for now... | 20:04 | |
Or sparsed... | 20:06 | ||
20:30
guifa joined
20:33
Guest64 joined
21:11
zetaaaa joined
21:16
Guest64 left
22:01
Geth left
22:06
orangebot left
|
|||
tbrowder | lizmat: ref “inspiration” did you mean for a PR for core Raku or my own tests? | 22:53 | |
22:54
abraxxa-home left
22:57
Geth joined
|
|||
lizmat | your own tests | 22:59 | |
tbrowder | ok | 23:10 | |
no interest in possible raku core use? | 23:11 | ||
23:13
sena_kun left
23:44
yewscion joined
23:54
yewscion left
23:57
Sgeo joined
|