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

Data Racy Safety Editing #109

Merged
merged 11 commits into from
Jul 2, 2024
Merged

Data Racy Safety Editing #109

merged 11 commits into from
Jul 2, 2024

Conversation

mattmassicotte
Copy link
Collaborator

I did a pass over the Data Racy Safety section. It's been a while now and I found many small issues.

I know there's the potential for more changes coming via #50, but this still seems worthwhile in the meantime.

@@ -45,7 +45,7 @@ you are doing so statically. Isolation can be a part of these static
declarations.

There are cases, however, where the type system alone cannot sufficiently
describe a system's behavior. An example could be an Objective-C type
describe runtime behavior. An example could be an Objective-C type
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

awkward duplication of the word "system" here with different meaings.

@@ -130,8 +130,7 @@ access from any other domain.

Actors give the programmer a way to define an isolation domain,
along with methods that operate within that domain.
All stored instance properties of an actor are isolated to the enclosing
actor instance.
All stored properties of an actor are isolated to the enclosing actor instance.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change wording to "stored properties" to match TSPL and also avoid duplicating the word "instance" within the sentence.

@@ -226,7 +225,7 @@ but that doesn't mean you must always manually start one.
Typically, asynchronous functions do not need to be aware of the
task running them.
In fact, tasks can often begin at a much higher level,
within an application framework, or even at the root of a program.
within an application framework, or even at the entry point of the program.
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 is "the root of a program"?

Copy link
Member

Choose a reason for hiding this comment

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

hehe yeah... well, not where the leafs are! 🥬

Good rewording

@@ -243,7 +242,7 @@ actor instance, a global actor, or could be non-isolated.
This isolation can be established manually, but can also be inherited
automatically based on context.
Task isolation, just like all other Swift code, determines what mutable state
they can access.
is accessible.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"they" is quite unclear here.

@@ -388,7 +387,7 @@ The Swift Programming Language.
Isolation domains protect their mutable state, but useful programs need more
than just protection. They have to communicate and coordinate,
often by passing data back and forth.
Moving values into or out of an isolation domain is known as crossing an
Moving values into or out of an isolation domain is known as _crossing_ an
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New concepts are emphasized throughout this document.

When you see a conformance to `Sendable` in documentation,
it means the given type is thread safe,
This is represented by the `Sendable` protocol.
A conformance to `Sendable` means the given type is thread safe,
Copy link
Collaborator Author

@mattmassicotte mattmassicotte Jun 25, 2024

Choose a reason for hiding this comment

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

Lots of redundancy within this sentences. Plus, referencing "documentation" here is just strange.

@@ -423,7 +420,7 @@ types in Swift are implicitly `Sendable` when all their stored properties
are also Sendable.
However, this implicit conformance is not visible outside of their
defining module.
Making a class `Sendable` is part of its public API contract,
Making a type `Sendable` is part of its public API contract
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This whole section is about value types!

@@ -532,16 +529,13 @@ class ChickenValley {
}
```

Being `Sendable`, actor and global-actor-isolated types are always safe
to pass across isolation boundaries.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just re-stating information that has appeared immediately before.

To make a class `Sendable`, it must contain no mutable state.
And any immutable properties must also be `Sendable`.
To make a class `Sendable` it must contain no mutable state and all
immutable properties must also be `Sendable`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Awkard wording and structure here.

@@ -31,7 +31,7 @@ Or, you may have been waiting for the Swift 6 release to begin using them.
Regardless of where your project is in this process, this guide provides
concepts and practical help to ease the migration.

Here you will find articles and code examples that will:
You will find articles and code examples here that:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Really don't like the sound of the duplicated "here"

@@ -43,8 +43,7 @@ Here you will find articles and code examples that will:
> Important: The Swift 6 language mode is _opt-in_.
Existing projects will not switch to this mode without configuration changes.
>
> There is an important distinction between the _compiler version_
and _language mode_.
> There is a distinction between the _compiler version_ and _language mode_.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is within a note marked "Important". I don't think restating that this is also important is adding anything.

@ktoso ktoso merged commit dcbcc0f into main Jul 2, 2024
@ktoso ktoso deleted the mattmassicotte/editing branch July 2, 2024 14:43
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.

2 participants