Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new compilation tutorial #3082

Merged
merged 2 commits into from Jan 17, 2020
Merged

new compilation tutorial #3082

merged 2 commits into from Jan 17, 2020

Conversation

finanalyst
Copy link
Collaborator

Documenting PrecompUnit

Issue #3043

New tutorial

Although this does not address the issue directly, the aim is to provide more context for developers and users than is currently available. The tutorial is based on niner's talk. It was in a link he provided in issue #502

@finanalyst finanalyst requested review from JJ, niner and ugexe November 7, 2019 17:17
doc/Language/compilation.pod6 Outdated Show resolved Hide resolved
doc/Language/compilation.pod6 Show resolved Hide resolved

When looking through candidates, the Installation repository will smart match a module's long name against this
DependencySpecification or rather the individual fields against the individual matchers.
Thus a matcher may be some concrete value, a version range or even a regex.
Copy link
Contributor

Choose a reason for hiding this comment

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

or even a regex

This is not entirely valid. For instance .api-matcher and .version-matcher will always be used via~~ Version.new($foo.api-matcher). i.e. the user should not expect an .api-matcher of /.*/ to do anything useful.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What would be a better way of saying this?
Perhaps an example such as C<:ver(+3.0.1)> ?

Copy link
Contributor

Choose a reason for hiding this comment

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

api/ver-matcher take a string that will be turned into a Version for comparisons, which does include 3.0.1+ (but not +3.0.1).

doc/Language/compilation.pod6 Show resolved Hide resolved

C<Raku> has both paradigms. At the B<top level> a Raku program is interpreted, but if code that is separated out into a
Module will be compiled and the preprocessed version is then loaded when necessary. In practice, Modules that have been
written by the community will only need to be pre-compiled once by a user when they are 'installed', for example by a
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the caps for Modules? Also, any module is going to be pre-compiled, not only those written by the community.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, will amend

doc/Language/compilation.pod6 Show resolved Hide resolved
doc/Language/compilation.pod6 Show resolved Hide resolved
=item when developing a new program a developer may want to have the modules written by both Alice and Bob installed locally.
So it is not possible simply to have only one version of a module with a single name installed.

C<Raku> enables all of these possibilities, allowing for multiple versions, multiple authorities, and multiple APIs to be present
Copy link
Contributor

Choose a reason for hiding this comment

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

Here "difficulties" become "possibilities", and "enabled" by Raku. Maybe you meant "tackles all these difficulties"? Or maybe you meant possibilities instead of difficulties above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah. Interesting. They are difficulties in other langages, but resolved in Raku, so they become possibilities.
But I will reword

is explained L<elsewhere|Language/typesystem#Versioning_and_authorship>. This tutorial is about how C<Raku> handles these
possibilities.

=head1 Introduction
Copy link
Contributor

Choose a reason for hiding this comment

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

If the introduction starts here, what's all that above this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Introduction is where niner's talk starts. Before was my preface.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you maybe just change the section name?

The Installation repository is where the real smarts are. When requesting a module, you will usually either do it
via its exact long name, or you say something along the lines of "give me a module that matches this filter".
Such a filter is given by way of a C<CompUnit::DependencySpecification> object which has fields for
=item short-name,
Copy link
Contributor

Choose a reason for hiding this comment

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

Undocumented, too. You can't link it, but please open an issue so that's it's documented or index it so that anyone looking for it arrives here.

doc/Language/compilation.pod6 Show resolved Hide resolved
doc/Language/compilation.pod6 Show resolved Hide resolved
doc/Language/compilation.pod6 Show resolved Hide resolved
doc/Language/compilation.pod6 Show resolved Hide resolved
@JJ JJ merged commit 356eadf into Raku:master Jan 17, 2020
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.

None yet

3 participants