🦋 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:07 reportable6 left 00:09 reportable6 joined 01:09 greppable6 left, shareable6 left, coverable6 left, evalable6 left, linkable6 left, tellable6 left, committable6 left, notable6 left, unicodable6 left, bloatable6 left, releasable6 left, sourceable6 left, bisectable6 left, quotable6 left, benchable6 left, nativecallable6 left, statisfiable6 left, reportable6 left, releasable6 joined, greppable6 joined, sourceable6 joined 01:10 coverable6 joined, evalable6 joined, unicodable6 joined, quotable6 joined, reportable6 joined, statisfiable6 joined 01:11 notable6 joined, bloatable6 joined, committable6 joined, benchable6 joined, nativecallable6 joined, bisectable6 joined, tellable6 joined 01:12 linkable6 joined, shareable6 joined 01:40 saint- left 02:09 euandreh left 02:18 euandreh joined 03:18 evalable6 left, linkable6 left, tellable6 left, tellable6 joined, linkable6 joined, evalable6 joined 03:21 Guest35 left 04:21 reportable6 left, notable6 left, greppable6 left, quotable6 left, coverable6 left, sourceable6 left, bloatable6 left, linkable6 left, committable6 left, benchable6 left, statisfiable6 left, bisectable6 left, evalable6 left, tellable6 left, releasable6 left, unicodable6 left, shareable6 left, nativecallable6 left, quotable6 joined, bloatable6 joined, evalable6 joined, statisfiable6 joined 04:22 reportable6 joined, shareable6 joined, tellable6 joined, unicodable6 joined, nativecallable6 joined, notable6 joined, sourceable6 joined 04:23 linkable6 joined, benchable6 joined, committable6 joined, releasable6 joined, bisectable6 joined 04:24 coverable6 joined, greppable6 joined 05:24 greppable6 left, linkable6 left, nativecallable6 left, releasable6 left, coverable6 left, statisfiable6 left, evalable6 left, notable6 left, bisectable6 left, tellable6 left, bloatable6 left, committable6 left, quotable6 left, unicodable6 left, benchable6 left, sourceable6 left, reportable6 left, shareable6 left, greppable6 joined, sourceable6 joined, statisfiable6 joined, notable6 joined, unicodable6 joined 05:25 nativecallable6 joined, bloatable6 joined, coverable6 joined, shareable6 joined, evalable6 joined 05:26 committable6 joined, bisectable6 joined, reportable6 joined 05:27 linkable6 joined, benchable6 joined, releasable6 joined, quotable6 joined, tellable6 joined 05:38 Xliff left 06:07 reportable6 left 06:09 reportable6 joined 06:17 abraxxa joined 06:21 abraxxa left 06:22 abraxxa joined 06:47 clarjon1 joined 06:58 Sgeo left 07:13 dakkar joined 07:14 kiti_nomad[m] left, CIAvash left, AlexDaniel left, unclechu left, coolshaurya left, Matthew|m left, crystalfrost[m] left, MitarashiDango[m left 07:19 CIAvash joined 07:34 AlexDaniel joined, Matthew|m joined, unclechu joined, crystalfrost[m] joined, coolshaurya joined, MitarashiDango[m joined, kiti_nomad[m] joined
Geth vim-raku: sjn++ created pull request #36:
Ignore generated doc/tags
07:42
07:44 andinus left 07:45 andinus joined 08:28 jaguart joined 08:57 grondilu joined
grondilu m: class { has %.h handles <AT-KEY>; multi method foo($x where (%!h{$x}:exists)) { self{$x} } }.new(:h{ foo => "bar" }).foo("foo") 09:06
camelia ( no output )
grondilu m: class { has %.h handles <AT-KEY>; multi method foo($x where (self{$x}:exists)) { self{$x} } }.new(:h{ foo => "bar" }).foo("foo")
camelia Cannot resolve caller foo(<anon|1>.new(h => {:...: foo); none of these signatures matches:
(<anon|1>: $x where { ... }, *%_)
in block <unit> at <tmp> line 1
grondilu can't I use self in a signature? 09:07
m: class { has $.m; multi method foo($x where $x %% self.m) {}}
camelia ( no output )
grondilu m: class { has $.m; multi method foo($x where $x %% self.m) { $x / $!m }}.new(:m(3)).foo(12).say 09:08
camelia 4
09:13 razetime joined 09:41 sena_kun left 09:42 sena_kun joined 09:49 frost joined 10:02 silug left, silug joined 10:38 Altai-man joined 10:55 razetime left 11:13 razetime joined 11:55 jaguart left 12:05 Sankalp joined
Voldenet grondilu: you can use self as you wanted, but in :exists case you need EXISTS-KEY handled 12:06
m: class { has %.h handles <AT-KEY EXISTS-KEY>; multi method foo($x where (self{$x}:exists)) { self{$x} } }.new(:h{ foo => "bar" }).foo("foo")
camelia ( no output )
Voldenet you may also want STORE handled
12:07 reportable6 left 12:09 reportable6 joined 12:25 jjido joined 12:57 Xliff joined
Xliff m: role FontWidget { }; multi sub trait_mod:<is> (Attribute \a, :$font!) { a does FontWidget }; class A { has $.aa }; trait_mod:<is>(A.^attributes[0], :font); 12:58
camelia ( no output )
13:15 Sgeo joined 13:26 jjido left 13:32 timo left 13:34 timo joined 13:44 jaguart joined 13:50 Guest35 joined
grondilu Voldenet: noted, thanks 14:10
14:13 frost left 14:39 charsbar left, charsbar joined 14:51 jjido joined 14:56 morte_ joined 15:03 euandreh left 15:20 z4kz joined 15:22 abraxxa left 15:35 z4kz left 15:58 bigdata joined 16:04 euandreh joined
Xliff Um. rakubrew.org is busted. 16:39
Please someone say it isn't so!
16:40 dakkar left
Altai-man Xliff, alas, 500 error. 16:46
patrickb, ping?
16:47 grondilu left
[Coke] console says crbug/1173575, which SO says might just be a connectivity error. (maybe a cloudflare issue?) 16:48
17:05 razetime left 17:16 Altai-man left 17:26 bigdata left
Bscan🍺 Coke, I'm on the Discord side, so I cant see <#538420565980086273>docs. Quick question though: is there a JSON version of the docs? If so, I'd like to incorporate it into the Raku Navigator Language Server. 17:58
18:01 bigdata joined 18:04 jaguart left 18:06 reportable6 left 18:07 reportable6 joined
Xliff Are there recent binary packages for Rakudo? 18:11
If so, where can I get them? Ubuntu impish has 2020.12
I need something much closer to 2022.04
lizmat Xliff: El_Che's packages ? 18:32
nxadm.github.io/rakudo-pkg/ 18:33
Xliff lizmat++ # Thanks! 18:39
19:04 p6steve joined
p6steve i'm thinking about Dan::Polars - raku polars <-> rust polars <-> arrow2 ... this implies getting raku <-> rust working ... is there any prior art I can "borrow"? 19:07
[coda: does NativeCall use FFI? if so -- would this guide doc.rust-lang.org/nomicon/ffi.html hold for the rust side of things?] 19:09
please ;-) 19:16
lizmat nine ^^ ?? 19:28
19:40 grondilu joined
grondilu m: role R[Hash $h] { has %.h = %$h }; say class :: does R[%(foo => "bar")] {}.new.h 19:41
camelia {foo => bar}
grondilu and yet: 19:42
m: role R[Hash $h] { has %.h = %$h }; my $h = %(foo => "bar"); say class :: does R[$h] {}.new.h
camelia ===SORRY!=== Error while compiling <tmp>
No appropriate parametric role variant available for 'R':
Cannot resolve caller (<anon|1>, Any:U); none of these signatures matches:
(::$?CLASS ::::?CLASS Mu, Hash $h)
at <tmp>:1
grondilu what is different in these two lines?
p6steve apt-get install libperl-dev -y \ 19:45
&& zef install Inline::Perl5 \
&& cpan App::cpanminus \
&& cpanm FFI::Platypus FFI::Platypus::Lang::Rust
grondilu m: role R[Hash $h] { has %.h = %$h }; my $h = %(foo => "bar"); say class :: does R[$h.Hash] {}.new.h
camelia {}
p6steve ^^^ yikes - this worked(!) - thinking perl5 maybe adequate route to rust (comments / alternatives welcome please) 19:46
grondilu is it too much to put a hash as a parameter for a role or something?
tonyo can you rephrase that q p6steve ? 19:47
tellable6 2022-05-02T13:10:00Z #raku-dev <carlmasak> tonyo the thing that would make me consider Haskell's package management a significant step up from Go's isn't some technicalities around go.mod, but how well it solves the "stable dependencies" problem.
tonyo .tell carlmasak agreed (re:haskell's stability in dependencies) 19:48
tellable6 tonyo, I'll pass your message to carlmasak
Voldenet m: role R[Hash $h] { has %.h = %$h }; my $h = %(foo => "bar"); say (class :: {}.new but R[$h]).h 19:51
camelia {foo => bar}
Voldenet role R[$h] { has $.h = $h }; my Hash $h = %(foo => "bar"); say class :: does R[BEGIN { say $h; $h }] {}.new.h 19:52
evalable6 (Hash)
(Hash)
p6steve tonyo: sure - I want to write a new raku module that implements raku Dan (github.com/p6steve/raku-Dan) in the fast Apache Arrow2 library - since Dan is a raku alternative to Pandas/Polars Series & DataFrames, I think that it would be less work to interface Dan to Polars (which is implemented in Rust) 19:53
grondilu Voldenet: oh yeah, the parameter has to be defined at class composition time or something. of course. 19:54
Voldenet I suspect that's the case
p6steve soooo - my question is "are there any examples of interfacing raku to rust - for example via FFI?" and "does the info at guide doc.rust-lang.org/nomicon/ffi.html fit that from the rust side?" 19:55
19:57 sena_kun left
p6steve appreciate any guidance 19:58
19:59 sena_kun joined
nine If that Rust library exposes a C interface, I can imagine that just working as is via NativeCall 20:04
p6steve nine: tx! I suppose my base ignorance is that I do not know if NativeCall does FFI, or whether that matters? 20:08
nine What do you mean with "FFI"? 20:11
20:12 n1to joined
p6steve nine: I mean this --> en.wikipedia.org/wiki/Foreign_func..._interface 20:15
nine: (but I wonder if this is just what raku does anyhow - and thus I am confused) 20:16
nine That's why the question confuses me. Of course NativeCall is a foreign function interface. It is how you call native (i.e. non-Raku) functions from Raku 20:17
[Coke] bscan: what would a json version of the docs look like? 20:19
Is there some object standard for that? 20:20
p6steve haha - well the Platypus I shared above has a rust example like this: 20:21
1 #![crate_type = "dylib"]
2
3 // compile with: rustc add.rs
4
5 #[no_mangle]
6 pub extern "C" fn add(a:i32, b:i32) -> i32 {
7 a+b
8 }
this makes 'libadd.so' 20:22
so I will just go for that with NativeCall ... and see how I get on! 20:23
I [almost] want to use P5 Platypus as a go-between ... but will resist the urge to go too fast and loose 20:26
nine: vielen dank 20:30
20:31 grondilu left 20:32 melezhik joined 20:33 melezhik left 20:46 melezhik joined
melezhik . 20:47
20:47 melezhik left 20:56 kaiepi joined 21:07 kaiepi is now known as Kaiepi 21:09 melezhik joined 21:15 melezhik left 21:21 corwin left 21:22 corwin joined 21:39 hankache joined
Xliff p6steve: As long as your library is a valid .so, NativeCall will run it. 21:41
So for that particular function it would be... "use NativeCall; sub add (int32, int32) returns int32 is native(add) { * } 21:42
Voldenet I don't think you need (add) in that case 21:45
21:45 n1to left 21:56 melezhik joined
melezhik I am thinking to create a badge for Sparky CI builds, any thought how can I do it using cro? should I use static files or generate SVG on the fly? 21:57
21:59 melezhik left
p6steve Xliff: Cannot resolve caller guess_library_name(Nil:U, Nil:U); none of these signatures matches: ... suppose I need to "use" libadd.so somehow? 22:03
Xliff: Cannot locate native library 'libadd.so': libadd.so: cannot open shared object file: No such file or directory 22:05
^^ this with native('add') 22:06
Xliff: 1 use NativeCall; sub add (int32, int32) returns int32 is native('add') { * }; say add(1, 2); 22:09
Xliff: 3
Xliff: (had to cp libadd.so /usr/lib) 22:10
Xliff: cool - thanks!!
22:11 hankache left 22:35 jjido left
Voldenet p6steve: you don't need to have libadd.so in /usr/lib - you can provide full path iirc 22:42
> The native trait accepts the library name, the full path, or a subroutine returning either of the two. When using the library name, the name is assumed to be prepended with lib and appended with .so (or just appended with .dll on Windows), and will be searched for in the paths in the LD_LIBRARY_PATH (PATH on Windows) environment variable. 22:43
22:58 morte_ left 23:11 Altai-man joined 23:14 sena_kun left 23:19 sena_kun joined 23:21 Altai-man left 23:37 Kaiepi left