🦋 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.
[Coke] Using iterm2, and it's Readline, yes 00:31
japhb [Coke]: Hmmm, I shouldn't have made much of any difference to Readline support ... is there a "golf"? Or does it literally require two ^C's and leave the terminal in a bad state *every time*? 00:47
Geth vim-raku: flwyd++ created pull request #34:
Set keywordprg=rakudoc
03:20
Geth doc: dd6e4a3a86 | (Peter du Marchie van Voorthuysen)++ | 11 files
Improve documentation of the list routine

The documentation of the list subroutine is a good place to explain the single argument rule yet again.
Most core types implementing a .list method only accept an object instance as the invocant. If the core type implements .list as a multi method, listing the type object is handled by
   multi method list(Any:U: --> List)
07:36
doc: 35665aa862 | (Peter du Marchie van Voorthuysen)++ | doc/Type/List.pod6
Improve wording and formatting.
linkable6 Link: docs.raku.org/type/List
doc: 8c3e724fdb | (Peter du Marchie van Voorthuysen)++ (committed using GitHub Web editor) | 11 files
Merge pull request #3975 from dumarchie/master

Improve documentation of the list routine
Geth doc: dumarchie++ created pull request #3980:
Talk about collections rather than containers
08:09
patrickb o/ 11:12
I have a project that reproducibly uses a stale precomp file and doesn't recompile the changed source. 11:14
Since it's so nicely reproducible, I'd say it's a good place to debug the behavior. 11:15
Anyone around to give me some hints of where to look?
lizmat fwiw, I see this behaviour when I'm reinstalling a module from source with --force, while running tests on a dependency with -Ilib 11:23
I would have to nuke the lib/.precomp in the dependency to "see" the newly installed module
patrickb: does that match any of your situation ?
patrickb In this case it's the script I'm calling itself 11:29
so not a module. I'm pretty sure I did change the -I parameters before it started doing this. 11:30
Sadly adding RAKUDO_MODULE_DEBUG causes a ton of output but then segfaults. 11:31
lizmat segfaults? interesting... I've never seen that
patrickb I'm on 2021.09
lizmat I'm sure we could need some precomp sanity checker logic... nine ugexe might know if that already exists 11:32
patrickb <hanging the version will probably spoil the reproducibility though.
patrickb I give up for now. :-( 12:08
ugexe patrickb: the RMD output might be useful to show anyway 13:00
ugexe i usually forget most of what i know about precomp days after i do anything with it, so when i debug its generally just placing print statements in the various CU::* classes but that would kill your reproducibility 13:09
you might also try to whittle down your script / dependencies to the bare `use` statements required to reproduce (to potentially reduce RMD output) 13:11
patrickb thanks. This is helpful. 13:17
Let's see when this comes up again.
ugexe adding a new path to the includes via e.g. -I parameters will change which precomp gets used as well 13:19
raku -I. bin/zef --help
raku -Ixxx -I. bin/zef --help 13:20
one will precomp into ./, one into ./xxx
Geth App-Rakubrew: 36171e2b44 | (Patrick Böker)++ | 2 files
Fix `register` with relative paths
13:29
App-Rakubrew: a1de52d9d0 | (Patrick Böker)++ | 3 files
Version 22
ugexe CUR.install(..., :force) will leave the old precomp files behind. perhaps it should remove those, but then thats really just making :force an alias for uninstall + install (i.e. maybe use uninstall before installing instead of force) 13:37
patrickb When seeing "const_iX NYI" that's definitely a compiler bug, because that OP shouldn't show up in compilation, correct? 15:04
patrickb sees those on latest master.
tonyo patrickb: does the module have a `use lib` init? 15:24
Xliff I am currently working on a program that needs to pull a type off of an attribute. However, when I do so I am getting a "MyType(Any)" rather than a "MyType" 15:29
How can I get rid of the "(Any)"
Geth doc: bb1a934fe2 | Coke++ | doc/Type/List.pod6
Fix example compilation
15:31
doc: 51182b9d84 | Coke++ | xt/pws/code.pws
learn new word
linkable6 Link: docs.raku.org/type/List
tonyo example? 15:56
patrickb tonyo: The thing that causes const_iX NYI? I've seen them in the tests of Cro::HTTP:ver<0.8.4> and Red:ver<0.1.47>. 15:59
tonyo your precomp issue 16:01
patrickb tonyo: It's possible it was a false report. /o\ 16:54
SmokeMachine m: say Int().^target_type.^name # Xliff 18:33
camelia Int
A26F64 I'm wondering if someone could recommend a straightforward tutorial explaining how to distribute several modules, classes, subsets, etc. in separate files and then execute them locally as a module. Basically, how to create a working module that may or may not end up deployed into the broader Raku module ecosystem. I feel that the official 19:23
documentation, while overall excellent, is not particularly clear on that.
(Definitely a beginner's question. I did ask in #raku-beginner once earlier without seeing a response.)
In Perl packages are placed in files, identified with the `package` keyword with double-colon separators, and then imported by `use`ing that full identifier. Raku is (I am to understand) not that simple.
There's quite a bit of discussion in the documentation about actually using the elements of a module once installed via zef. But there's little about setting this up locally yourself. The "modules" page contains paragraphs about META6.json and something called "compunits" and the -I switch and who knows what else. All of which (at first, anyway) 19:24
seems relatively complicated for just creating a set of interrelated files.
ugexe so dont overcomplicate it 19:26
it sounds like most of what you are asking would be the same as in perl 19:27
gfldex A26F64: we tend to use tools like raku.land/cpan:SKAJI/App::Mi6 and raku.land/github:gfldex/META6::bin
A26F64 I did find those listed at docs.raku.org/language/modules-extra. But those represent very simple repositories. 19:28
Uploaded file: uploads.kiwiirc.com/files/cc879228...pasted.txt 19:30
I didn't mean to send that as a file.
I eventually found out that you need to use the -I switch to use CompUnit::Repository::FileSystem instead of CompUnit::Repository::Installation. In fact the CompUnit::Repository::FileSystem method of doing things seems to be incompatible with the Installation method that is the preferred ultimate form of the module since the former uses Perlian
filesystem references and the latter META6.json.
For example, do you have to temporarily specify directories in your `use` statements during development and then convert all such statements to call whatever is defined in META6.json's `provides` attribute once you are ready to release the thing to the module ecosystem? (Assuming, of course, that you even intend to do so?) 19:31
ugexe there is a lot wrong with that statement. first -I isn't tied to a specific compunit repo, it could very well point to a installation. secondly i'm not what you mean by its not compatible... it very much is compatible
and indeed a ::FileSystem will use a META6.json assuming one exists at whatever directory you point at 19:32
A26F64: i would suggest trying whatever you think would work in perl
A26F64 Please correct me if I'm wrong about this observation: I discovered that specifying a filesystem file in META6.json's `provides` attribute seems to load the whole file without respect to the module name used as the corresponding key. Which means that a file `use`ing one class in that file suddenly has access to all classes in it. I thought that 19:36
META6.json was intended to limit access to packages in the namespace.
ugexe a whole file always gets loaded regardless of what is loading it 19:38
so if youre asking if you can have `package Foo { class Foo1 { } }; package Bar { class Bar1 { } };` in a single file yet load/expose only one of Foo or Bar, then no that doesnt work 19:39
regardless if its ::FileSystem or ::Installation
A26F64 I had kind of assumed that META6.json restricted the packages themselves mainly because docs.raku.org/language/modules says: "In the provides section, include all the namespaces provided by your distribution and that you wish to be installed". That doesn't exactly say that other namespaces won't be installed, I guess, but it wasn't a leap 19:43
to infer that.
ugexe yeah thats not exactly an accurate statement 19:44
all the files and namespaces get installed. the namespace part of the provides just provides the namespace to load with, and may not neccesarily match any namespaces in the file 19:46
i mean ideally sure it'd be great if it could do what you suggest though (and I think the original design docs suggest this) 19:47
but if you list `"A1":"lib/Foo.rakumod", "A2":"lib/Foo.rakumod"` then you just precompile Foo.rakumod twice and make it `use`able via `use A1` or `use A2` 19:48
A26F64 I suppose that we can be somewhat minimalist, then, in what we supply to `provides`. 19:50
Allow me also to (try to) explain my earlier comment that the compunit modes are inconsistent....
ugexe for provides you generally want one entry for each file, and given each file some namespace you will `use` (which generally matches whatever the top level namespace declared in the file is, but might not be) 19:51
A26F64 (I thought that I had an expressive example for my comment but need to review that. Sorry.) 19:54
I can experiment with the file namespaces given your explanation above; thank you. 19:55
Xliff How is CoercionHOW exposed in raku? "Perl6::Metamodel::CoercionHOW" doesn't work. 20:08
A26F64 ugexe I'll experiment further with the file structure given your responses. Thank you for the clarification and for your patience. 20:09
Xliff m: say Metamodel::CoercionHOW
camelia No such method 'gist' for invocant of type
'Perl6::Metamodel::CoercionHOW'. Did you mean 'isa'?
in block <unit> at <tmp> line 1
Xliff Ah. that works. 20:10