Skip to content

Conversation

@wayland
Copy link
Contributor

@wayland wayland commented May 2, 2025

The problem

The module/package documentation was suboptimally organised, as per #3714

Solution provided

Organised documentation less suboptimally.

Things to note:

  • Put the first subdirectories under "Tutorials", specifically:
    • Using Modules: How to use raku.land and zef to get modules to use in your projects
    • Making Modules: How to code modules in your projects
    • Making distributions: How to wrap your code up in a distribution
  • Each of those has a few pages in it. I'm not sure whether this was a good idea or not. Ideas I like are:
    • More subdirectories (but upon what grounds?)
    • Series of tutorials, rather than everything in doc/Language being standalone
  • Tweaked the Makefile (for ease of use and readability) and one of the tests (because otherwise it was hanging on that test; the outcome of the test should be unaffected though)

I'm expecting feedback on things I need to change.

Hope this helps.

wayland added 5 commits May 2, 2025 08:45
* Pulled out testlist variable to simplify later code
* Move "if" statement from Bash to Makefile
* Added RAKULIB=lib because it was failing without this for me
… On the downside, the output is uglier. On the upside, it doesn't hang.
@wayland
Copy link
Contributor Author

wayland commented May 2, 2025

I guess my main point is that it's better than it was before :) .

@coke coke self-assigned this May 2, 2025
Copy link
Collaborator

@coke coke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a curl option to hide the output instead?

Copy link
Collaborator

