🦋 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:00
reportable6 left
00:01
reportable6 joined
00:39
euandreh left
00:40
euandreh joined
01:04
xinming left
01:05
xinming joined
|
|||
tbrowder__ | read...as my grandkids would say, "awesome!" | 01:13 | |
01:17
zara joined
01:27
zara left
01:36
jdv_ joined
01:41
jpn joined
01:42
camelia left,
jdv left,
user___ left,
dcx left
01:46
jpn left
01:48
camelia joined,
user___ joined,
dcx joined,
dcx left,
dcx joined
02:06
derpydoo left
02:17
derpydoo joined
02:18
teatwo left,
teatwo joined
02:31
derpydoo left
02:46
Xliff_ left
02:55
derpydoo joined,
tea3po joined
02:58
teatwo left
03:04
jrjsmrtn joined
03:08
jrjsmrtn left
03:10
jrjsmrtn joined,
codesections left,
jrjsmrtn left
03:13
jrjsmrtn joined
03:14
jrjsmrtn left
03:15
jrjsmrtn joined
03:16
jrjsmrtn left
03:18
jrjsmrtn joined
03:29
jpn joined
03:34
jpn left
03:53
codesections joined
03:56
rf left
04:56
nativecallable6 left,
linkable6 left,
statisfiable6 left,
shareable6 left,
bisectable6 left,
benchable6 left,
squashable6 left,
evalable6 left,
unicodable6 left,
bloatable6 left,
quotable6 left,
notable6 left,
reportable6 left,
greppable6 left,
releasable6 left,
tellable6 left,
committable6 left,
sourceable6 left,
coverable6 left
04:57
bloatable6 joined,
bisectable6 joined,
greppable6 joined,
squashable6 joined,
shareable6 joined,
evalable6 joined
04:58
tellable6 joined,
quotable6 joined,
benchable6 joined,
reportable6 joined,
unicodable6 joined,
coverable6 joined,
releasable6 joined,
sourceable6 joined
04:59
committable6 joined,
notable6 joined,
statisfiable6 joined,
nativecallable6 joined,
linkable6 joined
05:01
jpn joined
05:08
jpn left
06:00
reportable6 left
06:02
reportable6 joined
06:17
jpn joined
06:22
jpn left
07:07
jpn joined
07:15
jpn left
|
|||
Geth | advent: a8b9c551f5 | (Tom Browder)++ | 2 files prep for the upcoming season |
07:38 | |
advent: 409f774036 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 2 files Merge pull request #106 from tbrowder/raku-advent-2023 prep for the upcoming season |
|||
08:08
jpn joined
08:13
jpn left
09:02
sena_kun joined
09:27
Manifest0 joined
09:44
Sgeo left
10:38
whatnext joined
|
|||
whatnext | hello raku community :D | 10:38 | |
quick and very basic question - but something I have neglected to find an answer to and now have become irritated with my ugly workaround | 10:39 | ||
in perl5 I can do `my ($var1, $var2) = something_returning_an_array();` | 10:40 | ||
in raku I seem to end up writing `my @array = something_returning_an_arrray();` and then picking `$var1` and `$var2` out of `@array` because the same construction doesn't seem to work | 10:42 | ||
or does it? | |||
what should I be writing to immediately pick up the list elements after the sub call ? | 10:43 | ||
thanks for any help :) | |||
lizmat | m: sub a() { [1,2,3] }; my ($a,$b) = a; say $a; say $b | 10:47 | |
camelia | 1 2 |
||
lizmat | whatnext: this just works ? ^^ | ||
whatnext | hm... maybe I am returning the value from the sub in the wrong way | 10:49 | |
so what is the difference if the return value is in parentheses `(` and `)` ? | 10:51 | ||
lizmat | no difference, you can even leave off the parentheses | 10:52 | |
m: sub a() { 1,2,3 }; my ($a,$b) = a; say $a; say $b | |||
camelia | 1 2 |
||
lizmat | as the list builder is the comma, not the parentheses | ||
note, that the single argument rule applies here. If you would return 2 lists, the first would wind up in $a, and the second in $b | 10:53 | ||
m: sub a() { (1,2,3),(4,5,6) }; my ($a,$b) = a; say $a; say $b | |||
camelia | (1 2 3) (4 5 6) |
||
whatnext | hm that's strange... that is what I would expect based on the docs, and obviously it does work in your example | 10:55 | |
lizmat | maybe you think the something returns an array, but it doesn't? | 10:57 | |
whatnext | maybe my problem is indirectly resolved by changing the format | ||
well, the error is `Stringification of a Buf is not done with 'Stringy'. The 'decode' | 10:58 | ||
method should be used to convert a Buf to a Str.` | |||
which admittedly doesn't look like anything related to arrays at all | |||
lizmat | a Buf is not an array. It does do the Positional role, but is *not* Iterable | ||
m: dd Buf ~~ Iterable | 10:59 | ||
camelia | Bool::False | ||
lizmat | hmmm... | 11:00 | |
whatnext | yes... none of the variables are supposed to be Buf though - and if I construct it the second way I mentioned, I don't get an issue | 11:01 | |
only the `my ($var1, $var2) = ...` construction seems to result in an issue | |||
lizmat | without more clues I cannot tell you what the problem is: could you create a gist of your code somewhere? | 11:02 | |
whatnext | ok thanks v much for your help | 11:05 | |
its a bit tricky to put in a gist because the relevant code spans several modules | 11:06 | ||
what I will need to do is try and reduce it down | 11:07 | ||
I will get back to you if/when I manage to do that :) | |||
thanks again | |||
lizmat | you're welcome :-) | 11:08 | |
11:10
codesections left
11:27
derpydoo left
12:00
reportable6 left,
reportable6 joined
12:19
jpn joined
12:24
jpn left
12:26
derpydoo joined
12:38
whatnext left
12:44
xinming left
12:45
xinming joined
13:14
jpn joined
13:21
jpn left
13:36
euandreh left
14:06
jpn joined
14:17
euandreh joined
14:19
tea3po left,
tea3po joined
14:22
tea3po left,
tea3po joined
14:29
tea3po left,
tea3po joined
14:37
jpn left
14:39
jpn joined
14:45
jpn left
14:53
jpn joined
15:01
euandreh left
15:13
euandreh joined
15:15
euandreh left
15:16
euandreh joined
15:45
euandreh left
15:56
derpydoo left
16:26
jpn left
17:16
jpn joined
17:34
a3r0 left,
a3r0 joined,
jpn left
17:45
jpn joined
18:00
reportable6 left
18:03
reportable6 joined
18:38
jpn left
|
|||
lizmat is on a roll: dev.to/lizmat/so-why-is-there-raku...place-5bga | 18:44 | ||
SmokeMachine | I don't know if anyone here have ever used nats (nats.io) or would be interested in this, but I've been playing on writing a Raku client for it. It's very far to be done or good, but would someone like to take a look/critic/help? github.com/FCO/nats | 18:46 | |
I've tried to do an API based on Cro as an option to use supplies directly. | 18:49 | ||
lizmat | question: so this is a sort of reversed memcached? | 18:50 | |
SmokeMachine | lizmat: no, its a "queue" system (like rabbitmq) that also has the option to store the messages (like kafka) and has a simple way to use request-response (so it can "replace" REST/HTTP) and because one subscribes to a subject, it can be used with out need of a service discovery... between other stuff.. | 18:56 | |
lizmat: but it also have a key/value store on that, so yes, it can be a replace to memcache | |||
so, for example: gist.github.com/FCO/a366eb93c00859...0cb50558c2 | 19:01 | ||
19:04
Sgeo joined
|
|||
SmokeMachine | lizmat: docs.nats.io/nats-concepts/what-is-nats | 19:05 | |
lizmat: make sense? | 19:10 | ||
lizmat | yes, feels a bit like CORBA: en.wikipedia.org/wiki/Common_Objec...chitecture | 19:14 | |
afk& | |||
19:30
japhb left
20:04
jpn joined
20:08
jpn left
20:34
ab5tract joined
|
|||
Xliff | \o | 20:40 | |
A bit off topic, but does anyone here know OpenGL? | |||
20:49
Manifest0 left
|
|||
librasteve | i'm slightly adrift from micro services and go-micro and so on, but I gather that nats is a popular microservices comms framework and it looks as if your module does a very nice, clean mapping to the core raku view of 'react', 'whenever', 'supply' and so on | 21:38 | |
i suppose that we should be keen to have a way to do the micro stack set out here blog.micro.mu/2016/04/11/micro-on-nats.html by asim aslan and so to do the stack chart here web.archive.org/web/20160323214006...icro/micro | 21:41 | ||
21:43
derpydoo joined
|
|||
so kudos to your module to make raku play (with Go?) and so on in this world - but I wonder how I can set up a raku microservice on eg AWS Lambda | 21:43 | ||
avuserow | I think you can run docker containers on AWS lambda these days. That's probably the easiest way to get everything packaged. | 21:44 | |
librasteve | holy cow, I thought you had to load in Java or Python source | 21:50 | |
so raku + AWS/lambda/dockerfile + nats would be quite a nice cookbook | 21:53 | ||
SmokeMachine | librasteve: thank you. The links you sent didn’t open here… :( | 21:55 | |
AWS lambda accepts layers to your lambda where you could add Raku… | 21:57 | ||
librasteve | github.com/micro/micro | 21:58 | |
SmokeMachine | docs.aws.amazon.com/lambda/latest/...ayers.html | ||
librasteve | nats.io/blog/microonnats/ | 21:59 | |
is there a general raku layer? | 22:00 | ||
sorry must sleep | 22:04 | ||
22:07
derpydoo left
22:13
Xliff left
22:26
sena_kun left
22:50
sena_kun joined
|
|||
coleman | SmokeMachine: I'm a huge NATS fan | 22:50 | |
I have wanted a client for a while | 22:52 | ||
22:52
sena_kun left
|
|||
coleman | I will take a look | 22:52 | |
23:02
ab5tract left
23:19
Tirifto left
|
|||
SmokeMachine | coleman: I’ve never used that… just knew about that… but really liking what I’m seeing. My client is still in very early stages… most of features missing and no tests at all (yet) | 23:35 | |
coleman: but, please, take a look! And let me know if there is any suggestion/critic | 23:38 | ||
uzl[m] | > you cannot assign to a sigilless variable, but binding to one doesn't enforce a context | ||
moritz Thanks but I'm still unclear why you can re-assign to a sigilless variable assigned an `Array`. Is it because an `Array` is basically a container? | |||
m: my \a = [1, 2]; say a; a = [3, 4]; say a; | 23:39 | ||
camelia | [1 2] [3 4] |
||
gfldex | m: Array.^can('STORE')».raku.say; | 23:41 | |
camelia | (proto method STORE (Array:D: |) {*} proto method STORE (List:D: |) {*}) | ||
gfldex | uzl[m]: looks like it ^^^ | 23:42 | |
uzl[m] | Got it! Would it be fair to say you can re-assign to a sigilless variable as long as what you declare it with has a container? Case in point, an Array. | 23:46 | |
This section (docs.raku.org/language/variables#S...variables) in the docs makes it seem as this shouldn't be possible but that's simply because an Int, which is used as an example, isn't a container: | |||
>Note that sigilless variable do not have associated containers. This means degrees and θ, above, actually directly represent Nums. To illustrate, try assigning to one after you've defined it: | |||
tbrowder__: Thanks for the link :) | 23:47 | ||
gfldex | m: constant const = $; const.say; const = 42; const.say; | 23:48 | |
camelia | (Any) 42 |
||
gfldex | m: constant const = $; const := $; | 23:49 | |
camelia | ===SORRY!=== Error while compiling <tmp> Cannot bind to 'const' because it is a term and terms cannot be rebound at <tmp>:1 ------> constant const = $; const := $⏏; |
||
gfldex | The binding is constant, not the value that the symbol is bound to. | ||
uzl[m] | Ahhh this makes sense! I tend to forget assignment in Raku is driven through containers thus it'd make sense why you can assign to a sigilless variable first assigned an Array. Now the binding is constant as you said | 23:53 | |
I was like "why can I do a re-assignment but not a re-binding?" lol | |||
Thanks, this clears things up for me! |