🦋 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.
adsasd hello. Who I can get help of functions in REPL ? 00:42
MasterDuke adsasd: what's the problem? 00:45
adsasd no problem, only I want now if the REPL is like Julia, with help of function and can see the source code of functions 00:46
or list of parameters of methods
MasterDuke sort of. `foo.^methods` will give you a list of all methods for foo 00:47
then you could choose one and call `.signature` on it to see what parameters it takes 00:48
and .WHY on a method should give you a link to it's page on docs.raku.org 00:49
but you can't easily see the documentation or implementation inline in the REPL 00:50
adsasd Perfect, thanks!!! There are page in docs.raku.org or other site with the information you have given me or more things ? 00:53
MasterDuke yeah, that's the main documentation site 00:54
adsasd do you know the page ?
MasterDuke hm. i don't think the docs have a section specifically about the REPL. information about introspection is also kind of scattered throughout. e.g., docs.raku.org/language/objects#Met...rospection has some information, but it doesn't have everything 00:58
adsasd many thanks 01:01
MasterDuke welcome
the search on the doc site is pretty good. if you search for introspection you'll get a lot of relevant hits 01:02
adsasd I am new to Raku and Spanish. If you would like to help by for example gathering information to create a page in the REPL documentation where you could start
MasterDuke hm, not quite sure what you mean. are you asking where you could find information about the REPL so you could combine it all into one page? 01:05
adsasd yes 01:06
MasterDuke i'm not sure. i don't think there is very much information specifically about the REPL. it doesn't have a whole lot of unique functionality, it's pretty much the same as the rest of the language. i.e., those things i mentioned like .WHY and .signature are just part of the general language, not only for the REPL 01:08
but i would suggest asking in #raku-doc, you'll probably get a more useful answer there
adsasd thanks 01:10
MasterDuke happy to help
fyi, a bunch of the doc people are also in europe, so there's a decent chance they won't be online until tomorrow 01:16
andinus rakudo downloads should work now: setup redirects for: rakudo.org/dl/rakudo/rakudo-2023.10.tar.gz 02:31
ab5tract andinus++ 09:14
Marcool04 andinus confirmed!
thanks a bunch 👍️
grondilu m: say grammar { rule TOP { <ident>* \% \s \n } }.parse: qq{foo bar\n} 09:53
camelia Nil
grondilu m: say grammar { rule TOP { <ident>* % \s \n } }.parse: qq{foo bar\n}
camelia Nil
grondilu m: say grammar { rule TOP { <ident>* % \s } }.parse: qq{foo bar\n} 09:54
camelia 「foo bar

ident => 「foo」
ident => 「bar」
grondilu m: say grammar { rule TOP { <ident>* % \s $ } }.parse: qq{foo bar\n}
camelia 「foo bar

ident => 「foo」
ident => 「bar」
grondilu m: say grammar { rule TOP { [<ident>* % \s]\n } }.parse: qq{foo bar\n}
camelia Nil
CIAvash rakudo binary download urls still redirect to Rakudo's GitHub page rakudo.org/dl/rakudo/rakudo-moar-2...gcc.tar.gz 10:04
Rakudo Downloads page also shows a "500 Server Error" rakudo.org/downloads 10:05
Marcool04 CIAvash ah... indeed. I only checked the source tarball link 🤦‍♂️
andinus yes i only setup redirects for source tarballs 10:06
Marcool04 I think the binaries were hosted elsewhere and haven't been pulled back yep
yet*
andinus atikon boxes are still down, i won't be able to pull it from theere
patrickb has binaries for last few releases, we should be able to restore them 10:07
Marcool04 out of pure curiosity, can I ask what happened with atikon? is it a hardware/infrastructure issue on their side?
andinus the point of contact addresses we had, they don't work there anymore 10:08
they relayed that the services should have been up but that's not the case
seems to be a major outage on their end
Marcool04 wow ok 10:09
grondilu m: say grammar { rule TOP { [<ident>* % \s]\n } }.parse: qq{foo bar\n} 10:37
camelia Nil
grondilu ^why doesn't that parse?
m: say grammar { rule TOP { foo\n } }.parse: qq{foo\n} 10:46
camelia 「foo
nemokosch not using rules is always a safe choice
this whole "sigspace" business does more harm than good tbh
grondilu m: say grammar { regex TOP { [<ident>* % \s]\n } }.parse: qq{foo bar\n}
camelia 「foo bar

