Skip to content

Commit 1ff9110

Browse files
committed
Refine the introduction chapter
1 parent edf0d90 commit 1ff9110

File tree

3 files changed

+33
-57
lines changed

3 files changed

+33
-57
lines changed

src/README.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Summary
22

3-
[Introduction](README.md)
3+
[Introduction](intro.md)
44

55
* [Meet Safe and Unsafe](meet-safe-and-unsafe.md)
66
* [How Safe and Unsafe Interact](safe-unsafe-meaning.md)

src/intro.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# The Rustonomicon
2+
3+
## The Dark Arts of Unsafe Rust
4+
5+
> THE KNOWLEDGE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF UNLEASHING INDESCRIBABLE HORRORS THAT SHATTER YOUR PSYCHE AND SET YOUR MIND ADRIFT IN THE UNKNOWABLY INFINITE COSMOS.
6+
7+
The Rustonomicon digs into all the awful details that you need to understand when writing Unsafe Rust programs.
8+
9+
Should you wish a long and happy career of writing Rust programs, you should turn back now and forget you ever saw this book.
10+
It is not necessary.
11+
However if you intend to write unsafe code — or just want to dig into the guts of the language — this book contains lots of useful information.
12+
13+
Unlike *[The Rust Programming Language][trpl]*, we will be assuming considerable prior knowledge.
14+
In particular, you should be comfortable with basic systems programming and Rust.
15+
If you don't feel comfortable with these topics, you should consider reading [The Book][trpl] first.
16+
That said, we won't assume you have read it, and we will take care to occasionally give a refresher on the basics where appropriate.
17+
You can skip straight to this book if you want; just know that we won't be explaining everything from the ground up.
18+
19+
This book exists primarily as a high-level companion to [The Reference][ref].
20+
Where The Reference exists to detail the syntax and semantics of every part of the language, The Rustonomicon exists to describe how to use those pieces together, and the issues that you will have in doing so.
21+
22+
The Reference will tell you the syntax and semantics of references, destructors, and unwinding, but it won't tell you how combining them can lead to exception-safety issues, or how to deal with those issues.
23+
24+
It should be noted that we haven't synced The Rustnomicon and The Reference well, so they may have a duplicate content.
25+
In general, if the two documents disagree, The Reference should be assumed to be correct (it isn't yet considered normative, it's just better maintained).
26+
27+
Topics that are within the scope of this book include: the meaning of (un)safety, unsafe primitives provided by the language and standard library, techniques for creating safe abstractions with those unsafe primitives, subtyping and variance, exception-safety (panic/unwind-safety), working with uninitialized memory, type punning, concurrency, interoperating with other languages (FFI), optimization tricks, how constructs lower to compiler/OS/hardware primitives, how to **not** make the memory model people angry, how you're **going** to make the memory model people angry, and more.
28+
29+
The Rustonomicon is not a place to exhaustively describe the semantics and guarantees of every single API in the standard library, nor is it a place to exhaustively describe every feature of Rust.
30+
31+
[trpl]: ../book/index.html
32+
[ref]: ../reference/index.html

0 commit comments

Comments
 (0)