🦋 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:15
yewscion joined
00:17
yewscion left
00:54
[Coke] left
01:03
[Coke] joined
|
|||
tbrowder | melezhik: thank you for the link | 01:20 | |
tellable6 | tbrowder, I'll pass your message to melezhik | ||
01:33
Guest1 joined
02:15
hulk joined,
kylese left
02:25
Guest1 left
02:44
yewscion joined
02:47
yewscion left
02:54
ulipink joined
03:01
yewscion joined
03:04
yewscion left
03:08
ulipink left
03:15
hulk left
03:16
kylese joined
03:20
yewscion joined
03:24
yewscion left
03:27
ulipink joined
04:10
ulipink left
04:22
yewscion joined
04:24
yewscion left
04:27
yewscion joined
04:30
yewscion left
05:03
yewscion joined
05:06
yewscion left
05:28
yewscion joined
05:31
yewscion left
06:23
yewscion joined
06:27
yewscion left
06:30
yewscion joined
06:33
yewscion left
07:39
yewscion joined
07:42
yewscion left
07:52
derpydoo joined
08:11
jjido joined
08:35
yewscion joined
08:38
yewscion left
08:53
yewscion joined
08:55
dakkar joined,
yewscion left
09:21
melezhik joined
|
|||
melezhik | . | 09:21 | |
tellable6 | 2025-02-06T01:20:37Z #raku <tbrowder> melezhik: thank you for the link | ||
melezhik | tbrowder: yw | 09:24 | |
09:30
melezhik left
09:33
melezhik joined
|
|||
melezhik | . | 09:33 | |
09:38
melezhik left
09:43
sena_kun joined
09:46
jjido left
09:58
jjido joined
10:01
Sgeo left
10:05
jjido left
10:11
sena_kun left
10:12
sena_kun joined
10:21
swaggboi left
10:44
jpn joined
11:48
kjp left,
kjp_ joined
11:51
jpn_ joined
11:54
jpn left
12:05
jpn_ left
|
|||
librasteve | melezhik: thanks for these links ... I think that the template one is the bit of information that I was missing in my head ... now I see that the DSL is intended for remote actions via ssh to the target | 12:08 | |
tellable6 | librasteve, I'll pass your message to melezhik | ||
librasteve | is there a cookbook example of running docker-compose on the target ... for example this is my WP docker-compose.yaml github.com/librasteve/raku-CLI-Wor...mpose.yaml | 12:11 | |
(Currently I am most interested in running Cro instead of WP on the target so an example of that would be perfect) | |||
I am also considering Caddy instead of nginx to improve the letsenscrypt process | 12:13 | ||
12:23
jpn joined
12:36
derpydoo left
|
|||
tbrowder | librasteve: thnx for reminder of Caddy, but Apache has a module that also manages Let's Encrypt painlessly. | 12:37 | |
just have a cron job that reboots Apache weekly (for my sites) in the wee hours of the weekend. | 12:39 | ||
12:54
Aedil joined
|
|||
timo | apache should support config file reloading without a reboot | 12:57 | |
tbrowder | not in this case because of the hands-off secure interaction required with lets encrypt. it takes a couple of two-way comms that i don't fully understand any more. | 13:03 | |
it's more than a config reload | 13:04 | ||
13:06
jpn left
|
|||
tbrowder | if all sites have the same cert date, then a 60-day reboot should be optimal | 13:09 | |
13:11
jpn joined
13:16
jpn left
13:31
melezhik joined
|
|||
melezhik | . | 13:31 | |
tellable6 | 2025-02-06T12:08:46Z #raku <librasteve> melezhik: thanks for these links ... I think that the template one is the bit of information that I was missing in my head ... now I see that the DSL is intended for remote actions via ssh to the target | ||
melezhik | librasteve: right, just make it sure you've installed the latest version of Sparrowdo , I've fixed few bug recently and released | 13:32 | |
also if you are into docker thins, sparrowdo could deploy things on docker via ssh as well | 13:33 | ||
things | 13:34 | ||
tbrowder | it's tax time in the US and i just found a MIT licensed python program on GitHub that might be a good candidate for a Raku makeover for Raku marketing. it's called "tenforty" and can tie in with chatgpt and Jupyter notebooks. it is designed to test tax scenarios for ranges of tax inputs and choices. see <github.com/mmacpherson/tenforty> | 13:37 | |
13:51
jpn joined
14:02
jpn left
14:06
jpn joined
14:20
ulipink joined,
ulipink left,
ulipink joined,
melezhik left
14:23
nil78 left,
nil78 joined
14:25
melezhik joined
|
|||
melezhik | what are popular template engine in Raku you might know? | 14:26 | |
I am thinking using one of those for Sparrow DSL | |||
jdv | raku? | ||
melezhik | yes | 14:27 | |
jdv | no, i mean that can be a templating engine:) | ||
melezhik | ah. ))) | 14:28 | |
I still need templates somewhere ))) | |||
looking for this raku.land/?q=templater | |||
jdv | just curious - why? | 14:29 | |
i've never done any real templating i guess in raku. but i did write a xml etl tool once upon a time in raku and i used raku as the template lang | |||
the nitty gritty of formatting was a little annoying but once figured out it was done and dusted | 14:30 | ||
14:30
ulipink left
|
|||
melezhik | cause templates are convenient pattern for some class of problems/systems | 14:31 | |
for example in configuration management | |||
jdv | ok. one can create "templates" in raku. maybe our definitions of templates are different | 14:32 | |
melezhik | I get that all could be done in Raku, but I am talking about a library, I don't want to create my own solution every time | ||
14:32
yewscion joined
|
|||
melezhik | template is basically is DSL which is rendered by some underlying programming language , should it be Raku or anything else, the stress on DSL | 14:33 | |
[Coke] | search for "template" not "templater" ? | 14:39 | |
cro.raku.org/docs/reference/cro-we...ate-syntax ? | 14:41 | ||
melezhik | yup, I know that thanks, I am not sure if it's possible to reuse this module as is without cro ... 🤔 | 14:43 | |
14:44
ulipink joined
|
|||
[Coke] | Template::Mustache? | 14:44 | |
melezhik | Template::Mustache looks good, the only concern it not actively maintained , judging by the last update date | 14:46 | |
14:49
ulipink left
14:53
yewscion left
14:57
melezhik left
|
|||
jdv | there's always inline::perl5 and the dozens of options over there:) | 14:58 | |
librasteve | yeah I have once used Template::Mustache for assembling up spam emails and sending them to LLM to fuzzify | ||
historically (ie with perl) I always leaned to Template::Toolkit | 14:59 | ||
15:04
ulipink joined,
ulipink left,
ulipink joined
|
|||
[Coke] | github.com/raku-community-modules/template6 ? | 15:04 | |
patrickb | Most template engines are small to medium sized projects. I wouldn't worry much about being actively maintained. Usually such projects either do their job fine, or are easily fixed up. | 15:05 | |
15:05
jjido joined
|
|||
librasteve | ^^ ++ ... maybe a couple of the more obvious ones would be good candidates for community modules | 15:05 | |
oh - I see already has been | 15:07 | ||
for Template6 | |||
15:24
ulipink left
15:29
jjido left
15:30
yewscion joined
15:54
ulipink joined,
ulipink left,
ulipink joined
15:58
ulipink left
16:23
vrurg left,
yewscion left
16:33
vrurg joined
16:37
ulipink joined
16:44
ulipink left
16:49
wafflus joined
17:03
jpn left
17:06
jpn joined
|
|||
wafflus | what does $() do like why is $(5) an int but $(1,2) a scaler and not an int | 17:09 | |
tellable6 | 2024-05-17T22:30:51Z #raku <ab5tract> wafflus: regex is not the approach to take for checking elements | ||
2024-05-17T22:35:06Z #raku <ab5tract> wafflus: It’s like taking an entire type system and stringifying it :) | |||
wafflus | i mean not a list | 17:11 | |
17:11
swaggboi joined
17:13
yewscion joined
17:15
jpn left
17:16
jpn joined,
ulipink joined,
ulipink left,
ulipink joined
|
|||
wafflus | :m say "test" | 17:17 | |
librasteve | m: say "test" | 17:19 | |
evalable6 | test | ||
Raku eval | test | ||
librasteve | (the colon goes after the m ;-) ) | 17:20 | |
17:20
ulipink left
|
|||
to place a $ dollar sign before something is to itemize it (ie that places the thing into a Scalar container that can eg. be passed like a reference to a subroutine) | 17:21 | ||
wafflus | yes but why is it sometimes the scaler and them sometimes an int | 17:23 | |
and not the same for an array or a list | |||
librasteve | can you share some example code please | ||
17:23
Sgeo joined,
jpn left
|
|||
wafflus | k | 17:23 | |
one minute | 17:24 | ||
librasteve | tx | ||
m: say (1, 2, 3).VAR ~~ Scalar; | 17:26 | ||
evalable6 | False | ||
Raku eval | False | ||
librasteve | m: say $(1, 2, 3).VAR ~~ Scalar; | ||
Raku eval | True | ||
evalable6 | True | ||
librasteve | .VAR is a special method that gives you back the container of something (if there is one) docs.raku.org/syntax/VAR | 17:27 | |
Usually the container is transparent to operations, such as type checking (which is why I would like to see your code) | 17:28 | ||
m: say (1, 2, 3) ~~ List | 17:29 | ||
Raku eval | True | ||
evalable6 | True | ||
librasteve | m: say $(1, 2, 3) ~~ List | ||
evalable6 | True | ||
Raku eval | True | ||
wafflus | pastebin.com/6NcekJTm | 17:31 | |
just based each section into the terminal | |||
sorry i wrote it in emacs and it doesnt paste so well | |||
librasteve | tx! | 17:33 | |
wafflus | like for instance if this is a string $("pear") then should this not be an $([1,2]) array or should both not be scalars? | ||
librasteve | you are asking .VAR.WHAT ... | 17:35 | |
wafflus | yes sorry | ||
librasteve | what do you predict happens when you call .VAR on something without a container? | 17:37 | |
wafflus | well not tbh it seems to be both sometimes it hard to know | 17:39 | |
17:39
ulipink joined,
ulipink left,
ulipink joined
|
|||
librasteve | lets try it, here's something with a container... | 17:39 | |
wafflus | might have something to do with the brackets as well | 17:41 | |
librasteve | ...checking | 17:43 | |
wafflus | m: my \a = $(5); say a | 17:44 | |
camelia | 5 | ||
wafflus | m: my \a = $(5); say a.VAR.WHAT | ||
17:44
ulipink left
|
|||
camelia | (Int) | 17:44 | |
wafflus | i'm thinking it converts the values on the left to a scaler and then does the binding or assigment? | 17:45 | |
when you use my(\a,\b) | |||
17:46
dakkar left
|
|||
librasteve | ok - here's what i think is going on and causing confusion | 17:46 | |
wafflus | i am also not sure the difference between \a = and \a := i always thought they did the same thing | 17:49 | |
taht they always bind | |||
librasteve | if you go $(THING) then this does not itemize the THING if it is just a single thing - if its a list then is does get itemized | ||
wafflus | ok | 17:50 | |
so only a list will get converted? | |||
or an array | |||
etc | |||
? | |||
librasteve | I think that $() is shorthand for .item as documented here docs.raku.org/type/Mu#method_item | 17:53 | |
that says Forces the invocant to be evaluated in item context and returns the value of it. | 17:54 | ||
since the exceptions you have shared are single items already such as Str or Int, then this is a null operation for them | 17:55 | ||
wafflus | ah ok ty it just confusing when the literal is something and then when i bind to it it ends up as a scalar | ||
librasteve | ok so now these single things (literals) can be bound or assigned to dollar or sigilless variables | 17:56 | |
as you know, binding := simply associates the symbol on the left with the item on the right - no container is inserted | 17:57 | ||
and assignment to a dollar variable, my $x; $x=42; will make a copy of the rhs and place in the container on the left (so this is why when there is an assignment there is now a container) | 17:58 | ||
17:58
ulipink joined,
ulipink left,
ulipink joined
|
|||
BUT there is no such thing as assignment to a sigilless variable | 17:59 | ||
m: my \x = 42; x=43; say x | |||
evalable6 | (exit code 1) Cannot modify an immutable Int (42) in block <unit> at /tmp/CanfPw63Jv line 1 |
||
Raku eval | Exit code: 1 Cannot modify an immutable Int (42) in block <unit> at main.raku line 1 | ||
wafflus | ok | ||
librasteve | You can use = in a declaration however, but that means "evaluate the rhs and then set the symbol to point to it" | 18:01 | |
18:01
jjido joined
|
|||
so I think that raku lets you make the container on the rhs with eg $(1) and then binds the symbol to the container when you do that | 18:02 | ||
18:03
ulipink left
|
|||
wafflus | ah ok tyi | 18:03 | |
librasteve | got there in the end! | ||
wafflus | i think the () brackets at the left of the assingment change it as well | 18:04 | |
librasteve | oh - lemme see | ||
wafflus | i mean maybe non of this is of any importance i just like to be able to expalin what happaning even if it is just to my self | 18:07 | |
librasteve | I'm not sure ... this multiple declaration is like a sub routine call with a list on the right and a capture on the left - my initial tests suggest that there is no difference but I may have missed a wrinkle | ||
yeah - I know the feeling | 18:08 | ||
increasingly I think that raku is like those turtle pictures where most regular features on built on a set of composable primitives ("all the way down") | 18:09 | ||
wafflus | :) | ||
lizmat | m: dd 42.item.VAR | 18:10 | |
camelia | 42 | ||
librasteve | in this case, you have the primitives of containers, of sigils, of assignment and of binding ... and now you can combine these in many ways to get the job done in the most efficient way | ||
lizmat | m: dd Date.today.item.VAR | ||
camelia | Date.new(2025,2,6) | ||
wafflus | m: my \ba = $(44) say ba.VAR.WHAT; my (\ta) = 5; say ta.VAR.WHAT ; | 18:11 | |
camelia | ===SORRY!=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> my \ba = $(44)<HERE> say ba.VAR.WHAT; my (\ta) = 5; say ta.V expecting any of: infix infix stopper postfix statement end… |
||
lizmat | hmmm | ||
wafflus | m: my \ba = $(44); say ba.VAR.WHAT; my (\ta) = 5; say ta.VAR.WHAT ; | ||
camelia | (Int) (Scalar) |
||
librasteve | [now lizmat is going to come and explain what's really going on ;-)] | ||
wafflus | big guns | 18:12 | |
ty librasteve | |||
lizmat | well, not really, I'm afraid | ||
wafflus | btw its the same with $var binding will also bind to a scaler and not the int | 18:13 | |
lizmat | I vaguely remember a discussion before (even in Rakudo issues) as to why $(scalar value) doesn't return a container | ||
fact is that the item method: | 18:14 | ||
method item(Mu \item:) is raw { item } | |||
doesn't add a container (nor does it remove it | |||
and $(foo) codegens to foo.item | 18:15 | ||
however, the item sub *does* containerize | |||
m: dd (item 42).VAR | |||
camelia | 42 | ||
librasteve | say [1,2,3].item.raku; # OUTPUT: «$[1, 2, 3]» <=== from the docs | ||
lizmat | huh | ||
m: dd (item 42) | |||
camelia | 42 | ||
librasteve | oh - yes I see | 18:16 | |
lizmat | hmmm.. apparently it selects this candidate: multi sub item(Mu $a) { $a } | ||
which would actually de-containerize" | 18:17 | ||
m: my $a = 42; dd $a, item($a) | |||
camelia | $a = 42 42 |
||
lizmat | yu[ | ||
yup weird | |||
m: my $a = 42; dd $a.VAR, item($a).VAR | |||
camelia | 42 42 |
||
18:17
ulipink joined
|
|||
lizmat | m: my $a = 42; dd $a.VAR.^name, item($a).VAR.^name | 18:18 | |
camelia | "Scalar" "Int" |
||
lizmat | m: my $a = 42; dd $a.VAR.^name, $a.item.VAR.^name | ||
camelia | "Scalar" "Scalar" |
||
lizmat | m: my $a = 42; dd $a.VAR.^name, 42.item.VAR.^name | ||
camelia | "Scalar" "Int" |
||
lizmat | looks like commit b0caab5b reverted a change before | 18:20 | |
github.com/rakudo/rakudo/commit/b0caab5b | 18:21 | ||
I don't recall why it was reverted, but judging from the day in the month, it could well be because of ecosystem breakage | 18:22 | ||
18:22
ulipink left
|
|||
wafflus | kind of confusing for amateurs like me :) | 18:23 | |
lizmat | I completely agree, and maybe we should revisit that before the 2025.02 release | ||
[Coke] jdv what are your feelings / recollections about this ? | |||
librasteve | .oO | 18:24 | |
wafflus | question are you guys more focused on backcompat or would you make changes and break back compat if it made the language more consitant? | 18:26 | |
lizmat | back compat is important! | ||
so most probably if we're going to fix this, it's probably in language version 6.e | |||
to which you would have to opt-in at the moment | 18:27 | ||
wafflus | cool i think when you are smaller its easier to break compant if the change would be a benefit? but maybe a big language is is harder to break than compat? | ||
i image perl is different than raku it that regards? | 18:28 | ||
lizmat | well, that's why we have language levels in Raku | ||
if you specify a certain language level in your code, you're guaranteed the same semantics as long as that language level is supported by Raku | |||
librasteve | so does multi sub item(|c) {...} get selected on multiple arguments? | ||
wafflus | cool just sometime i think you guys give too much ways to do things | 18:29 | |
lizmat | librasteve I think ik does | ||
*it | |||
wafflus: yes, I agree... that's the heritage I'm afraid | |||
librasteve | its the anti python | ||
lizmat | for example: I wouldn't be against having named arguments only be specifiable with the colon syntax | 18:30 | |
and not with the fat comma syntax | |||
wafflus | but it so wide!! | ||
lizmat | and have the fat comma syntax generate positional Pair arguments *always* | ||
librasteve | I think its nice to have options ... to the extent that raku is akin to a natural language, we humans are used to having many, many ways to say the same thing and then to select for nuance and emphasis | 18:32 | |
lizmat: you would drop Thing.new: name => value; eh? | 18:33 | ||
lizmat | yup, only Thing.new: :name(value) | ||
you see: Thing.new: "name" => value | 18:34 | ||
already produces a positional Pair | |||
librasteve | fwiw... I think that having a bit fat arrow can help when there is a lot of data to ingest ... I agree that the colon syntax is neater | ||
lizmat | m: sub a(|c) { dd c }; a foo => 42; a :foo(42); a "foo" => 42 | ||
camelia | \(:foo(42)) \(:foo(42)) \("foo" => 42) |
||
wafflus | is there a way to write :foo(42) it without using the brackets? | 18:35 | |
lizmat | if it's a numeric value, you can write :42foo | ||
m: sub a(|c) { dd c }; a foo => 42; a :foo(42); a "foo" => 42; a :42foo | 18:36 | ||
camelia | \(:foo(42)) \(:foo(42)) \("foo" => 42) \(:foo(42)) |
||
librasteve | wafflus: now you do want another way - lol | ||
wafflus | typing () annyoing | ||
:) | |||
lizmat | the idea behind allowing :42foo is that you could have a :$th named argument, and write :5th | ||
librasteve | kind of like a positional then | 18:37 | |
ordinal vs cardinal | |||
here's the kind of code where imo a fat arrow helps: my \df = DataFrame.new( data => [[0..3] xx 6], index => (Date.new("2022-01-01"), *+1 ... *)[^6], columns => <A B C D> ); | 18:39 | ||
18:39
ulipink joined,
ulipink left,
ulipink joined
|
|||
lizmat | librasteve the columns case could be shortened to :columns<A B C D> | 18:40 | |
in any case, it doesn't feel like either solution for that code would help readability | |||
putting the data in a @data array first, and the index value in an index varlable, would allow you to do: | 18:41 | ||
my \df = DataFrame.new(:@data, :$index, :columns<A B C D>) | |||
librasteve | btw this is not real code (phew) ... I wanted to exaggerate the fat arrow as a helper in a sea of brackets | 18:42 | |
lizmat | which may be a bit less efficient, but unless it's ultra-hot code, it shouldn't really matter | ||
jdv | huh? you're asking about something from 2021? | 18:43 | |
lizmat | yeah.. wonder if you by chance remember why that revert commit was done | ||
jdv | didn't you do the revert? | 18:44 | |
18:44
ulipink left
|
|||
jdv | that was also before i was rel mgr | 18:44 | |
maby sena_kun barely remembers? :) | 18:45 | ||
lizmat | jdv: I did... but I do a *lot* of commits, and only have a vague recollection of something that happened several 1000 commits ago :- | ||
) | |||
jdv | i don't remember anything about it, sorry. | 18:46 | |
lizmat | no worries! | ||
[Coke] | lizmat,jdv: in general, if you have a "risky" change, get it in ASAP and I'll do a Blin run asap | 18:57 | |
If you're asking more "why did we revert this particular item"... I think you're right as to why | |||
I've only used $2.50 of my azure resources this month so far. :) | 18:58 | ||
lizmat | [Coke]: I was just thinking that maybe we should try to fix this weird discrepancy in 6.e maybe, not that we have revision-gated | ||
[Coke] | +1 | ||
18:59
jjido left
19:16
ulipink joined,
ulipink left,
ulipink joined
19:20
ulipink left
19:25
ulipink joined
19:27
Aedil left
19:28
librasteve_ joined
|
|||
librasteve_ | www.irccloud.com/pastebin/hsBKPkGe | 19:28 | |
19:30
ulipink left
19:31
jjido joined
19:53
wafflus left
20:22
apac joined
20:52
lizmat_ joined
20:54
bisectable6 left,
evalable6 left,
sourceable6 left,
bisectable6 joined,
evalable6 joined
20:55
ecocode left,
ecocode joined,
lizmat left
20:57
sourceable6 joined
21:08
apac left
21:16
jpn joined
21:17
kjp_ left,
kjp joined
|
|||
ugexe | fat arrow provides a better multi-line alignment option | 21:18 | |
one can still do e.g. :foo( 1) but that juts doesnt seem as nice as foo => 1 | |||
i would never write :1foo | 21:19 | ||
21:25
guifa joined
21:52
yewscion_ joined
21:53
yewscion left
21:57
jjido left
21:58
jpn left
22:03
jpn joined
22:15
ryoskzypu left
22:17
ryoskzypu joined
|
|||
sena_kun | jdv, what's the commit we're talking about? :) | 22:18 | |
ab5tract | Couldn’t the distinguishing feature be whether there are any candidate signatures that expect positional Pairs? | 22:21 | |
Eg, fat arrows will still be named args except in the case where they are sent to a signature that expects named args? | 22:22 | ||
It’s more complicated than a 100% clear cut distinction, but at the same time positional Pairs are less common than named args. | 22:25 | ||
22:38
jpn left
22:48
librasteve_ left,
sena_kun left
22:55
sftp_ joined
22:56
sftp left,
sftp_ is now known as sftp
23:00
ryoskzypu left
23:01
ryoskzypu joined
23:15
wafflus joined
23:25
ulipink joined,
ulipink left,
ulipink joined
23:28
yewscion_ left
23:30
yewscion joined
23:41
sftp left
23:42
sftp joined
23:57
yewscion left
23:58
yewscion joined
|