🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:00 monkey_ joined 00:07 reportable6 left 00:08 guifa left 00:09 reportable6 joined 00:23 monkey_ left
SmokeMachine Is there a way to get the where condition from a subset? I’m thinking on a way of doing something like this: let’s say User is a Red model, then I’d like to be able to do something like this: subset Admin of User where *.role == “admin”; and that would work as usual and also, when you do Admin.^all, it would be equivalent of doing: User.^all.grep(*.role == “admin”); any idea if that’s possible? 00:29
(I know that .^all wouldn’t even work on that case because it’s using Metamodel::SubsetHOW instead of MetamodelX::Red::Model 00:32
00:40 [Coke] left, [Coke] joined 01:24 swaggboi left 01:33 avar left 01:34 avar joined 01:37 swaggboi joined 02:07 euandreh left 02:10 [Coke] left 02:16 [Coke] joined
Voldenet SmokeMachine: Admin.^refinement gets you WhateverCode which isn't too useful – in the simplest cases something like ix.io/3TYF could work 02:23
…afterwards I read the rest of the question only asking for `^refinement` 02:33
02:34 amenonsen left 02:35 amenonsen joined 02:40 euandreh joined 02:50 xinming left 03:02 frost joined 03:27 neshpion joined 03:33 guifa joined 03:40 guifa left 03:45 stanrifkin_ joined 03:48 stanrifkin left 04:22 neshpion left 04:40 zacts joined 05:20 zacts left 05:25 ggoebel left 05:29 zacts joined 05:32 zacts left 05:41 swaggboi left 06:08 reportable6 left 06:09 reportable6 joined 06:11 swaggboi joined 06:12 mexen joined 06:16 swaggboi left 06:27 swaggboi joined 06:51 abraxxa-home joined 06:53 abraxxa-home left 06:55 abraxxa-home joined
p6steve lichtkind: I found this github.com/lichtkind/Chart - 46.8k lines so i am not going to ask "please rebuild as raku" ;-) 07:28
07:28 nebuchadnezzar left
p6steve All: is there any general f/back on direction of travel for raku plotting ... my default is Inline::Python matplotlib or ggplot ... but maybe a shim on Inline::Perl5 Chart better? 07:29
07:32 xinming joined 07:42 Sgeo left 08:15 tejr left 08:16 tejr joined
MasterDuke there are a couple raku plotting modules, but i don't think any are quite as feature-filled as matplotlib, etc 08:43
09:16 evalable6 left, linkable6 left 09:17 linkable6 joined 09:19 evalable6 joined 09:34 qorg11 left 09:36 qorg11 joined
p6steve MasterDuke: my bad too lazy to look at raku.land(!) ... SVG::Plot (while a bit neglected) has some good prior art on the raku API needed for plot (and even has plot examples with Grammars!) 10:03
MasterDuke: so I will probably launch off that (may need to extend) for the pure raku side (then Inline::Python ```import matplotlib.pyplot as plt``` for backward compatibility and full features) 10:06
10:10 ggoebel joined 10:25 stanrifkin_ left 10:28 wingfold joined 10:30 ggoebel left 10:34 Altai-man joined 10:59 Xliff joined
Xliff \o 10:59
What's the best way to get the maximum value for a num64?
MasterDuke the max value is infinity, so not sure what you mean? 11:12
Nemokosch then the max finite value I guess 11:18
I'm rather curious about what num64 is
MasterDuke it's a sized native num, though Num is just a wrapper around them and there really isn't much of a difference 11:20
it's just a double under the hood 11:21
Xliff MasterDuke: A google search gave that value to be something like 7976931348623157e308 11:44
That's actually: 1.7976931348623157e308 11:45
11:45 MasterDuke left, linkable6 left 11:48 linkable6 joined, melezhik joined
melezhik . 11:49
Nemokosch How does the $! variable work exactly? It reminds me of IOResult in Turbo Pascal
I had a process that failed. When I logged $! right after the try clause, things went on as usual. When I tried to postpone it after other calls, I failed
other calls NOT inside the try clause, that is
11:49 melezhik left 11:51 MasterDuke joined
or is run implicitly async? 11:53
something is off here
11:59 frost left 12:00 frost joined
moritz there are two ways to handle errors: one is a CATCH block, where the error object is available as $_. Note that you don't need any 'try' for that, because the presence of a CATCH block already marks it as an error handler 12:01
the second is to use `try`, which catches all errors, and sets $!. $! shouldn't be reset unless by another (or this) try block 12:02
12:07 reportable6 left 12:08 reportable6 joined, p6steve left 12:20 jjido joined 12:25 melezhik joined 12:30 melezhik left
Nemokosch I think I'm facing some async issue with `run`. 12:33
from what I see, the clever thing is to not run `run` itself in sunk context 12:39
moritz or use Proc::Async, which is, like, async by itself :D 12:40
Nemokosch The reason people choose `run` over Proc::Async is that Proc::Async is overkill for certain tasks 12:44
12:56 jjido left 13:03 jjido joined 13:06 frost left 13:07 jjido left 13:08 jgaz joined 13:11 TempIRCLogger joined 13:16 tejr left 13:17 tejr joined
ugexe sinking a failure raises an exception 13:20
[Coke] I am close to writing a wrapper for Proc::Async because I use it a lot in my scripts for work. 13:22
jgaz [Coke]: You use Raku in production? Very cool. 13:25
[Coke] mm. I am not sure how much help a wrapper would be. I tend to have a list of things to process, run them all async collecting the output (so in a hash, with a lock), and then process the resulting output. Not sure how much of that is helpfully abstracted, and how much cleaner I can make the syntax. 13:29
(and if I did have a wrapper, doing anything other than that particular approach then becomes harder. Might be better to just writeup a sample explaining the usage.) 13:30
(which itself is cribbed together from poking people on this channel.)
14:17 evalable6 left, linkable6 left, linkable6 joined 14:18 evalable6 joined
nine has been using Raku in production for years 14:42
It's the reason for the drive towards 0 segfaults in the same time span 14:43
14:46 holyghost joined
holyghost re 14:46
Gremlin Scheme (old racul) now can store variables of the form "(define x 5)" at runtime, it's at 2100+ lines and available here : sourceforge.net/projects/gremlin-scheme/files/ 14:47
Later on I will pull it towards a Scheme for raku extension, just as guile for GNU software 14:48
See for the gremlinscm_dispatch_symbol method
The system will have a bootstrappable library for talking Scheme with the runtime
There is an API now for symbols and the theorem prover 14:49
Instead of using BNF or something, it uses an inference/rule system to parse for the Scheme system
Be patient, and I'll be too :-) 14:50
14:53 jgaz left 15:07 Sgeo joined 15:10 discord-raku-bot left 15:11 discord-raku-bot joined 15:23 jjido joined 15:51 Altai-man left 15:53 jjido left
ugexe run is a wrapper for Proc::Async 15:54
a generalized wrapper anyway 15:55
although it sounds like you are talking more about a Process Manager than a wrapper
16:00 p6steve joined 16:10 guifa joined 16:35 epony left 16:36 epony joined 16:44 lichtkind joined 16:49 monkey_ joined
Voldenet p6steve: I've used Chart::Gnuplot and despite some minor pains it worked relatively well 16:49
p6steve Voldenet: tx! 17:02
Voldenet iirc by default it didn't support pngcairo though 17:03
17:04 mexen left
Voldenet so i had to remove package maintainer-provided gnuplot and use the one from debian's repo 17:04
17:19 monkey_ left 17:32 Xliff left 18:06 reportable6 left 18:07 reportable6 joined 18:08 sena_kun left 18:11 wingfold left 18:14 sena_kun joined 18:15 jjido joined 18:18 holyghost left 18:19 jjido left 19:09 ggoebel joined 19:20 Xliff joined
Xliff \o 19:20
Does Num have a wau of getting its floating point portion?
sub a ($f) { $f - $f.floor}; say 19.3333.&a 19:22
evalable6 0.3333
Xliff Eh. That's not so bad.
Voldenet actually 19:23
m: sub a ($f) { $f - $f.floor}; say -19.3333.&a
camelia -0.3333
Voldenet uh what?! 19:25
m: sub a (Num $f) { $f - $f.floor }; say -19.3333.&a
camelia Type check failed in binding to parameter '$f'; expected Num but got Rat (19.3333)
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Voldenet m: sub a (Num $f) { $f - $f.floor }; say -19.3333.Num.&a
camelia -0.33330000000000126
Voldenet m: sub a (Num $f) { $f.floor }; say -19.3333.Num.&a
camelia -19
Voldenet Why does floor do truncation? 19:26
Xliff Coz .floor is a truncation?
Voldenet Nope, floor and ceiling are very well-defined 19:27
Xliff OK, then. I thought floor gave only the integer part of ther number. Effectively cutting off the floating point value. 19:28
Voldenet in fact, I wonder why the output is -19 in this specific case, it's weird
drakonis can nativecall be extended for usage with other languages?
Xliff Um. Would floor of -19.333 be -20?
Voldenet Yes, for -19.333: floor = -20, ceil = -19, trunc = -19 19:29
Xliff drakonis: As long as that language can output to the system-level shared library format, I think so.
drakonis i see
should be fine then
Xliff Voldenet, Um.... bug?
Voldenet I'm very much convinced that this is a bug, since there exists method called /truncate/ 19:31
m: sub a (Num $f) { $f - $f.truncate }; say -19.3333.Num.&a
camelia -0.33330000000000126
Voldenet and this is valid
MasterDuke nqp: say(nqp::floor_n(-19.333)) 19:33
camelia -20
Voldenet …and this is also valid!
Xliff Er. Ouch.
If raku and nqp differ, then that is definitely a bug! 19:34
MasterDuke m: say (-19.333).floo
camelia No such method 'floo' for invocant of type 'Rat'. Did you mean any of
these: 'floor', 'flat', 'flip', 'log'?
in block <unit> at <tmp> line 1
MasterDuke m: say (-19.333).floor
camelia -20
Voldenet m: say (-19.333).Num.floor 19:35
camelia -20
Voldenet m: sub a (Num $f) { say $f }; -19.3333.Num.&a 19:37
camelia WARNINGS for <tmp>:
19.3333
Useless use of "-" in expression "-19.3333.Num.&a" in sink context (line 1)
Voldenet m: sub a (Num $f) { say $f }; say -19.3333.Num.&a
camelia 19.3333
-1
Voldenet ಠ_ಠ
what is happening
MasterDuke m: sub a (Num $f) { say $f }; say (-19.3333).Num.&a 19:38
camelia -19.3333
True
Voldenet …oh.
That is totally not a bug, just unexpected syntax. 19:39
sub a ($f) { $f - $f.floor}; say (-19.3333).&a
evalable6 0.6667
Voldenet and as expected, this gives you wrong result
19:46 sena_kun left 19:54 sena_kun joined 19:55 melezhik joined, melezhik left 20:03 Kaiepi left 20:16 abraxxa-home left 20:36 stoned75 joined, stoned75 left
SmokeMachine Just laughed a new Red release! Now it's on fez and accepts columns as arrays and typed arrays! No need to manually define the database type for those! 20:37
japhb SmokeMachine: Just *launched*? 21:07
SmokeMachine exactly! my English is not that good and the auto corrector do not help! :) 21:09
moritz laughing a release into existance also sounds like a fun development process :-) 21:18
21:33 Kaiepi joined 22:28 melezhik joined
melezhik .tell patrickb I have added GH authentication to sparkyci, eventually will add ability for users to setup their repositories via accounts 22:29
sparrowhub.io:2222/login-page 22:30
22:37 melezhik left 22:41 zacts joined 22:55 zacts left 23:12 lichtkind left 23:28 swaggboi left 23:42 swaggboi joined