@coke coke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RAKULIB should be . (current directory's META6.json), not lib

@finanalyst
Copy link
Collaborator

This seems to be a good start. I absolutely agree the modules part needed restructuring.
We should also include something about documentation.

From the site building point of view, it does not matter which directory the files are placed, so long as the meta date at the top of the file (in the line with =begin rakudoc) matches existing categories. The pages (introduction, etc) that pull in the separate pages use the meta data.

Richard

@wayland
Copy link
Contributor Author

wayland commented May 2, 2025

@finanalyst :

  • Not sure what you mean by "We should also include something about documentation" unless you mean that we should have a page on documenting your distribution, in which case, I agree, but...
  • Nearly everything here is a copy-paste from somewhere else in the documentation (with the exception of some bits about $?DISTRIBUTION and %?RESOURCES). For context, my main role on Wikipedia seems to be to add headings to pages that don't have them, and that's functionally what I'm doing here: taking existing information and grouping it better.
    • My hope is that, with the better grouping, and people being able to find things more easily, we'll also get more contributions, such as the one you suggested about documentation. I could put in a crosslink to the Rakudoc page, though

@finanalyst
Copy link
Collaborator

@wayland Ok understood that the main work currently is about regrouping, and that's definitely important.

I do mean a page on documenting a module. I agree more needs writing - its a TODO of mine.

@wayland
Copy link
Contributor Author

wayland commented May 2, 2025

Hi! I've made the following updates:

  • Added the --silent option to curl, which should at least reduce the amount of output
  • Changed RAKULIB, as requested
  • Added the following targets to the Makefile
    • test-mine: Tests with just the appropriate git files
    • xtest-mine: Like test-mine, but with xtest
    • prep: Runs zef install

HTH,

@wayland wayland requested a review from coke May 2, 2025 21:45

However, this is I<not> because it returns an L<C<IO::Path>|/type/IO::Path>, but because it
shares many method with it: C<Str, gist, raku, absolute, is-absolute,
However, this was found to be problematic due to the fact that the path can
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it makes sense to talk about what why things are implemented the way they are in the docs e.g. "was found to be problematic". Someone looking at the docs presumably wants to know how to use something and not necessarily the history or implementation details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've rewritten this section so that it:

  • Keeps most of the old material (but updates the deprecation list
  • Adds a paragraph on what not to do (which was what I was trying to achieve), but without listing the deprecated methods

Would very much appreciate your feedback, since I seem to get this wrong on the regular.

Thanks!

get compiled into the library at compile time, which means that it can end
up pointing to the wrong place at runtime. Thus, many of the methods that
were shared with L<C<IO::Path>|/type/IO::Path> are now deprecated; this
includes C<Str, gist, raku, absolute, is-absolute,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Str or gist is giving a deprecation message then that is a bug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant .raku or .gist aren’t deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Right. Well, I've completely left them out this time around because

  1. I wasn't sure of their status
  2. They're not specific to mirroring IO::Path, they're on just about everything, so I figured they didn't need a mention.

HTH,

relative, is-relative, parts, volume, dirname, basename, extension, open,
resolve, slurp, lines, comb, split, words, copy>; above we use C<.lines>, for
instance.
resolve, slurp, lines, comb, split, words, copy>.
Copy link
Contributor

@ugexe ugexe May 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is not accurate. You can see the deprecations explicitly defined in the source. Notably slurp, lines, and other methods that don't return a string representation of a path or path part.

I also think listing all the deprecated methods is rather distracting, and that listing the methods that are actually allowed (similar to the original description) makes the most sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll be rewriting this section in line with your recommendations.

Just my notes on the old version of the list as to what's still current and what isn't. I'm mainly posting it here for feedback on .gist and .raku (given that .Str is deprecated).

  • Deprecated: Str, absolute, is-absolute, resolve
  • Not sure: gist, raku
  • Still good: slurp, lines, comb, split, words, copy

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Str is deprecated?

@wayland
Copy link
Contributor Author

wayland commented May 4, 2025

Also regularised use of subkind across the new pages (to "Modules").

@wayland
Copy link
Contributor Author

wayland commented May 23, 2025

Hi @ugexe , are you happy with this now?

@wayland
Copy link
Contributor Author

wayland commented Jul 18, 2025

Hi @ugexe , let me ask a different question: Can you have a look at your previous comments, and mark them "resolved" if you're satisfied with my changes?

Thanks!

names in all distributions available.

Given this arrangement, the B<rakudo> compiler, or a package manager such as
B<zef>, can obtain all the information needed about each C<compunit> from a
Copy link
Contributor

@ugexe ugexe Jul 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is incorrectly using the term compunit in a lot of places. See this doc and note there are separate definitions for compunit and module. Many places this references compunit I would have expected module.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Definitely the best explanation I've seen of the terms. I have:

  • Redone the doc to use "module" instead of "compunit"
  • Added some of the definitions from your link to the documentation.

Currently, there are three ways to distribute a module. No matter which method
you choose, your module will be indexed on the L<raku.land|https://raku.land>
and L<raku.land|https://raku.land> websites. The three module
distribution networks, or ecosystems, are:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it is useful to mention anything other than the zef ecosystem, particularly in the context of a user "choosing" one. See https://github.com/Raku/problem-solving/blob/main/solutions/meta/sunsetting-p6c-cpan.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I was just copy-pasting what was elsewhere in the docs. I've removed references to CPAN and P6C.

Thanks!

-	Removed references to P6C and CPAN
-	Changed compunit to module where appropriate
@wayland
Copy link
Contributor Author

wayland commented Jul 25, 2025

Hi @ugexe ,

I've addressed your points, thanks very much.

Any more objections?

Thanks

@coke
Copy link
Collaborator

coke commented Oct 4, 2025

Hey, sorry I got very derailed in July (!) and lost track of a bunch of stuff. What’s left to get this merged?

@coke
Copy link
Collaborator

coke commented Oct 4, 2025

Please also (sorry!) resolve the conflicts.

Very sorry. Once that’s passed, would love to merge in next few days. Thanks!

Copy link
Collaborator

@coke coke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, content all looks great, I just have a few minor requests just added.

@@ -0,0 +1,75 @@
=begin pod :kind("Language") :subkind("Modules") :category("tutorial")

=TITLE Distributions: An Introduction
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you know, xt/headings.rakutest is failing on most of these changes: I added some comments to the rakudoc overview on that test file on main that should help pass. This one should be

Distributions: an introduction

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you resubmit, you’ll see we’ve added some CI tests - please make sure those pass.


...and then to use it in your code:

=begin code
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code can't be compiled because it depends on a non-standard module. please add to the =begin directive here:

:skip-test<needs dummy module>
  • also, please remove the extra whitespace before TOP.


{
my $web = run('curl', '-L', '-H', "Accept: application/vnd.github+json", '-H', "X-GitHub-Api-Version: 2022-11-28", "https://api.github.com/repos/rakudo/rakudo/releases?per_page=1", :out, :err);
my $web = run('curl', '-L', '-H', "Accept: application/vnd.github+json", '-H', "X-GitHub-Api-Version: 2022-11-28", "https://api.github.com/repos/rakudo/rakudo/releases?per_page=1", :out);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add '-s' here to make the curl silent itself (without needing raku to grab the STDERR and ignore it)

=begin code
my $foo-IO = %?RESOURCES<images/foo.jpg>; # gets an object you can slurp
my $foo-IO = %?RESOURCES<images/foo.jpg>.absolute; # gets an absolute path to a file
my $foo-IO = %?RESOURCES<images/foo.jpg>.absolute; # gets an absolute path to a file; deprecated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the deprecation in rakudo indicate when it will be removed?

# Just some error-checking code
if $resource !~~ Distribution::Resource {
note "Could not find resource '$resource-filename' in distribution";
say qx{ls -laF ; ls -laF resources ; cat META6.json};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found by the aspell test - add 'laf' to xt/pws/code.pws - lowercase, and sorted -

xt/words.rakutest will test the PWS files

util/sort-words.raku will sort them (helpful when there's non ASCII involved, less so here)


N: Tim Nelson
E: [email protected]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YAY!

@@ -1,20 +1,34 @@
.PHONY: test xtest push help
.PHONY: test xtest push help test-mine xtest-mine
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t be any changes to this file

or skeletons.

=item L<Foo|https://raku.land/github:ugexe/Foo> A module with two distributions of different versions
Moved to L<Making Modules: The Tools|/language/distributions/tools>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of Moved to, say “See”, same in the other locations. Thanks


Every commit should run a basic set of tests with `make xtest`. As of Feb 2023, we
are updating our CI, so this is currently disabled. C<NOTE> The author tests in `xt/`
are updating our CI, so this is currently disabled. **NOTE** The author tests in `xt/`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

my $web = run(
'curl', '--silent', '-L', '-H', "Accept: application/vnd.github+json", '-H', "X-GitHub-Api-Version: 2022-11-28",
"https://api.github.com/repos/rakudo/rakudo/releases?per_page=1",
:out);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should be in a separate PR, but this looks like a fine cleanup and can stay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants