This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
02:07 MasterDuke joined 05:52 kjp left 05:54 kjp joined 06:02 kjp left, kjp joined 06:39 Tirifto left 06:40 Tirifto joined 08:15 dakkar joined 11:47 az45 joined 12:01 greenfork left, KOTP left 12:02 greenfork joined, KOTP joined
az45 Rakudo 2024.07 on NetBSD 10 Stable; feedback, the "./bin/rstar install" method fails, temporary log says "failed to load library 'dynext/libperl6_ops_moar.so'", the git checkout tags/2024.07 "perl Configure.pl ...; make ; make install" method succeeds. 12:07
lizmat should probably make an issue for that in github.com/rakudo/star 12:10
az45 can someone with github.com logon issue a notice, thanks in advance 12:20
12:24 jgaz left
lizmat az45: could you create a gist somewhere with the "rstar sysinfo" and "RSTAR_DEBUG=1 rstar install" logs? 12:28
antononcube @lizmat It seems @az45 does not have GitHub or not want / cannot use it. 12:33
lizmat "gist somewhere" is not Github only :-) 12:34
az45 ./rstar sysinfo ␤ fatal: not in a git directory ␤ make make ␤ version 10.0_stable ␤ term dumb ␤ key netbsd os ␤ netbsd arch amd64 12:35
antononcube Fine! Here is my revised comment: > It seems that @az45 wants to "outsource" the reporting effort (for whatever reasons.) 12:37
@az45 Nice catch, BTW.
Since we are on this topic -- and sorry if this question has been asked before -- why we have (proclaimed) distributions of 2024.07 on GitHub, but we do not see the corresponding 2024.07 distributions for Linux, macOS, Windows in rakudo.org ? 12:40
az45 769 lines listed at pastebin.com/EEJuTE5d 12:52
lizmat good question, maybe jdv forgot a step?
or patrickb ?
az45: thanks, github.com/rakudo/star/issues/202 12:56
az45 succcessful "perl Configure.pl ..." run looks as follows in 824 lines pastebin.com/GcLfxLGH 13:05
thanks and bye 13:09
13:09 az45 left 13:29 jgaz joined 13:43 alaziz joined
alaziz hi guys, is it a good place to ask about code errors? 13:44
sjn yes 13:46
lizmat well, if they're in Raku :-)
sjn what, no legal code errors? how about dress code errors? o_O 13:47
sjn is deeply, deeply, _deeply_ disappointed
alaziz So, I have the following code using NativeCall 13:48
use NativeCall;
constant LIBPATH = "$*CWD/smath";
class SVector is repr('CStruct'){
    has CArray[int32] $.data is rw;
    has size_t $.nelems;
    our sub vector_zeros(size_t) returns SVector is native(LIBPATH){*}
    our sub vector_sum(SVector, SVector) returns SVector is native(LIBPATH){*}
    our sub vector_free(SVector) is native(LIBPATH) {*}
    multi method new (@arr) {
        self.bless(data => @arr, nelems => @arr.elems)
    }
    method zeros(Int $n){
        vector_zeros($n);
    }
    method vector_sum(SVector $b) {
        vector_sum(self, $b);
    }
    submethod DESTROY { 13:49
and this fails with:
assign requires a concrete object (got a NativeCall::Types::CArray[int32] type object instead)
  in method new at prova1.raku line 16
  in block <unit> at prova1.raku line 38
ok, the lines may be wrong because I deleted code that is irrelevant here
the error is when I try to construct my SVector, but I don't understand from the error what I should do 13:50
lizmat alaziz: please, use a gist for code listings 13:53
sjn yeah, that error is LTA (less than awesome) for me too. searching got "concrete object" in the docs yields no results too 13:54
antononcube @sjn Also, no fire code errors, blue code errors, and objection errors.
@sjn Since your deeply disappointed : have you tried using Markdeep (instead of Markdown) ? 13:56
sjn #Markdownunder
antononcube casual-effects.com/markdeep/ 13:57
sjn can't help alaziz, and hope someone who knows NativeCall shows up eventually
hopes*
antononcube @sjn hopes deeply (FTFY.) 13:58
sjn reaches down to the bottomless depths of his hopeium reserves, to see if he can find some more 13:59
alaziz does it make sense to ask in #raku?
sjn alaziz: wouldn't hurt. it's not exactly a beginner question you asked, maybe? :-D 14:00
antononcube @alaziz It is fine to ask here -- just use pastebin, or something...
sjn yeah google gists or pastebin helps a lot with reproducing and helping 14:01
antononcube @sjn Consider stocking up with rakunium. 14:02
alaziz @sjn maybe yes, maybe not, but I wrote my first raku line less than 2 hours ago 14:04
sjn rakudonium! #atomicTypes
alaziz: nice! jumping right into the deep end! well done :-D 14:05
alaziz I'm now thinking that since a CStruct represents a pointer to a struct in C, it cannot really be initialized in raku, and new should just delegate to a C function
antononcube @sjn Ok, also with rakudontium. 14:07
alaziz yes, it seems that we are not allowed to initialize CStruct from raku code 14:18
14:22 alaziz left
antononcube rakudontium it is, then. 14:42
librasteve alaziz: I guess you have looked at this doc ? docs.raku.org/language/nativecall#Structs 16:16
had a play - seems to me that your .new method implicitly uses assign (likely to get list assignment semantics) but that nativecall requires binding with := so as in the example NativeCall currently doesn't put object members in containers, so assigning new values to them (with =) doesn't work. Instead, you have to bind (with :=) new values to the private members: you will need to provide a method TWEAK 16:26
or similar
lizmat is built(:bind) perhaps ? 16:27
librasteve SVector.new(data => NativeCall::Types::CArray[int32].new, nelems => 3) with has CArray[int32] $!data is built(:bind); 16:31
16:33 dakkar left 20:45 alaziz joined
alaziz thank you @librasteve, I will try using BUILD and TWEAK 20:47
what do you guys use raku for? 20:52
21:36 alaziz left
ab5tract alaziz: Mostly glue, as I don’t have a lot of free time for big projects at the moment. It’s my first stop for any integration or analysis work 22:06
I did have a lot of fun writing a Tetris clone and a blizzard simulator last year too 22:07
antononcube @alaziz I use Raku in three major project groups: 1. DSL translation and conversational agents 2. Advanced LLM interactions 3. Increasingly, for exploratory data analysis and certain type of scientific research 22:24
The DSL translation and conversational agents often require hooking to sime "serious" data that can be both "public" and "private." That is why, for example, I work on certain geography-related features of Raku. 22:25