-
Notifications
You must be signed in to change notification settings - Fork 9
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
Translate send-and-sync.md #51
base: master
Are you sure you want to change the base?
Conversation
src/send-and-sync.md
Outdated
Not everything obeys inherited mutability, though. Some types allow you to | ||
multiply alias a location in memory while mutating it. Unless these types use | ||
synchronization to manage this access, they are absolutely not thread safe. Rust | ||
captures this through the `Send` and `Sync` traits. | ||
--> | ||
|
||
すべてのものが継承可変性に従っているわけではありません。が、いくつかの型においては、 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ところが、すべてのものが継承可変性に従っているわけではありません。いくつかの・・・
"though" is a part of the first sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the translation is correct. The previous section doesn't refer to "inherited mutability" so "ところが" doesn't seem natural.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous section doesn't refer to "inherited mutability" so "ところが" doesn't seem natural.
I agree on this.
My point is the first sentence and the second are not disjunctive.
"Some types allow you to ..." == "Some of the types that don't obey inherited mutability allow you to ..."
This seems ambiguity in the original text. How about ignoring "though" and drop "が、" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping "が、" may be the best, although I can't understand why this sentence is there...
src/send-and-sync.md
Outdated
すべてのものが継承可変性に従っているわけではありません。が、いくつかの型においては、 | ||
メモリ上の場所の値を変更している間に、複数のエイリアスを生成することが可能です。 | ||
これらの型が、このアクセスを管理するために同期を行なわない限り、これらは絶対スレッドセーフでは | ||
ありません。 Rust ではこれを、 `Send` トレイトと `Sync` トレイトでキャプチャしています。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sync
トレイトで表しています。
or
捕捉しています。
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"capture -> キャプチャ" is in the translation table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is the translation table is for the programming terms whereas this "capture" is used in a non-programming context. I thought it would be less confusing if we did not use "キャプチャ".
I'm fine either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, "Sync
トレイトで表しています。" seems better. Actually this "capture" is not in a non-programming context.
(btw is there something which should be translated into "キャプチャ"? I can't think of any words. Rust doesn't have try-catch...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there something which should be translated into "キャプチャ"? I can't think of any words. Rust doesn't have try-catch...
great question. I actually don't know. Maybe we can say "x captures y" in
let opt = Some(y);
match opt {
Some(x) => blah,
...
}
?
src/send-and-sync.md
Outdated
これはつまり、これらを実装する事はアンセーフで、他のアンセーフなコードが、これらのトレイトが正しく | ||
実装されていると見なすことができます。これらのトレイトは*マーカートレイト* | ||
(これらのトレイトは、メソッドなどの関連情報を備えていません) ですので、正しく実装することは、 | ||
これらのトレイトが、型を実装するものが持っているべき intrinsic な特性を持っているということを |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intrinsic -> 固有の
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/send-and-sync.md
Outdated
|
||
Send や Sync はまた、自動的に継承されるトレイトでもあります。これはつまり、他のすべてのトレイトとは | ||
違い、もしある型が Send や Sync を実装している型だけで構成されている場合、その型は Send や | ||
Sync を実装しています。ほとんどすべてのプリミティブ型は Send や Sync を実装しています。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send や Sync になります。
or
Send や Sync を実装することになります。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for pedantic, but I'd like to have just one more round on the very first two sentences. Whatever you choose, I'll merge.
Thanks as always!!
src/send-and-sync.md
Outdated
Not everything obeys inherited mutability, though. Some types allow you to | ||
multiply alias a location in memory while mutating it. Unless these types use | ||
synchronization to manage this access, they are absolutely not thread safe. Rust | ||
captures this through the `Send` and `Sync` traits. | ||
--> | ||
|
||
すべてのものが継承可変性に従っているわけではありません。が、いくつかの型においては、 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous section doesn't refer to "inherited mutability" so "ところが" doesn't seem natural.
I agree on this.
My point is the first sentence and the second are not disjunctive.
"Some types allow you to ..." == "Some of the types that don't obey inherited mutability allow you to ..."
This seems ambiguity in the original text. How about ignoring "though" and drop "が、" ?
src/send-and-sync.md
Outdated
すべてのものが継承可変性に従っているわけではありません。が、いくつかの型においては、 | ||
メモリ上の場所の値を変更している間に、複数のエイリアスを生成することが可能です。 | ||
これらの型が、このアクセスを管理するために同期を行なわない限り、これらは絶対スレッドセーフでは | ||
ありません。 Rust ではこれを、 `Send` トレイトと `Sync` トレイトでキャプチャしています。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is the translation table is for the programming terms whereas this "capture" is used in a non-programming context. I thought it would be less confusing if we did not use "キャプチャ".
I'm fine either way.
intrinsic is adj.
This "intrinsic" is not about the module of "intrinsic".
160cf7a
to
ac60c15
Compare
|
||
* ある型を他のスレッドに安全に送信できる場合、その型は Send を実装します。 | ||
* ある型をスレッド間で安全に共有できる場合、その型は Sync を実装します (`&T` は Send を実装します) 。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send と Sync について勉強中なのですが、The Book の記述と照らし合わせるに、ここの最後の部分は "if &T
is Send
" ということではないでしょうか?すなわち、
* ある型をスレッド間で安全に共有できる場合、その型は Sync を実装します (`&T` は Send を実装します) 。 | |
* ある型をスレッド間で安全に共有できる場合 (`&T` が Send を実装する場合) 、その型は Sync を実装します。 |
|
||
`Rc` と `UnsafeCell` は本当に根本的にスレッドセーフではありません。すなわち、 | ||
これらは、同期されていない共有可変状態を実現できてしまうからです。しかしながら、 | ||
生ポインタは、厳密に言えば、*リント*において、より一層スレッドアンセーフです。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
生ポインタは、厳密に言えば、*リント*において、より一層スレッドアンセーフです。 | |
生ポインタは、厳密に言えば、*リント*どころの騒ぎでなく、より一層スレッドアンセーフです。 |
--> | ||
|
||
しかしながら、これらの型を含んでいる型が、自動的にスレッドセーフとしてマークされないようにするために、 | ||
これらがスレッドセーフではないということは重要です。これらの型は、些細ではない、そして追跡されない |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nits]
これらがスレッドセーフではないということは重要です。これらの型は、些細ではない、そして追跡されない | |
これらがスレッドセーフではないということは重要です。これらの型は、自明ではない、そして追跡されない |
// I have some magic semantics for some synchronization primitive! | ||
// プリミティブな型を同期する何か魔法のようなセマンティクスがある! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mdbook-transcheck
で差分出そうな見た目をしています……
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rust-nomicon-jaは歴史的な理由で book-ja , rust-by-example-ja, edition-guide とは違う運用になっています。(たとえば、私は運用に関わってないです) そのため、現時点で mdbook-transcheck
は使用していません。
将来は変わるかもしれませんが、いまは mdbook-transcheck
のことは考えなくてよさそうに思います。
No description provided.