🦋 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:11 Xliff joined
Xliff Has anyone done anything with Cro::HTTP::Auth? 00:12
00:28 Summer left, Summer joined
antononcube Hm... It is "Cro::HTTP::Auth" is just a role... 00:47
aruniecrisps @SmokeMachine i saw, when i get some time I'll pull it and start playing around with it 00:57
Voldenet it's not actually implemented, it's just messages of tooling 01:00
but it looks right 01:03
aruniecrisps Oh i know
Voldenet though maybe instead of apply/revert i'd call the ops "up"/"down"/"remove-migration" 01:04
and "add-migration"
last two are entityframework-ish, but I like it
aruniecrisps @librasteve i might take a stab at implementing it an a project when I get the time in that case, I still think having persistent data sets is pretty useful 01:08
@Voldenet I like the idea too 01:09
librasteve don’t get me wrong - it’s a great idea … and I like the approach that code sections set out … BUT i suspect that there is some non trivial effort to meld something like this into raku / moarvm 01:14
tbrowder__ antononcube: yw, glad it helped! what was the issue? 01:15
antononcube @tbrowder The name of one of the test files had Cyrrlic letter. I suspected and error like this that, but I did not how to find which thing and where. 01:17
@_grenzo Where is Grezo when they are needed... 01:19
_grenzo Needed?
antononcube @_grenzo I cannot remember the name of the package in which you automatically create a Cro interface to a database. 01:20
_grenzo Marrow
antononcube (Searching raku.land for 4.5 min did not help...)
"Marrow" ... Should have been "CroQL", or something... 01:21
_grenzo That would have worked 01:22
antononcube Ah, yes -- the opposite of ORM.
Now, I recall...
Basically, I have a Finite State Machine (FSM) framework for Conversational Agents (CAs) which use both grammars and LLMs. Currently, CAs obtain datasets at creation, and transform and query that data using "Data::Reshapers". (I.e. "locally" with Raku.) 01:27
But it would be nice if those CA just handle the dialogues, and the data queries are handled by Web service. Hence the idea to use something like "Marrow" to create prototypes of that. 01:28
_grenzo Should work, where do you keep the data? 01:29
(what DB)
antononcube Currently, in memory by the FSM-CA object itself.
Ah -- my data right now is just an array of hashmaps. 01:30
But, I can move the data into SQLLite.
_grenzo that will work
In the tests I have a test sqllite DB that I use, you can look at that code 01:31
antononcube For example, imagine the data is metadata of Raku packages in Zef ecosystem. (Like here: github.com/antononcube/Scalable-Re.../main/Data .) 01:32
_grenzo will the tables be relational... 01:33
antononcube Yes, but this is just a prototype. I will use just a single table. 01:35
_grenzo should still work just not as impressive
🙂
antononcube The actual, "serious" solution is going to work by interfacing certain (complicated) data retrival system. (Over the Web.) 01:36
Let me see where the impressiveness is: in the functionality or in the ease to use.
Or both...
@_grenzo Can "Marrow" work without the Postgress packages? 01:40
_grenzo yes
If you have sqllite, you don't need to use DBI 01:41
(but you may have to comment it out)
antononcube Cannot install a few of the dependencies on my macOS. I can install "DB::SQLite".
_grenzo (DBI::Pg)
antononcube I see.
_grenzo I do give instructions for the mac install
Developed on a mac 01:42
antononcube Didn't read that far I guess.... 01:43
_grenzo And the github actions build MRO automatically for mac and linux
antononcube Cannot install "LibUUID". 01:51
_grenzo using brew? 01:52
antononcube Maybe it is paths to "uuid" issue...
With brew I installed "ossp-uuid". Wth zef I am trying to install "LibUUID". 01:53
_grenzo ok
I don't think I ran into that issue
antononcube @_grenzo Did you develop "Marrow" on an Intel macOS, an aarch64? 01:56
_grenzo yes
Intel
trying right now on an M1 01:57
worked
Warning: ossp-uuid 1.6.2_2 is already installed and up-to-date. To reinstall 1.6.2_2, run: brew reinstall ossp-uuid ❯ zef install LibUUID ===> Searching for: LibUUID ===> Staging LibUUID:ver<0.5>:auth<github:CurtTilmes> ===> Staging [OK] for LibUUID:ver<0.5>:auth<github:CurtTilmes> ===> Testing: LibUUID:ver<0.5>:auth<github:CurtTilmes> ===> Testing [OK] for LibUUID:ver<0.5>:auth<github:CurtTilmes> ===> Installing:
LibUUID:ver<0.5>:auth<github:CurtTilmes>
antononcube 👍 01:59
_grenzo I have a softlink from /usr/local/lib/libuuid.dylib to /opt/homebrew/lib/libuuid.dylib 02:00
not sure If I put that in or brew did
antononcube 👍 02:01
Trying that now...
Using the ln -s spec above worked -- Thanks a lot1! 02:03
_grenzo I'll add that to the Read.me 02:04
might need one for libpq as well 02:14
antononcube It seems you have not listed "JSON::Pretty" in the Meta file. 02:17
_grenzo I thought I removed that
antononcube It is used in "mro.raku".
_grenzo thanks 02:18
I have some updates to check in later
antononcube Meanwhile, I should bravely install "JSON::Pretty", I guess. 02:19
_grenzo it is prettier
antononcube 🙂 yeah 02:20
_grenzo although, is there a module that color codes the JSON?
antononcube Hmm... shouldn't lolcat do that? 02:21
_grenzo a utility with a name like lolcat really should 02:22
02:23 kylese left
antononcube Also, you might ask an LLM to do it -- I am curious what would the results be. 02:24
02:24 kylese joined
_grenzo I for one welcome our AI overlords. But with the amount of electricity these LLMs are starting to require, the Matrix "humans as batteries" plot is sounding more likely. 02:29
Just until the AI gets fusion working...which should be about 20 years 02:30
antononcube That is why I have the principle: Grammars before LLMs.
Why I have to specify db host, etc for mro.raku? 02:31
_grenzo to be honest, when I got it working for sqllite I didn't take out the requirement for host and port 02:32
antononcube Put it better -- what are good default values for an SQLite database? APP_HOST=0.0.0.0 APP_PORT=2314 DB_NAME=api_test DB_PASS=<yeah-right> DB_USER=ssotka # This is for a database running on the current maching. YMMV. DB_HOST=host.docker.internal DB_PORT=5432
Maybe you have those in the test files.. 02:33
_grenzo for dbname use the filename of sqllite.
user and password if you need them, otherwise they don't matter and neither do host or port, just put in dummy values 02:34
APP_HOST can be 0.0.0.0, localhost, or 127.0.0.1 depending on your taste and if you're using docker 02:35
if using docker 0.0.0.0. 02:36
antononcube Hmm ... cannot run mro.raku. 02:41
_grenzo ?? error
did you miss an argument
there are a lot of them
antononcube I assume I am -- but they all seem to have default values. 02:42
except "dbtype"
_grenzo that should be sqlite
for your database
antononcube right 02:43
_grenzo how did you spell sqlite 02:48
antononcube I figured it all the needed parameters 10min ago. Studying the generated code now... 02:52
_grenzo the code is in the roles 02:53
your code (if you add any) go in the modules
antononcube The code generated with a command that starts with : > mro.raku --app --mods --roles --templates --db-type=sqlite ... 02:54
_grenzo yes. If you remove the --app the bin/<app>.raku won't build. same for --mods, --roles, --templates 02:55
set them to false...they don't get regenerated.
If you change the database, regenerate the roles and templates 02:56
02:56 Summer left 02:57 Summer joined
antononcube ok. 02:57
@_grenzo Looks good -- too tired to experiment with the generated code tonight. But very promissing. 02:59
_grenzo thanks
03:05 tjr left 03:15 kylese left, kylese joined 03:26 xinming left 03:27 xinming joined, Summer left 03:28 Summer joined 03:58 Summer left, Summer joined 04:29 Summer left, Summer joined 05:30 Summer left 05:31 Summer joined 06:01 Summer left, Summer joined 06:32 Summer left, Summer joined 07:33 Summer left 07:34 Summer joined 08:04 Summer left, Summer joined 08:21 Sgeo left 08:30 abraxxa joined 08:35 Summer left, Summer joined 08:37 abraxxa left 08:53 jpn joined 09:05 abraxxa joined 09:12 dakkar joined 09:20 sena_kun joined 09:23 Guest57 joined, Guest57 left 09:25 haxxelotto joined 09:39 Summer left, Summer joined 10:08 abraxxa left 10:10 Summer left, Summer joined 10:13 ericst joined 10:40 Summer left 10:41 Summer joined 10:57 abraxxa joined 11:07 tjr joined 11:11 Summer left 11:12 Summer joined
tbrowder__ antononcube: Data looks interesting. can you add a practical raku example of what's going on? or is it used in another of your raku distros? btw, mi6-helper now shows up in a Raku.land search 11:32
how do raku-community-modules repos get published? my PR for File::Temp was merged and is ready for release. 11:40
11:42 abraxxa left, Summer left, Summer joined
lizmat tbrowder__: I've prepared most of community modules to be mi6 compatible 11:45
but File::Temp is not one of them 11:46
looks like there's still a bunch wrong with it though... 11:48
will prepare properly for mi6 release now 11:51
12:01 abraxxa joined
tbrowder__ doesn't my merged pr do that for File::Temp 12:12
also see my issue on the repo name
12:13 Summer left, Summer joined
tbrowder__ ah, master just changed to main in between 12:17
lizmat yeah, am working on it
antononcube @tbrowder I assume you refer to the Zef ecosystem data I mentioned last night. 12:22
A “practical example with Raku” — and for Raku — is something I demonstrated 2.5 years ago during TRC-2021 — a recommender system for Raku packages that can be used via natural language commands. 12:23
At some point I have to re-ingest that data. 12:24
tbrowder__ yes, sounds familiar
lizmat tbrowder__: I've just uploaded 0.11 to zef 12:33
would you like the ability to release raku-community-modules ? 12:34
El_Che is that something from a spider's bite? 12:38
lizmat no radiation is involved 12:39
tbrowder__ sure
lizmat ah, looks like you already can 12:42
% fez org invite raku-community-modules member tbrowder 12:43
=<< FATAL: User is already in group
as long as the auth is "zef:raku-community-modules" in the META6.json, you should be able to do an mi6 release
12:43 Summer left
lizmat on all raku-community-modules 12:44
12:44 Summer joined 12:47 ericst left 13:03 abraxxa left 13:04 jpn left 13:13 abraxxa joined 13:14 Summer left 13:15 Summer joined 13:49 itaipu left 13:50 jpn joined 13:55 jpn left 13:59 kjp left 14:02 jpn joined 14:13 kjp joined 14:22 itaipu joined 14:50 TieUpYourCamel left 14:53 TieUpYourCamel joined 14:56 TieUpYourCamel left 14:57 TieUpYourCamel joined 15:02 TieUpYourCamel left 15:24 justache is now known as fotastache 16:03 abraxxa left
[Coke] do we have a cprocess for community module releases, PRs, etc.? 16:05
shouuld everything on a community module be a PR, e.g. ?
(I ask because I'm think I'm on that membership list also) 16:06
16:11 abraxxa joined
tbrowder__ ah, liz, thnx. 16:23
16:31 vlad joined 16:46 vlad left, vlad joined 16:48 abraxxa left 17:22 fotastache left 17:41 dakkar left 17:54 itaipu left 17:56 itaipu joined
antononcube For completeness, I plan to publish a notebook with LLM processing workflows of Biden's State of Union speech. Ideally, that would be the last of those. 18:14
I strongly consider making a Cro app that applies the described workflows and prompts to user uploaded texts. 18:15
Well, I might exploer non-Cro solutions too. 18:17
18:45 vlad left 18:51 jpn left
@_grenzo I need your help. 18:53
With "Marrow".
_grenzo What can I help with?
antononcube I created an SQLite table with an integer 'id' column. I generated the Raku-Cro code with mro.raku. 18:54
When I rung localhost:5333/ping I see '"SUCCESS / pong". 18:55
My database table is called "Orders". I want to see a record from it giving an ID. 18:56
It looks like -- by reading public-routes -- that this should work : localhost:5333/Orders/343232
But I get: "message": "Failed lookup of Orders: 343232 : SQL logic error", ... 18:57
Maybe I am missing a step?
_grenzo no, that should work 18:58
18:59 vlad joined
antononcube I see that the "id" field is defined as a Str (in the generated code.) Should it be an Int or UInt? 18:59
_grenzo what is it in your database?
antononcube 10-15 columns, some strings some double numbers. 19:00
_grenzo I default to string if I don't have a predefined tranlation
the ID?
antononcube the ID is integer. (You mention id as Int is tested.)
_grenzo it is. it should not have defined your id as a string 19:01
antononcube Maybe I should just say it is an Int in the route signature?
_grenzo try it. Can you send the route file and the Orders role? 19:02
antononcube Hmmm... it is with real data, so, I cannot. I can generate similar fake data though.
BTW, since I ingested a CSV file in the SQLite to create the table, the table there might define the "id" column as string. 19:03
_grenzo possible 19:04
you could alter the table and regenerate the code
antononcube Right...
Appologies for the ignorant questions below: 19:05
1. Can I use SQL statements to query the records ? (Via the routes created by "Marrow".) 2. Can I use Raku code to manipulate the records? (I.e. are the database records represented as objects "locally".) 19:06
_grenzo 1: yes and no. If you need to manipulate them in ways other than what are in the role file, create methods in the module that implements the role. You will have to add new routes to the route file in the module directory (so it won't get overwritten) 2: the new code goes in the module file. 19:10
the module is the object but most of the code is in the role
antononcube Ok. 19:13
20:00 jpn joined 20:05 jpn left
@_grenzo It seems I cannot use REALs from SQLite. 20:07
_grenzo You're right, an oversight 20:09
github.com/ssotka/Marrow/blob/mast...nv.rakumod
is there a numeric type in sqlite? 20:10
antononcube I think REAL is numeric type. 20:11
_grenzo sqlite supports integer real text and blob 20:12
I assumed wrongly it supported numeric as postgresql does.
you can add an entry to Db/Conv.rakumod 20:13
to the sqlite %types hash 20:14
'real' => 'Real',
I'll update and check it in probably tonight
Geth App-Rakubrew/main: abf635c0cb | (Patrick Böker)++ | 2 files
Update and nail dependency versions
20:15
App-Rakubrew/main: 79f286c9bc | (Patrick Böker)++ | 2 files
Fix `download` on Windows

PAR doesn't know about DLL dependencies. One needs to explicitly tell it which DLLs to include in the build. Without those DLLs HTTP::Tinyish skipped LWP and HTTP::Tiny because those DLLs were missing for SSL support. It then chose the Curl backend. That contained a bug, which messed up the downloaded content by converting CRLF -> LF. That is now fixed in ... (6 more lines)
App-Rakubrew/main: df1e7561a7 | (Patrick Böker)++ | 4 files
Version 38
20:16 TieUpYourCamel joined 20:42 avuserow left 20:43 avuserow joined 20:45 vlad left
Geth App-Rakubrew/main: 982354fec9 | (Patrick Böker)++ | 3 files
Update and nail dependency versions
20:47
App-Rakubrew/main: 0ba2b9d439 | (Patrick Böker)++ | 2 files
Fix `download` on Windows

PAR doesn't know about DLL dependencies. One needs to explicitly tell it which DLLs to include in the build. Without those DLLs HTTP::Tinyish skipped LWP and HTTP::Tiny because those DLLs were missing for SSL support. It then chose the Curl backend. That contained a bug, which messed up the downloaded content by converting CRLF -> LF. That is now fixed in ... (6 more lines)
App-Rakubrew/main: a17621d358 | (Patrick Böker)++ | 4 files
Version 38
App-Rakubrew/main: 597b21a663 | (Patrick Böker)++ | 3 files
Update and nail dependency versions
20:49
App-Rakubrew/main: dd41aeedf5 | (Patrick Böker)++ | 2 files
Fix `download` on Windows

PAR doesn't know about DLL dependencies. One needs to explicitly tell it which DLLs to include in the build. Without those DLLs HTTP::Tinyish skipped LWP and HTTP::Tiny because those DLLs were missing for SSL support. It then chose the Curl backend. That contained a bug, which messed up the downloaded content by converting CRLF -> LF. That is now fixed in ... (6 more lines)
App-Rakubrew/main: 87c50ca1df | (Patrick Böker)++ | 4 files
Version 38
20:52 jpn joined 20:58 jpn left
Geth App-Rakubrew/main: 39cf74deaf | (Patrick Böker)++ | 3 files
Version 38
21:08
App-Rakubrew/main: bf1167a291 | (Patrick Böker)++ | dist.ini
dist fixup
21:09
App-Rakubrew/main: d364e3c581 | (Patrick Böker)++ | 2 files
Fix `download` on Windows

PAR doesn't know about DLL dependencies. One needs to explicitly tell it which DLLs to include in the build. Without those DLLs HTTP::Tinyish skipped LWP and HTTP::Tiny because those DLLs were missing for SSL support. It then chose the Curl backend. That contained a bug, which messed up the downloaded content by converting CRLF -> LF. That is now fixed in ... (6 more lines)
App-Rakubrew/main: c5457ae22e | (Patrick Böker)++ | 4 files
Version 38
21:10
App-Rakubrew/main: 9350c5bfd3 | (Patrick Böker)++ | .circleci/config.yml
Update MacOS build environment to a working version
21:21
antononcube That worked. 21:22
_grenzo @antononcube if you pull index.html up in your browser there is a form for creating/updating/searching(id) 21:27
autogenerated for your database
It uses javascript to make REST calls on the APIs 21:28
Geth App-Rakubrew/main: c1d5e42da5 | (Patrick Böker)++ | release-stuff/build-windows.ps1
Windows: Fix paths in build-windows.ps1 and bump to Perl 5.32.1.1
21:33
tbrowder__ hi, still blind to my own msgs, but seeking advice. i need a new module name for my old CSV::AutoClass which I stupidly renamed to CSV::Autoclass and now realize the original design is not as useful as intended. the new birth will still generate a class module from the header row's field names, but it will also create supporting modules with roles and subs that expand uses of the source csv db with its autogenerated class. some 21:35
names i'm considering are: CSV::Table, CSV::DB::Table, CSV::DB, CSV::Class. any votes may be submitted as issues at the current new repo at github.com/tbrowder/CSV-Table. thanks!
antononcube @_grenzo Success -- finally made it work. 21:41
_grenzo I will get fixes in as soon as I can 21:42
antononcube I think a fair amount of messages have to added that proclaim missing vairables. (Say, during establishing the DB connection.)
_grenzo for the command line? 21:43
antononcube @_grenzo For example, see the last die and the default values here: method connect() { $.conninfo = join " ", ("dbname=%*ENV<DB_NAME>"), ("host=%*ENV<DB_HOST>"), ("port=%*ENV<DB_PORT>"), ("user={%*ENV<DB_USER> // ''}"), ("password={%*ENV<DB_PASS> // ''}"); note $.conninfo; given %*ENV<DB_TYPE> { when 'pg' { $.dbh =
DB::Pg.new(conninfo => self.conninfo); } when 'sqlite' { $.dbh = DB::SQLite.new(filename => %*ENV<DB_NAME>); } when 'mysql' { die "MySQL not yet supported"; } when 'oracle' { die "Oracle not yet supported"; } default { die 'Specify DB_TYPE.'} } }
And, yes -- for the CLI script too! 🙂
_grenzo I see...good idea 21:44
antononcube Great idea and implementation for this package, BTW. I think it really shortened my work on this at least 3-4 times. 21:45
_grenzo Then it did it's job
thanks for the testing help
antononcube Well, with 10 times speed-up it would have...
BTW, this "10 times" requirement comes from the rule of thumb that: > For data scientists to adopt a tool or methodology it needs to speed up their work 10 times. 21:46
_grenzo I see. 21:47
if it had worked first try?
antononcube I think, I spent too much installing and re-installing. The other significant time chunk was figuring out the missing env arguments and SQLite types, etc. 21:48
21:52 jpn joined 22:02 jpn left
Geth App-Rakubrew/main: 6495ffb804 | (Patrick Böker)++ | release-stuff/do-release.sh
Adapt release script to new website server
22:06
22:26 jpn joined 22:34 jpn left 22:49 Sgeo joined 23:20 jpn joined 23:26 jpn left 23:52 sena_kun left 23:57 jpn joined