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

[SR-3281] Update swift man page #10241

Merged
merged 1 commit into from Jun 27, 2017
Merged

[SR-3281] Update swift man page #10241

merged 1 commit into from Jun 27, 2017

Conversation

ghost
Copy link

@ghost ghost commented Jun 14, 2017

Attempt at SR-3281. (cc @CodaFi 😃)

Feedback is welcome.

NAME
    swift -- Safe, fast, and expressive general-purpose programming language

SYNOPSIS
    To invoke the Swift REPL (Read-Eval-Print-Loop):

        swift

    To execute a Swift program:

        swift program.swift -- <arguments>

    To work with the Swift Package Manager:

        swift build|package|run|test [options] <inputs>

    To invoke the Swift compiler:

        swiftc [options] <inputs>

    A list of supported options is available through the "-help" option:

        swift -help

        swift build -help

        swiftc -help

DESCRIPTION
    Swift is a general-purpose programming language built using a modern
    approach to safety, performance, and software design patterns.

    The goal of the Swift project is to create the best available language
    for uses ranging from systems programming, to mobile and desktop apps,
    scaling up to cloud services. Most importantly, Swift is designed to
    make writing and maintaining *correct* programs easier for the
    developer. To achieve this goal, we believe that the most obvious way to
    write Swift code must also be:

    Safe. The most obvious way to write code should also behave in a safe
    manner. Undefined behavior is the enemy of safety, and developer
    mistakes should be caught before software is in production. Opting for
    safety sometimes means Swift will feel strict, but we believe that
    clarity saves time in the long run.

    Fast. Swift is intended as a replacement for C-based languages (C, C++,
    and Objective-C). As such, Swift must be comparable to those languages
    in performance for most tasks. Performance must also be predictable and
    consistent, not just fast in short bursts that require clean-up later.
    There are lots of languages with novel features — being fast is rare.

    Expressive. Swift benefits from decades of advancement in computer
    science to offer syntax that is a joy to use, with modern features
    developers expect. But Swift is never done. We will monitor language
    advancements and embrace what works, continually evolving to make Swift
    even better.

BUGS
    Reporting bugs is a great way for anyone to help improve Swift. The bug
    tracker for Swift, an open-source project, is located at
    <https://bugs.swift.org>.

    If a bug can be reproduced only within an Xcode project or a playground,
    or if the bug is associated with an Apple NDA, please file a report to
    Apple’s bug reporter at <https://bugreport.apple.com> instead.

SEE ALSO
  HOME PAGE
    <https://swift.org>

  APPLE DEVELOPER RESOURCES
    <https://developer.apple.com/swift/resources>

  CODE REPOSITORIES
    Swift Programming Language at <https://github.com/apple/swift>

    Swift Package Manager at
    <https://github.com/apple/swift-package-manager>

@CodaFi
Copy link
Member

CodaFi commented Jun 14, 2017

Thank you for picking this up! 💖

You should notify swift-dev and maybe swift-evolution about this.

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

=head1 NAME

swift - the amazingly new programming language
swift - General purpose programming language by Apple Inc.
Copy link
Member

Choose a reason for hiding this comment

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

Let's drop the "Apple Inc" part.

Copy link
Author

@ghost ghost Jun 14, 2017

Choose a reason for hiding this comment

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

"General purpose programming language" is super vague though...
Anyone else has other suggestions?

Another suggestion to also remove " by Apple Inc." with good reasons and so it will be removed.


B<swift>

=back
Copy link
Member

Choose a reason for hiding this comment

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

Maybe also add:

To execute a swift program:

swift program.swift -- <args>

Copy link
Collaborator

@xwu xwu left a comment

Choose a reason for hiding this comment

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

Great improvement, bravo for taking the time to put this together. I've gone into editor mode and made some nitpicky comments.

=head1 NAME

swift - the amazingly new programming language
swift - General purpose programming language
Copy link
Collaborator

Choose a reason for hiding this comment

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

Below, the spelling is "general-purpose"; here, it is "general purpose"--you'll need to pick one.

May I also suggest following the example of Python, Ruby, LLDB, and others in using two-dashes (i.e., "swift -- General-purpose programming language")?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks 👍


=back

To invoke the Swift Compiler:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Although "Swift Package Manager" is capitalized throughout, here it's just "Swift compiler" without a capital C (as evidenced by the style used in swift -help and swift package -help).


=back

The list of supported options is available through the "-help" option:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm being very nitpicky, but:

The original text was: "The full list of supported options..." If you're going to drop "full," then probably best if it's simply "A list of supported options..." (or, restore the original).

The goal of the Swift project is to create the best available language for uses
ranging from systems programming, to mobile and desktop apps, scaling up to
cloud services. Most importantly, Swift is designed to make writing and
maintaining I<correct> programs easier for the developer. To achieve this goal,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if the text from "To achieve this goal..." to the end of this section is really doing much for the man page. I don't see other examples where this level of detail as to design intent is recorded in the "Description" section of other man pages.

Copy link
Author

Choose a reason for hiding this comment

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

see RUBY(1) as an example. debatable, and based off @CodaFi's ideas.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Indeed, debatable.

