Skip to content

Commit cc55141

Browse files
committed
cleanup the intro, and clarify how it relates to the reference
1 parent c656171 commit cc55141

File tree

1 file changed

+33
-21
lines changed

1 file changed

+33
-21
lines changed

src/README.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
# The Rustonomicon
22

3-
#### The Dark Arts of Advanced and Unsafe Rust Programming
4-
5-
> Instead of the programs I had hoped for, there came only a shuddering blackness
6-
and ineffable loneliness; and I saw at last a fearful truth which no one had
7-
ever dared to breathe before — the unwhisperable secret of secrets — The fact
8-
that this language of stone and stridor is not a sentient perpetuation of Rust
9-
as London is of Old London and Paris of Old Paris, but that it is in fact
10-
quite `unsafe`, its sprawling body imperfectly embalmed and infested with queer
11-
animate things which have nothing to do with it as it was in compilation.
12-
13-
This book digs into all the awful details that you need to understand when
14-
writing Unsafe Rust programs.
3+
#### The Dark Arts of Unsafe Rust
154

165
> THE KNOWLEDGE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
176
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF UNLEASHING INDESCRIBABLE HORRORS THAT
187
SHATTER YOUR PSYCHE AND SET YOUR MIND ADRIFT IN THE UNKNOWABLY INFINITE COSMOS.
198

9+
The Rustonomicon digs into all the awful details that you need to understand when
10+
writing Unsafe Rust programs.
11+
2012
Should you wish a long and happy career of writing Rust programs, you should
2113
turn back now and forget you ever saw this book. It is not necessary. However
2214
if you intend to write unsafe code — or just want to dig into the guts of the
@@ -30,12 +22,32 @@ have read it, and we will take care to occasionally give a refresher on the
3022
basics where appropriate. You can skip straight to this book if you want;
3123
just know that we won't be explaining everything from the ground up.
3224

33-
We're going to dig into exception-safety, pointer aliasing, memory models,
34-
compiler and hardware implementation details, and even some type-theory.
35-
Much text will be devoted to exotic corner cases that no one *should* ever have
36-
to care about, but suddenly become important because we wrote `unsafe`.
37-
38-
We will also be spending a lot of time talking about the different kinds of
39-
safety and guarantees that programs could care about.
40-
41-
[trpl]: ../book/index.html
25+
This book exists primarily as a high-level companion to [The Reference][ref].
26+
Where The Reference is essentially a giant exhaustive list of every individual
27+
component of Rust and what semantics it has, The Rustonomicon serves to describe
28+
how to put those pieces together, and the issues that you will have in doing so.
29+
30+
The Rustonomicon is the "integration tests" to The Reference's "unit tests".
31+
32+
It should be noted that when The Rustonomicon was originally written, The
33+
Reference was in a state of complete disrepair, and so many things that should
34+
have been covered by The Reference were originally only documented here. Since
35+
then, the reference has been revitalized and is properly maintained, although
36+
it is still far from complete. In general, if the two documents disagree, The
37+
Reference should be assumed to be correct.
38+
39+
Topics that are within the scope of this book include: the meaning of (un)safety,
40+
unsafe primitives provided by the language and standard library, techniques for
41+
creating safe abstractions with those unsafe primitives, subtyping and variance,
42+
exception-safety (panic/unwind-safety), working with uninitialized memory,
43+
type punning, concurrency, interoperating with other languages (FFI),
44+
optimization tricks, how constructs lower to compiler/OS/hardware primitives,
45+
how to **not** make the memory model people angry, how you're **going** to make the
46+
memory model people angry, and more.
47+
48+
The Rustonomicon is not a place to exhaustively describe the semantics and guarantees
49+
of every single API in the standard library, nor is it a place to exhaustively describe
50+
every feature of Rust.
51+
52+
[trpl]: ../book/
53+
[ref]: ../reference/

0 commit comments

Comments
 (0)