🦋 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.
00:00 reportable6 left 00:01 reportable6 joined
tbrowder__ data frame sounds like common Raku implementions of CSV files and sql tables 00:08
00:09 jpn left 00:13 tejr left 00:26 coleman left, coleman joined
antononcube I would say that those correspond to Raku datasets, which are row oriented (e.g. a Positional of Maps). Data frames are column oriented, can be seen as transposed datasets, (e.g. a Map of Positionals.) 00:30
00:31 tejr joined 00:43 kst left
tbrowder__ well, look at raku vesions for both csv and sql implementations and one can look at rows or colums as hash or arrays 00:49
00:54 kst joined 01:10 ecocode left, ecocode joined
antononcube Yeah, sure. My point is that data frames are less natural to integrate with Raku, than datasets. For example, "Text::CSV" produces datasets. (At least by default.) 01:32
01:34 _________ left 01:37 deoac joined 01:39 wayland76 joined, wayland left 01:52 jpn joined 01:56 jpn left
guifa_ grr 02:07
m: my token foo { .* }; say 'abc' ~~ /<foo>/ 02:08
camelia 「abc」
foo => 「abc」
guifa_ m: my method foo { self.orig.match: /.*/ }; say 'abc' ~~ /<foo>/ 02:09
camelia No such method 'foo' for invocant of type 'Match'
in block <unit> at <tmp> line 1
guifa_ m: my sub bar { /.*/ }; my token foo { <{bar}> }; say 'abc' ~~ /<foo>/ 02:10
camelia 「abc」
foo => 「abc」
guifa_ m: my sub bar (\self) { say self; /.*/ }; my token foo { <{bar self}> }; say 'abc' ~~ /<foo>/ 02:12
camelia ===SORRY!=== Error while compiling <tmp>
'self' used where no object is available
at <tmp>:1
------> my sub bar (\self) { say ⏏self; /.*/ }; my token foo { <{bar self}
expecting any of:
argument list
term
guifa_ ^^ that feels like an error, if someone defines the var self, there is a self 02:13
golfed 02:18
m: my \self = 42; say self
camelia ===SORRY!=== Error while compiling <tmp>
'self' used where no object is available
at <tmp>:1
------> my \self = 42; say ⏏self
expecting any of:
argument list
term
02:48 jpn joined 02:52 jpn left 03:08 deoac left 03:13 guifa_ left 03:35 mst left 03:36 mst joined
nemokosch this seems familiar somehow 04:07
04:11 esh left, esh joined 04:12 razetime joined 05:04 _________ joined 05:27 amano joined
amano . 05:28
05:28 siavash joined 05:29 amano left 05:34 siavash left 05:44 MoC joined 05:52 siavash joined 06:00 reportable6 left 06:02 reportable6 joined 07:02 benchable6 left, committable6 left, reportable6 left, bisectable6 left, statisfiable6 left, bloatable6 left, squashable6 left, linkable6 left, releasable6 left, nativecallable6 left, unicodable6 left, quotable6 left, greppable6 left, tellable6 left, notable6 left, evalable6 left, sourceable6 left, shareable6 left 07:03 reportable6 joined, committable6 joined, benchable6 joined, statisfiable6 joined 07:04 notable6 joined, shareable6 joined, squashable6 joined, nativecallable6 joined, tellable6 joined 07:05 bisectable6 joined, unicodable6 joined, sourceable6 joined, greppable6 joined, quotable6 joined, evalable6 joined, releasable6 joined, bloatable6 joined 07:06 linkable6 joined 07:29 siavash left 08:01 jpn joined 08:05 eseyman left 08:06 manu_ joined 08:26 zups left, zups joined 08:38 lizmat_ left, jpn left, lizmat joined 08:39 teatwo left, teatwo joined, jpn joined 08:59 jpn left 09:00 Sgeo left 09:01 sena_kun joined 09:39 MoC left 09:59 jpn joined 10:03 jpn left 10:06 ab5tract joined 10:28 phogg left, phogg joined
tbrowder__ antononcube: i'm glad you're on the raku bandwagon! 10:51
which of the raku sql packages do you use? 11:05
11:28 linkable6 left, evalable6 left 11:29 linkable6 joined, evalable6 joined 11:44 razetime left 11:50 razetime joined 12:00 reportable6 left 12:02 reportable6 joined 12:28 jpn joined 12:54 razetime left 13:06 squashable6 left 13:07 squashable6 joined
antononcube Thanks! 13:09
I never succeeded installing any of the dedicated Raku database packages. I am trying to generate SQL code with my data wrangling DSL package. Recently, instead programming the generation “from scratch”, I switched to using “SQL::Builder” to do the generation. (I have not finished that yet.) 13:13
13:21 jpn left
guifa antononcube: you'll be happy to know I'm currently reworking Intl::Token::Number 13:21
Not going to promise it, but I think today I'll have it done 13:22
leont antoncube: you may also find SQL::Abstract interesting 13:29
13:42 tonyo left, tonyo joined 13:48 jpn joined 13:51 guifa_ joined 13:52 jpn left
antononcube @guifa Good news! 🙂 I don't care if takes you the whole long weekend... 14:06
@leont I think at some point I looked at / in "SQL::Abstract" -- will do that again today.
14:12 razetime joined
@leont Hmm... It seems that in "SQL::Abstract" the operations are too "packed", meaning, they combine functionalities. Not a criticism, BTW, just an observation -- in some sense SQL's idea of constructing expressions forces package designers to take that approach. 14:16
To some extend that is why I consider (started) using "SQL::Builder" -- it provides a sequential query building interface that is very close to the monadic workflow I use "DSL::English::DataQueryWorkflows". 14:18
Basically, the author @avuserow has done the "heavy lifting" for me already. 14:19
avuserow Btw, I can't remember where I left off on that module. If you have any questions or PRs, send me a ping and I'll try to answer 14:23
leont I think I get what you mean with packed, but internally it's the only thing that makes sense really given how SQL works. 14:42
14:42 jpn joined
leont I have needed such a wrapper at least once though, so maybe I should write it 14:44
14:47 jpn left
antononcube @leont In principle, I can make DSL translators to or via different SQL packages. The select statement in "SQL::Abstract" is the very similar to Mathematica's GroubBy , which I target / use in my DSL translations. 14:53
14:54 jgaz joined 15:27 MoC joined 15:46 bdju left 15:53 bdju joined 15:56 mycroft2032 joined 15:57 mycroft2032 left 16:00 MoC left 16:07 razetime left 16:30 jpn joined 16:35 jpn left 16:36 jgaz left 17:25 jpn joined 17:30 jpn left 18:00 leah2 left, reportable6 left, reportable6 joined 18:35 leah2 joined 18:38 guifa_ left 18:39 guifa_ joined 19:03 Sgeo joined 19:56 jpn joined 20:20 tea3po joined 20:21 tea3po left, tea3po joined 20:22 tea3po left, jpn left 20:23 tea3po joined, teatwo left 20:28 xelxebar left 20:29 xelxebar joined
guifa God bless dwarring 20:41
I just had to scan a ton of two sided docs with a single sided scanner
with PDF::Lite, in only a dozen lines of code (that could totally be golfed into like three), I managed to write a script to completely rearrange the pages so I can just scan front side from page 1 .. N, and then turn around and do back side N to 1, run the script and boom 20:42
antononcube @guifa I am not sure how this PDF scanning helps you write "Intl::Token::Number", but I guess after working with "Brainfuck" grammars you might be prone of doing things in some peculiar ways. 21:22
@guifa (Maybe the trip to Canada also contributed to this...)
21:29 linkable6 left, evalable6 left 21:30 linkable6 joined 21:32 evalable6 joined
guifa_ antonon: I've pretty much got Intl::Token::Number working now 21:34
trying to workout a kink with exponents because for some reason they're not recognized unless there's a space
but my grammar doesn't require it
oh oops I guess I did lol 21:35
forgot a ? quantified 21:36
21:40 wayland76 left, wayland joined
guifa_ hmmm 21:45
failed a few tests from old version
antononcube Great! 21:46
guifa_ antononcube: should a bar decimal (no fractional digits) be caught? I seem to have done it one way in the old one and the other in the new one
e.g. "There are 57. kg of apples, for oranges, 89." should the numbers be captured as "57." and "89." or "57" and "89"? 21:47
I can think of reasons for both ways
you're the math guy so I'll defer to you
antononcube In this case I thinking more in terms of how to parse output from LLMs and make "operational" in a Raku session. 21:50
librasteve m: say 2 + 3/5i; 21:51
Raku eval 2-0.6i
librasteve ^ this is a bug, right?
antononcube From that perspective this is more desirable: "You have to eat 1. kg apples per month." --> ["You have to eat", 1, "kg per month"] . 21:52
Meaning, Raku should be able to convert those string into numbers. 21:53
guifa_ okay, so you would like it to slurp up a terminal decimal 21:54
when you have the $<local-number> match, it will numbify to the value, and I provide a Role you can test for too if you've got a collection of Match
librasteve are you dealing with commas? if so then I agree that slurp a terminal decimal is good
nemokosch 3 is divided by 5i, I think it's correct 21:55
guifa_ librasteve: yeah, it will detect "1,234" as 1234
tellable6 guifa_, I'll pass your message to librasteve
nemokosch 1/i is equal to -i
librasteve oh - I see
antononcube @guifa Yes, sounds good.
guifa_ alright, lemme reformulate the grammar a bit then I'll release
librasteve m: say 4 + (3/5)i 21:56
Raku eval 4+0.6i
antononcube @librasteve Very often LLMs produce numeric results with commas. That is the reason I looked into "Intl::Token::Number" (and made urgent demands to @guifa.) 21:57
librasteve that's cool - I am thinking of using for next version of Physics::Measure ...
so 6. and 6, are both covered (ie comma as decimal marker)?? 21:58
guifa_ librasteve: depends on the language
tellable6 guifa_, I'll pass your message to librasteve
librasteve okaay - I look forward to raod testing! 21:59
guifa_ for English, if you had "There are 54, dogs, 65. cats, 89 things', the comma won't be consumed by the number token, but the period would
antononcube Right! 22:02
22:10 jdv left 22:11 jdv joined 22:16 jpn joined
guifa_ antononcube: is uploaded! 22:21
antononcube Interesting -- it is conjugated by default.
@guifa Ok, will experiment with it tonight. 22:22
22:23 jpn left 22:26 sena_kun left 22:31 sena_kun joined 23:24 Ekho left 23:38 sivoais left, sivoais joined 23:40 Ekho joined 23:42 sena_kun left