Ruby does something quite different, however. It describes what the language is (e.g., garbage collected). This text here describes what the language should/must/will be (e.g., should be safe, will feel strict, must be comparable). It is a description of the Swift project, but not really a description of the Swift language.

safety, performance, and software design patterns.

The goal of the Swift project is to create the best available language for uses
ranging from systems programming, to mobile and desktop apps, scaling up to
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit here: That comma between "programming" and "to mobile" shouldn't be there. I know you've transposed this text from elsewhere, but nonetheless it's an extraneous comma.

=head1 BUGS

Reporting bugs is a great way for anyone to help improve Swift. The open source
Swift project uses Jira for tracking bugs. Our Jira instance is located at
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the fact that Swift uses Jira might be relatively less relevant information for a man page. Can I suggest:

"Reporting bugs is a great way for anyone to help improve Swift. The bug tracker for the open-source project is located at Lhttps://bugs.swift.org."


=head1 SEE ALSO

More information and resources are available online.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if the non-link text in this section could be either made more informative or removed.

For instance, "More information and resources" is a longer way of saying "See also" and "are available online" is immediately self-evident from the links that follow. Likewise, the "developer.apple.com" link is clearly to an Apple Developer resource, and the "github.com" links are clearly to GitHub. Perhaps the links could be accompanied by some concise description of what's there, or alternatively if that seems redundant, just the links can stand alone.

@dabrahams
Copy link
Collaborator

dabrahams commented Jun 14, 2017 via email

Copy link
Collaborator

@xwu xwu left a comment

Choose a reason for hiding this comment

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

Just some straggling follow-on comments.

maintaining I<correct> programs easier for the developer. To achieve this goal,
we believe that the most obvious way to write Swift code must also be:

=head2 SAFE
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these best as headings, or as @CodaFi experimented with, might they work better as bolded text? After comparing the two, I'm inclined to think the latter. In part, I think it's because these don't fit in with the other headings (Synopsis, Description, Bugs, See Also, Home Page...Expressive (huh?)).


L<https://swift.org>

=head2 APPLE DEVELOPER
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any info on the Apple Developer Swift page that a user should "see also" not adequately covered elsewhere? If not, this link might be dispensable, being vendor-specific and all.

Copy link
Author

Choose a reason for hiding this comment

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

Personally, I find the Swift - Resources - Apple Developer page linked in https://developer.apple.com/swift/ very useful. Any further thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@contraultra Wow, yes, that's very useful! It's unlikely that any but the most thorough reader would find that link, though, from the page currently linked to. How would you feel about linking to that page instead and titling this "Apple Developer Resources"?


L<https://developer.apple.com/swift>

=head2 GITHUB
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest "Code Repositories" or "Git Repositories" here. Clearly, these are links to GitHub. A person who doesn't know what GitHub is can't benefit from the current heading; a person who does know what GitHub is won't benefit from any heading.

maintaining I<correct> programs easier for the developer. To achieve this goal,
we believe that the most obvious way to write Swift code must also be:

B<SAFE.> The most obvious way to write code should also behave in a safe manner.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Last nit, I promise: Probably best if not both bold and all-caps? Anyway, this is awesome, and thanks for humoring me.

@ghost
Copy link
Author

ghost commented Jun 16, 2017

The feedback period for this pull request attempt has ended.

Thank you to those who participated in the feedback. Based on the feedback received, I have included most suggestions and this is the final draft.

Please review.


If a bug can be reproduced only within an Xcode project or a playground, or if
the bug is associated with an Apple NDA, please file a report to Apple’s
bug reporter at bugreport.apple.com instead.
Copy link
Member

Choose a reason for hiding this comment

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

Is there a technical reason for this not to be a fully-qualified link, e.g.: https://bugreport.apple.com ?

Copy link
Author

Choose a reason for hiding this comment

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

no

@ghost
Copy link
Author

ghost commented Jun 27, 2017

Pinging @DougGregor, @CodaFi, or @adrian-prantl to review.
I hope this doesn't get buried...

=head1 NAME

swift - the amazingly new programming language
swift -- General-purpose programming language
Copy link
Member

Choose a reason for hiding this comment

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

You should address Dave's comment about this description.

Copy link
Author

Choose a reason for hiding this comment

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

How's "high-performance system programming language" from the first line of the README instead?

Copy link
Member

@CodaFi CodaFi Jun 27, 2017

Choose a reason for hiding this comment

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

high-performance system programming language

The second half of that description contradicts the rest of this document.


=head2 APPLE DEVELOPER RESOURCES

developer.apple.com/swift/resources
Copy link
Member

Choose a reason for hiding this comment

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

This should be qualified with an L<> or formatted like @adrian-prantl said.

For future reference, please refer to the following man pages:

- PERLDOC(1)
- PERLPODSPEC(1)
- PODCHECKER(1)
@ghost
Copy link
Author

ghost commented Jun 27, 2017

@CodaFi, I've made changes based on your feedback.

Instead of

general-purpose programming language,

it's now

Safe, fast, and expressive general-purpose programming language.

@CodaFi
Copy link
Member

CodaFi commented Jun 27, 2017

Beautiful.

I think this is light years ahead of what was here before.

⛵️

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 6bf18ea into apple:master Jun 27, 2017
@ghost ghost deleted the SR-3281 branch June 27, 2017 19:24
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

6 participants