Skip to content

Commit cdda33c

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

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

src/README.md

Lines changed: 36 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,35 @@ 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 exists to detail the syntax and semantics of every part of
27+
the language, The Rustonomicon exists to describe how to use those pieces together,
28+
and the issues that you will have in doing so.
29+
30+
The reference will tell you the syntax and semantics of references, destructors, and
31+
unwinding, but it won't tell you how that can lead to exception-safety issues, or
32+
how to deal with those issues.
33+
34+
It should be noted that when The Rustonomicon was originally written, The
35+
Reference was in a state of complete disrepair, and so many things that should
36+
have been covered by The Reference were originally only documented here. Since
37+
then, The Reference has been revitalized and is properly maintained, although
38+
it is still far from complete. In general, if the two documents disagree, The
39+
Reference should be assumed to be correct (it isn't yet considered normative,
40+
it's just better maintained).
41+
42+
Topics that are within the scope of this book include: the meaning of (un)safety,
43+
unsafe primitives provided by the language and standard library, techniques for
44+
creating safe abstractions with those unsafe primitives, subtyping and variance,
45+
exception-safety (panic/unwind-safety), working with uninitialized memory,
46+
type punning, concurrency, interoperating with other languages (FFI),
47+
optimization tricks, how constructs lower to compiler/OS/hardware primitives,
48+
how to **not** make the memory model people angry, how you're **going** to make the
49+
memory model people angry, and more.
50+
51+
The Rustonomicon is not a place to exhaustively describe the semantics and guarantees
52+
of every single API in the standard library, nor is it a place to exhaustively describe
53+
every feature of Rust.
54+
55+
[trpl]: ../book/
56+
[ref]: ../reference/

0 commit comments

Comments
 (0)