29 Oct 2024 |
antononcube |
Are there any unforeseen side effects by overloading + and * ? For example, slowing down the normal operation on scalars? |
14:22 |
|
|
[Coke] remembers he can run the mersenne prime search on this laptop and not notice. |
14:31 |
|
lizmat |
if you export them, it should only affect code in that lexical scope |
14:38 |
|
[Coke] |
(mersenne prime search) any interest in a raku team? |
14:39 |
|
antononcube |
@Coke I am very interested in "Mersenne Twister", and being able to get the same random numbers from it in different Raku sessions. |
14:41 |
|
|
@lizmat Yeah, ok. |
|
|
|
More generally, is there an easy way to get random number generation reproducible across different sessions? I have asked that before. It is very inconvenient to make math tests without reproducible random numbers sequences. |
14:44 |
|
|
I mean, "system level" random generation, for srand, pick, roll, etc. |
14:45 |
|
lizmat |
there's an open issue about it |
|
|
|
the problem is, is that the same random generator is used for creating hash keys *and* producing random numbers |
14:46 |
|
|
and because of spesh, which runs code whenever it wants to / can (which may create hashes and keys), there's no guarantee that you'll be able to get into the sequence of random numbers that the generator generates at the same location |
14:48 |
|
|
antononcube perhaps raku.land/zef:raku-community-modul...th::Random is what you need ? |
14:49 |
|
antononcube |
Ok. This means using alternative random number generation like "Math::Random". |
14:50 |
|
lizmat |
yes, if you want truly repeatable sequences |
|
|
antononcube |
@lizmat I was/am just looking into that package. |
|
|
|
I will try out that package soon... |
14:52 |
|
lizmat |
antononcube should you find issues, PRs are welcome as it is a community module |
14:53 |
|
|
and we always need caretakers for those :-) |
|
|
nahita3882 |
lizmat can you explain what "spesh" is? |
|
|
lizmat |
nahita3882 check out 6guts.wordpress.com/2017/08/06/moa...ring-data/ and follow up blog posts |
14:55 |
|
nahita3882 |
thank you |
14:56 |
|
antononcube |
@lizmat A follow-up question— is it a good idea to overload pick and roll to use “Math::Random” if given a certain adverb? Like, (^100).pick(10):mt. |
15:09 |
|
librasteve |
@antononcube - I think that the world will thank you if you can follow the Math::Matrix API (or a subset of it, perhaps with coercers). That overloads + for add scalar only (ie add same rhs to all matrix elems) and * multiply scalar only and . for dot product among a few others. raku.land/github:pierre-vigier/Mat...ply-scalar |
17:22 |
|
ab5tract |
antononcube: that sounds reasonable to me. |
17:23 |
|
|
I might suggest going even more extreme and augmenting the core class methods |
17:24 |
|
|
Perhaps based on an import flag (:augment-core) or the like |
17:25 |
|
antononcube |
@ab5tract I will consider/try that. |
17:27 |
|
|
@librasteve I have used "Math::Matrix", but did know or noticed that it overload the +, * and . . I am surprised about the last one, to be honest, since "dotty infix" is somewhat of a special case and with a certain mind-share. |
17:30 |
|
|
And I was also considering dot as an infix operator... 🙂 |
17:32 |
|
|
@librasteve Actually, after examining "Math::Matrix" README section "Operators" it seems "Math::SparseMatrix" is in agreement with it. (So far.) |
17:34 |
|
librasteve |
cool - I would say very handy to have coercers (both ways) too ;-) |
18:08 |
|
antononcube |
I prefer those kind of packages to be (very) decoupled. At this point, "Math::SparseMatrix" objects can be turned into "Math::Matrix" objects by using the .Array method. I.e. Math::Matrix.new($smat.Array). |
18:43 |
|
|
Should work the other way too. |
18:44 |
|
Xliff |
\o |
19:17 |
|
antononcube |
(⌐■_■) |
19:30 |
|
Xliff |
Anyone have any cool RakuAST examples, yet? |
19:32 |
|
lizmat |
github.com/rakudo/rakudo/blob/main...er.rakumod |
19:33 |
|
|
Buddy! media.hachyderm.io/media_attachmen...2e4e97.jpg |
19:35 |
|
|
oops ww |
|
|
librasteve |
lol |
19:40 |
|
|
is our sub another way to say sub blah is export? |
|
|
|
oh yeah - opposite of my class {} |
19:41 |
|
|
@antononcube ... please envision a world where consumer of your module want to do something with a Matrix ... with a coercer, they can say something like `multi(Math::Matrix() $m) { ... } and that'll be able to take both a random and a sparse regardless ... |
19:44 |
|
Xliff |
lizmat: Nice dog... |
|
|
librasteve |
dog++ |
19:59 |
|
antononcube |
I think “Math::Matrix” is fairly heavy package, which has not been developed lately. I would make an “optional” dependency on it — if it is installed, some of the “Math::SparseMatrix” methods can use it. |
20:10 |
|
librasteve |
i agree ... it's too intese for my taste |
20:11 |
|
|
intense |
|
|
antononcube |
I was considering to implement named rows and columns for “Math::Matrix” — this a way look into that package, but now that is of a much lesser priority. |
20:19 |
|
|
How easy it is to automatically create web apps similar to the user interface if of chatgpt.com ? Basically, a few selections have to be done: (i) service provided, (ii) LLM model, (iii) temperature, (iv) prompt, and have a "main panel" for the chat with LLM. |
20:44 |
|
|
Ideally, this web apps are created / generated via CLI with minimal setups. For example, just giving a prompt and/or LLM access configuration. |
20:46 |
|
SmokeMachine |
.tell Xliff I think this a simple, yet cool example: usercontent.irccloud-cdn.com/file/.../image.png |
21:22 |
|
tellable6 |
SmokeMachine, I'll pass your message to Xliff |
|
|