đŚ 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:02
p6steve left,
p6steve_ left
00:06
reportable6 left
00:07
reportable6 joined
00:14
djerius left,
djerius joined,
p6steve joined,
p6steve_ joined
00:19
p6steve left,
p6steve_ left
00:31
p6steve joined
00:35
p6steve left
00:48
p6steve joined
00:53
p6steve left
01:05
p6steve joined
01:06
p6steve_ joined
01:10
p6steve left,
p6steve_ left
01:23
frost joined
01:24
p6steve joined
01:25
p6steve_ joined
01:30
p6steve left,
p6steve_ left
01:38
Kaipi left
01:42
p6steve joined
01:46
p6steve left
01:47
lockywolf left
01:51
lockywolf joined
02:00
p6steve joined
02:01
lockywolf left
02:04
lockywolf joined
02:05
p6steve left
02:14
lockywolf left
02:15
neither left
02:16
p6steve joined,
p6steve_ joined
02:17
lockywolf joined
02:19
[Coke] left
02:20
p6steve left
02:21
p6steve_ left
02:22
[Coke] joined
02:23
lockywolf left
02:27
lockywolf joined
02:33
p6steve joined
02:34
lockywolf left
02:36
lockywolf joined
02:37
p6steve left
02:39
lockywolf left
02:41
lockywolf joined
02:50
p6steve joined,
p6steve_ joined
02:54
p6steve left
02:55
p6steve_ left
03:07
p6steve joined,
p6steve_ joined
03:12
p6steve left,
p6steve_ left
|
|||
Geth | doc: 45b411c093 | Coke++ | util/clean-spell Add env var lets us start just after the last word |
03:25 | |
doc: 57ca3dc737 | Coke++ | xt/pws/words.pws Remove words no longer in use |
|||
03:25
p6steve joined
03:30
p6steve left
|
|||
[Coke] | github.com/Raku/doc/blob/master/ut...-spell#L95 - occasionally when running this script, I'll get an error that the cp command failed. Any idea why that might happen? | 03:33 | |
the disk isn't full, not a permissions problem as far as I can tell | 03:35 | ||
03:42
p6steve_ joined,
p6steve joined
03:46
p6steve left,
p6steve_ left
03:59
p6steve joined
04:00
p6steve_ joined
04:15
p6steve_ left,
p6steve left
04:27
p6steve joined,
p6steve_ joined
04:31
p6steve left
04:32
p6steve_ left
04:42
p6steve joined
04:46
p6steve left
04:53
Kaiepi joined
05:00
p6steve joined
05:04
p6steve left
05:24
atweiden_air-- joined
|
|||
atweiden_air-- | m: role A { has Str:D $.name = prompt("enter name: "); }; class A::B { also does A; has Str:D $.number = prompt("enter number: "); } my A::B $ab .= new; | 05:25 | |
camelia | ===SORRY!=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> D $.number = prompt("enter number: "); }â my A::B $ab .= new; expecting any of: infix inf⌠|
||
atweiden_air-- | how can i initialize A's `$.name` before B's `$.number`? | ||
m: role A { has Str:D $.name = prompt("enter name: "); }; class A::B { also does A; has Str:D $.number = prompt("enter number: "); }; my A::B $ab .= new; | 05:26 | ||
camelia | enter number: enter name: | ||
atweiden_air-- | (without using `is` or class inheritance) | 05:31 | |
05:38
p6steve joined,
p6steve_ joined,
frost left
05:43
p6steve_ left,
p6steve left
05:56
p6steve joined
06:00
p6steve left
06:07
reportable6 left
06:08
reportable6 joined
06:12
p6steve joined
|
|||
CIAvash | using `TWEAK`? | 06:13 | |
`role A { has Str $.name; }; class A::B does A { method TWEAK { $!name = prompt 'enter name: '; $!number = prompt 'enter number: '; }; has Str $.number; }; my A::B $ab .= new;` | 06:14 | ||
06:16
abraxxa joined,
p6steve left
|
|||
CIAvash | or `role A [$name] { has Str $.name = $name; }; class A::B does A[prompt('enter name: ')] { has Str $.number = prompt 'enter number: '; }; my A::B $ab .= new;` | 06:16 | |
but that only happens on class declaration | 06:17 | ||
06:23
abraxxa left,
abraxxa joined
|
|||
CIAvash | or `role A { has Str $.name = prompt 'name: '; }; class A::B does A { method TWEAK { $!number = prompt 'number: ' }; has Str $.number; }; my A::B $ab .= new;` | 06:28 | |
06:30
p6steve joined
06:35
p6steve left
06:47
p6steve joined,
p6steve_ joined
06:51
p6steve left
06:52
p6steve_ left
|
|||
atweiden_air-- | CIAvash thanks | 07:04 | |
why does inheritance DWIM, but not role composition? | |||
m: role A { has Str:D $.name = prompt('enter name: ') }; class A::B is A { has Str:D $.number = prompt('enter number: ') }; my A::B $ab .= new; | |||
camelia | enter name: enter number: | ||
atweiden_air-- | and is there any practical difference between the above, and `s/role A/class A/`: | ||
m: class A { has Str:D $.name = prompt('enter name: ') }; class A::B is A { has Str:D $.number = prompt('enter number: ') }; my A::B $ab .= new; | |||
camelia | enter name: enter number: | ||
07:05
p6steve_ joined,
p6steve joined
07:10
p6steve_ left,
p6steve left
|
|||
CIAvash | I'm not sure, but may be related to compile-time(role?) and run-time(late-binding?) difference | 07:10 | |
07:31
Sgeo left
07:33
mexen joined
07:35
jjido joined
07:41
p6steve_ joined,
p6steve joined
07:45
p6steve_ left,
p6steve left
07:58
p6steve joined,
p6steve_ joined
08:02
p6steve left
08:03
p6steve_ left
08:11
jmcgnh left
08:14
lichtkind_ joined
08:15
p6steve joined
08:20
p6steve left,
jmcgnh joined
08:27
atweiden_air-- left
08:28
p6steve joined
08:29
p6steve_ joined
08:30
jjido left
08:49
frost joined
08:52
jjido joined
08:56
p6steve left,
p6steve_ left
09:08
p6steve joined,
p6steve_ joined
09:23
jjido left
09:41
wingfold joined
10:12
p6steve_ left,
p6steve left
10:24
linkable6 left
10:26
linkable6 joined,
p6steve_ joined,
p6steve joined
10:32
p6steve_ left
10:33
p6steve left,
sena_kun left
10:34
sena_kun joined
10:45
p6steve joined
10:49
p6steve_ joined
11:49
linkable6 left,
evalable6 left
11:50
linkable6 joined
11:52
evalable6 joined
11:57
curiosa joined,
curiosa left
12:06
reportable6 left
12:07
reportable6 joined
12:20
p6steve left,
p6steve_ left
12:34
p6steve joined,
p6steve_ joined
13:34
evalable6 left,
linkable6 left
13:37
linkable6 joined,
evalable6 joined
13:40
linkable6 left
13:42
linkable6 joined
13:48
abraxxa left
13:51
abraxxa joined
|
|||
[Coke] | Huh. I have two windows machines with raku built on each one. One is reporting in task mgr as 32bit, the other is not. | 13:53 | |
13:58
bd3i joined
14:00
bd3i left
14:01
bd3i joined,
bd3i left,
bd3i joined
14:03
jjido joined
14:07
frost left
14:11
Geth left
14:22
Sgeo joined
14:25
coleman joined
|
|||
JRaspass | Is there a more DRY way of doing this? I'm writing a TOML parser in raku, i essentially want a way to evaluate escapes in a string - | 「\b」 { make "\b" } | 「\t」 { make "\t" } | \n, \f, \r, \e, \", \\, etc. | 14:31 | |
lizmat | JRaspass: create a hash with the mapping and do: make %mapper{$/} ?? | 14:34 | |
JRaspass | yeah but then im still repeating it all, i presume this lookup exists in raku, i just want to use it somehow | ||
lizmat | remember that grammars are just code | ||
JRaspass | oh sure, i can use one code block but i don't want to have to repeat the keys, just tell raku to eval it | 14:35 | |
lizmat | just create that hash outside of the scope of the grammar, but lexically visible | ||
JRaspass | but its still repeating it if you see what i mean | ||
lizmat | I guess I need a more elaborate gist to understand better :-) | 14:36 | |
JRaspass | I want to leverage whichever api handles shorthand escapes when parsing a string in raku | 14:37 | |
lizmat | perhaps: match on <[\b\t\n\f\r\e]> and then make %mapper{$/} | ||
JRaspass | yeah its the mapper i want to avoid | ||
thats what i mean by DRY | |||
lizmat | perhaps: match on <[\b\t\n\f\r\e]> and then make ~$/ ?? | 14:38 | |
JRaspass | that won't work, it needs to "parse" the string, ie turn 「\n」 into a literal newline | 14:39 | |
note i'm not matching literal newlines etc, i'm matching escape sequences | |||
hence the funky quotes | |||
14:46
linkable6 left
14:50
linkable6 joined
|
|||
lizmat | ah.. well, short of EVAL I don't think we can do anything like that | 14:53 | |
JRaspass | yeah i was wondering/hoping that was some kind of nqp thing i could use but ta | ||
14:53
coleman left
|
|||
JRaspass | it's basically an unescape | 14:53 | |
14:54
coleman joined
|
|||
lizmat | sorry, nothing comes to mind | 14:55 | |
JRaspass | np, ta | ||
lizmat | perhaps something in module space ? | ||
JRaspass | yeah maybe, it just irks me that the code is somewhere in bowels of rakudo since it has to do it when parsing strings | ||
I went with the mapper in the end, not terrible - | @(keys %escapes) { make %escapes{$/} } | 15:12 | ||
with my constant %escapes = ( 「\b」 => "\b", 「\t」 => "\t", ... ) | 15:13 | ||
15:34
TempIRCLogger left
15:37
Geth joined
15:42
melezhik joined
15:45
qorg11 left,
TempIRCLogger joined
15:47
qorg11 joined
15:49
TempIRCLogger left
15:50
TempIRCLogger joined
15:51
melezhik left
|
|||
lizmat | weekly: news.ycombinator.com/item?id=30918120 | 15:52 | |
notable6 | lizmat, Noted! (weekly) | ||
16:01
abraxxa left
16:22
sena_kun left,
sena_kun joined
16:49
solitario left
16:50
jdv left,
jdv joined
16:54
solitario joined
17:19
jjido left
17:24
jjido joined
17:35
wingfold left
18:04
discord-raku-bot left,
discord-raku-bot joined
18:05
reportable6 left
18:06
reportable6 joined
|
|||
gfldex | weekly: datakinds.github.io/2022/04/06/str...ing-wordle | 18:28 | |
notable6 | gfldex, Noted! (weekly) | ||
18:51
morte_ joined
18:57
jgaz joined
18:59
mexen left
|
|||
Geth | doc/CATCH-tweaks: 1312f06d95 | (Elizabeth Mattijsen)++ | doc/Language/exceptions.pod6 Some tweaks on CATCH In resoponse to github.com/Raku/doc/issues/4049 |
19:10 | |
doc: lizmat++ created pull request #4050: Some tweaks on CATCH |
|||
19:14
melezhik joined
|
|||
melezhik | . | 19:14 | |
19:15
melezhik left
19:37
Kaipi joined
19:38
Kaiepi left
19:41
Kaipi left
20:11
melezhik joined
20:14
melezhik left
20:23
jjido left
20:28
jgaz left
20:40
morte_ left
|
|||
drakonis | is there anything for generating dependency lockfiles? | 21:27 | |
is there anything for generating and fetching lockfiles? | |||
oops | |||
[Coke] | system locks? There is a lock class for locking code for thread-safety. | 21:33 | |
if you want to access something like flockfile() in C, you can use NativeCall, not sure someone has written a wrapper. | 21:35 | ||
drakonis | oh no | 21:38 | |
i meant the kind that you use for pinning dependencies | |||
this isnt even for myself | |||
bundler, npm, cargo are pieces of software that use lockfiles for dependency management and fetching | 21:40 | ||
21:40
evalable6 left,
linkable6 left
21:41
evalable6 joined
21:43
linkable6 joined
|
|||
[Coke] | lizmat: let me know if you want me to fix those examples in the PR | 21:56 | |
drakonis | [Coke]: its a programmatically updated file containing the hashes of dependencies, basically | 21:57 | |
[Coke] | ah, *those* kind of lockfiles | ||
Don't recall seeing anything for those in the ecosystem. | 21:58 | ||
japhb | It's a terrible name for what it does | ||
[Coke]: Doesn't fit with modules being able to declare their own dependency versions. | 21:59 | ||
And for different modules to have different versions of the same dependencies | |||
[Coke] | not sure if they mean "for Raku modules" or "a raku script for managing npm lockfiles" | ||
japhb | Decent point./ | 22:00 | |
[Coke] | there are plenty of JSON utilities in core & ecosystem, however, so you could pretty easily convert from existing lockfile to raku datastructure, or vice versa. | 22:01 | |
drakonis | ha, sure. | ||
i meant raku modules | |||
not a script for managing npm lockfiles | 22:02 | ||
[Coke] | yah, if you have specific Raku module requirements, that's for META6.json | 22:03 | |
22:04
Sgeo left
|
|||
drakonis | its mainly to ensure that i'm fetching specific hashes for each package | 22:05 | |
22:07
Sgeo joined
|
|||
[Coke] | sure, you can specify a specific version/auth in the META6.json - | 22:08 | |
drakonis | so far that doesnt seem like the acceptable solution to my friend | 22:09 | |
but well, i'll figure it out | |||
its all about the reproducibility | 22:12 | ||
[Coke] | docs.raku.org/language/modules#ind...META6.json | 22:13 | |
What are they specifically trying to do? | |||
when you say "specific hashes" do you mean a specific git commit? | 22:14 | ||
drakonis | for the commit, yes, and another for the content in that commit | 22:15 | |
and some tooling to keep it up to date for fetching | |||
[Coke] | fetching is handled by the installer already. | 22:16 | |
(zef0 | |||
(zef) | |||
not sure the syntax for pinning a dep on a specific commit, but I *think* it's possible. anyone? ugexe might know if anyone does. | 22:17 | ||
22:17
melezhik joined
|
|||
japhb | drakonis: Depending on a specific git commit is *already* depending on the content of that commit. | 22:18 | |
drakonis | but only for that specific dependency, yeah? | 22:19 | |
it doesn't propagate to everything? | 22:20 | ||
[Coke] | "everything"? | 22:21 | |
drakonis | the dependency tree | ||
japhb | drakonis: That's why each module has its own META dependencies. Because you depend on an exact version of the module, and it can then depend on the exact version of its dependencies, recursively. | ||
drakonis | output a file containing the whole tree at the time? | ||
[Coke] | I wonder if there is a way to have zef get a specific commit from a git repo URL. you can already do zef install github.com/coke/raku-lingua-en-syllable.git , e.g. | ||
japhb | drakonis: Though for modules that *don't* currently depend on a particular version, I can see how you might want to force them to. | 22:22 | |
drakonis | precisely. | ||
[Coke] | so you'd specify that version in YOUR meta6.json | ||
even though you only depend on it indirectly. | 22:23 | ||
drakonis | i see | ||
[Coke] | so this all works if you pick "version" and not "commit" | ||
japhb | [Coke]: That won't force previously-installed dependencies to change versions. But if you're starting from a scratch rebuild anyway, you can install your top-level module and have it force the versions as you say. | 22:24 | |
Or to be more precise, it won't force previously-precompiled dependencies to now depend on different versions of *their* dependencies. | |||
[Coke] | I think you'd have to clone the repo, check out that commit, zef install from that working dir. but then you don't have that dep in your dep list, and I don't think you can "use" a module that way and have it enforce the fact that it was a specific commit. | ||
japhb: you can install multiple versions of a module. | 22:25 | ||
but since you can't then "use" the very specific one you wanted, I think you'd have two installed and not be able to pick the one you need. | |||
japhb | [Coke]: Yes, I know, that's not what I meant. | 22:26 | |
[Coke] | so: in Raku: if you need a specific version, make sure it has a version. If you have to maintain a local version with a patch... you're the owner, you can require the one with your auth on it. | ||
(previously compiled) yup, that's another issue, my bad. | |||
in general, relying on someone else's repo and not using their released versions is dodgy, anyway. | 22:27 | ||
for the install at least, this should work: 'zef install github.com/coke/raku-lingua-en-syl...f433f.zip' | 22:30 | ||
might be able to list that as the dep itself, not sure. | |||
22:34
johnny joined
|
|||
[Coke] | for the install at least, this should work: 'zef install github.com/coke/raku-lingua-en-syl...f433f.zip' | 22:35 | |
(corrected) | |||
johnny | howdy folks. i was just asking my friend about how one can guarantee such that if if he's working on a project with dep1 requiring at least 1.1 (semver), with it's own dep1_1 = at least 0.9.5 | 22:36 | |
such that if i install it, i will get the exact same contents down to the distribution unit (or commit hash) the exact same files in use | |||
a reproducible build | 22:37 | ||
drakonis | i'm terrible at communication, so i ended linking to the logs | ||
johnny | and also, how can i make sure they are local to the project, and not installed at the system level , unlike at least the way CPAN was used 15 years ago (the last time i used CPAN) | 22:38 | |
system or user really* | |||
22:39
melezhik left
|
|||
[Coke] | in general, if you need that level of control, I do recommend hosting your own modules. (esp if you're using npm for javascript) | 22:48 | |
johnny | i use pdm for python, composer for php, and cargo for rust. i'm pretty familiar wit hthe differences and similarities between these projects | 22:49 | |
[Coke] | (that is, getting a copy, vetting it's safe/what you want, and saving it so you have your own private ecosystem) | ||
johnny | it's not about safety, but reproducibility | ||
how can i guarantee my CI will use the exact same versions of all deps in my code? | 22:50 | ||
[Coke] | specify the version explicitly in your deps. | ||
(version/auth) | 22:51 | ||
johnny | down to the point release? so i can't tkae advantage of semantic versioning? | ||
[Coke] | I don't understand your question. do you want the flexibility to allow minor version changes, or do you want a specific reproducible version? | 22:52 | |
johnny | and that's not taking into account transients . how are those resolved? | ||
let' say i depend on dep1 and it has a wildcard or some other semantic version specificaon | 22:53 | ||
for it's own deps | |||
how do i guarantee that those deps are stuck to which version i prefer without explicitly pinning all the deps of deps or whatever | |||
[Coke] | As far as I know, you'd have to pin them in your deps if you want to ensure you're not getting an upgraded version in a future install. | 22:54 | |
so your META6.json would have the specific versions of not just your direct deps, but their deps as well to maintain the control. | 22:55 | ||
if you have company-wide version requirements that are the same, then hosting your own and updating those as needed is a solution. | 22:56 | ||
johnny | it is indeed a solution | 22:57 | |
[Coke] | if you're installing stuff off the internet, you're not guaranteed you're going to get the same version regardless unless you're also verifying checksums don't change. | ||
johnny | of course i'd be doing that :) | ||
but a local repo wouldn't solve it if we had our own local dev repo.. since it might run into the exact same problems mentioned | |||
since a colleague could publish internal_dep1 at version 1.1.1 and i want internal_dep = 1.1.0, and thus now we're at two lcoal repos | 22:58 | ||
[Coke] | heading offline - best of luck. much of our community is on EU time, so expect some responses as people roll in tomorrow. | 22:59 | |
johnny | well i don't really need an answer, so its' fine | 23:04 | |
drakonis | reproducible-builds.org/ | 23:08 | |
the whole point is to ensure that all users or developers have the exact same data, bit by bit, ensuring maximal reproducibility | 23:11 | ||
23:11
lichtkind_ left
|
|||
japhb | drakonis: Sounds like you want containers. | 23:13 | |
drakonis | ha, maybe? | ||
that's one way to achieve it | |||
fetch all of the relevant sources and place them into a specific environment | 23:14 | ||
japhb | Right | ||
drakonis | guix and nix provide the means to do so without needing containers for builds | ||
its not a priority to write something like guix and nix until i have sufficient raku knowledge | 23:16 | ||
well, enough about this | 23:18 | ||
back to learning the lang | |||
Tirifto | I thought methods mixed in from Roles with âdoesâ went in the method resolution order, in front of inherited methods, but behind own methods. But it seems like they only âstand inâ for own methods, and when an own method is defined, they completely disappear from the order? | 23:21 | |
m: role Loud { method shout { say âHyaa!!!â }; }; class Loudmouth does Loud { method shout { callsame; say âRaah!!!â } }; Loudmouth.new.shout; | 23:22 | ||
camelia | Raah!!! | ||
Tirifto | Is this a fundamental difference between mixing and inherintance that I missed, and do I most likely want to inherit from classes if I want them in the MRO? `o` | 23:24 | |
23:30
coleman left
|
|||
japhb | Tirifto: For compile-time composition, roles are composed directly into the classes that 'does' them, with methods defined in the class replacing those in the composed-in-role. But you could still refer to the role's method if you wanted to. | 23:31 | |
m: role Loud { method shout { say âHyaa!!!â }; }; class Loudmouth does Loud { method shout { self.Loud::shout; say âRaah!!!â } }; Loudmouth.new.shout; | |||
camelia | Hyaa!!! Raah!!! |
23:32 | |
japhb | You can think of a role as providing some attributes, some default implementations, and some required interface. | ||
Tirifto | japhb: That makes sense. Thank you! | 23:36 |