ident => 「foo」
ident => 「bar」
andinus rakudo.org/downloads is up, i restored some old binaries, rakudo.org/downloads/star is up as well 11:19
librasteve 👍 11:29
xinming Is it possible to import defined constants from c header files? 11:46
Or we need to duplicate all these definitions in raku again?
ab5tract No way to import directly, no. 11:50
xinming ab5tract: Ok, thanks. what is the best practise to import then? Writing in c, and regex to extract the define values? 13:13
ab5tract It’s pretty common to parse them. Others just copy paste and correct to Raku’s syntax, doing it manually. 13:15
When you parse the C header, you use a grammar to generate Raku as output 13:16
Then the generated output is your library 13:17
xinming ab5tract: Is there lib for this purpose?
ab5tract That’s how I’ve seen it done, when parsed.
There is one called gptrixie though it is bit unpolished and out of date 13:18
xinming ab5tract: thanks, will use them as long as it works. No need for the polished things. 13:19
ab5tract you might look at what vushu is doing in this library: github.com/vushu/raylib-raku
In case you run into issues with gptrixie 13:20
xinming Ok, thanks, I try to use raku to control 51 mcu for fun. 13:21
ab5tract What is 51 mcu?
xinming ab5tract: 8051 micro controller. 13:22
mcs-51
ab5tract ah, cool!
I hope you have lots of fun hacking on it in Raku! Consider keeping us posted with any problems and progress :) 13:23
xinming ab5tract: will trouble here, But probably be a slow progress :-) 13:24
SmokeMachine Hi there! Does anyone know why I had to add `no precompilation` here (github.com/FCO/HTML-Component/blob...t.rakumod) to make it return the same “object” every time I used it? I feel like it should work without that… is that a bug? 19:12
holmdunc The interesting thing about Raylib specifically is that they provide a complete description of their C API as JSON github.com/raysan5/raylib/blob/mas...b_api.json , meaning source code for a binding can simply be generated in a data-driven way 19:26
.vushu yes i noticed this to, but it is only done for raylib, but isnt done for raygui which I also try to tackle 😊 19:39
tbrowder__ SmokeMachine: is that supposed to be somthing like a singleton? 20:23
SmokeMachine tbrowder__: yes 20:26
tbrowder__ docs describe how to do that
i don't think you need method new, for one thing 20:27
sorry, it does show a new method. the example is "class Singleton" 20:29
SmokeMachine I have tried many different ways… as just a class, with new using anonymous variable, with a my variable inside the class…
tbrowder__ i just searched for "singleton" in the docs box
don't know if that will help 20:30
yr use case
SmokeMachine Just saw that on the docs… I tried that way too… 20:31
That works if I `use` it only in 1 file… but returns a different object when `use`ing it from different files 20:33
ugexe fwiw i'm not sure i'd use //= since parallel calls to new could result in a situation where the definedness check is false for two threads, and so both end up setting the value 20:37
that wouldn't be related to your stated problem though 20:38
(you could also just put a lock around the use of //=) 20:41
SmokeMachine I’ll try with a lock, but I’m not sure if that’s it on this case… 20:42
ugexe class Foo { my $cached-self; my $cached-self-lock = Lock.new; method new { $cached-self-lock.protect({ return $cached-self //= self.bless }) } } 20:43
thats probably how i would have written that type of logic, although i'm not sure if its actually any better 20:44
SmokeMachine I tried with a class like this as well: class Bla { my @bles; method push(|c) { @bles.push: |c }
SmokeMachine no luck with the lock... :( 20:59
ugexe: ^^ 21:00
ab5tract .vushu is raygui included in the raylib-raku distribution? 21:29
.vushu ab5stract im still working on it and have yet not release anything, but have made progress, i think im making a seperate module for it 🙂 21:32
ab5tract Ok! I had fun playing around with raylib-raku today. Even got into shaders a bit. That’s one powerful little header file Ray has put together. And your wrapper to it feels very idiomatic 22:11
.vushu ab5tract indeed raylib is a very cool library, nice that you enjoy the wrapper 😊 22:25
librasteve so the Singleton in the docs (docs.raku.org/language/classtut#Cl...variables) is not thread safe I guess... maybe that could be improved with an ⚛️ class variable? 22:41
fwiw that example also needs to have (or reinstate) the way to get the instance object ie. my $obj = Singleton.instance; 22:51
anyway it needs someone a bit sharper than me on the atomic safety side to make a doc issue since I will likely butcher it 22:52