forked from hakimel/reveal.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
2016_11_23_introduction_softwerkskammer.html
175 lines (167 loc) · 8.25 KB
/
2016_11_23_introduction_softwerkskammer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Rust Introduction</title>
<meta name="author" content="Sascha Grunert">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/solarized.css">
<link rel="stylesheet" href="lib/css/zenburn.css">
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>Rust</h1>
<h3>Fast, safe and productive — pick three</h3>
<small>An introduction to the Softwerkskammer Leipzig (2017-11-23)</small>
</section>
<section>
<section>
<h2>Common system programming problems:</h2>
<ul>
<li>Undefined behaviors</li>
<li>Iterator invalidation</li>
<li>Data races</li>
</ul>
</section>
<section>
<h2>Undefined behaviors</h2>
<pre><code class="c" data-trim contenteditable>
int arr[4] = {0, 1, 2, 3};
int *p = arr + 5; // undefined behavior
</code></pre>
<pre><code class="c" data-trim contenteditable>
int k, i;
for (i = 0; i < 10; i++) {
k = k + 1; // What is k?
}
</code></pre>
</section>
<section>
<h2>Iterator invalidation</h2>
<pre><code class="c" data-trim contenteditable>
vector<int> x = { 1, 2, 3 };
int j = 0;
for (auto it = x.begin(); it != x.end(); ++it) {
x.push_back(j); // Makes iterator invalid.
j++;
cout << j << " .. ";
}
</code></pre>
Iterators are invalidated by some operations that modify a std::vector.
</section>
<section>
<h2>Data races</h2>
<pre><code class="c" data-trim contenteditable>
if (x == 5) { // The "Check"
y = x * 2; // The "Act"
// If another thread changed x
// in between "if (x == 5)" and
// "y = x * 2" above, y will not be
// equal to 10.
}
</code></pre>
</section>
<section>
<h2>Why is this a problem?</h2>
<ul>
<li>Runtime failures like segfaults are not recoverable.</li>
<li>Extremely common source of security bugs.</li>
<li>Existing solutions for safety are slow and usually require a garbage collection.</li>
<li>Non type safety leads into common pitfalls (void pointers, wrong casts).</li>
<li>Code Review for such corner cases slows down the development.</li>
</ul>
</section>
<section>
<img class="plain" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Rust_programming_language_black_logo.svg/480px-Rust_programming_language_black_logo.svg.png">
</section>
</section>
<section>
<section>
<h1>Features</h1>
</section>
<section>
<ul>
<li>General thread safety due to borrow checker</li>
<li class="fragment fade-up">Powerful zero cost abstractions without garbage collection</li>
<li class="fragment fade-up">Full featured Error handling</li>
<li class="fragment fade-up">Lifetime and Ownership (memory safety)</li>
<li class="fragment fade-up">Pattern matching</li>
<li class="fragment fade-up">Traits for behavioral description</li>
<li class="fragment fade-up">Modern library documentation</li>
</ul>
</section>
<section>
<ul>
<li>Highly optimized iterators</li>
<li class="fragment fade-up">Closures</li>
<li class="fragment fade-up">Futures</li>
<li class="fragment fade-up">I/O Streams</li>
<li class="fragment fade-up">Powerful macros</li>
<li class="fragment fade-up">efficient C bindings</li>
<li class="fragment fade-up">Program Structure, Modules, Crates</li>
<li class="fragment fade-up"><a href="https://crates.io" target"_blank">External crates</a></li>
</ul>
</section>
<section>
<h1>Demo</h1>
</section>
<section>
<h2>Resources</h2>
<ul>
<li><a href="http://doc.rust-lang.org/book">http://doc.rust-lang.org/book</a></li>
<li><a href="http://rustbyexample.com/">http://rustbyexample.com/</a></li>
<li><a href="http://doc.rust-lang.org/">http://doc.rust-lang.org/</a></li>
<li><a href="https://blog.rust-lang.org/">https://blog.rust-lang.org/</a></li>
<li><a href="https://play.rust-lang.org/">https://play.rust-lang.org/</a></li>
<li><a href="http://users.rust-lang.org/">http://users.rust-lang.org/</a></li>
<li><a href="https://www.rust-lang.org/en-US/community.html">https://www.rust-lang.org/en-US/community.html</a></li>
<li><a href="http://reddit.com/r/rust/">http://reddit.com/r/rust/</a></li>
</ul>
</section>
<section>
<a href="https://rust-leipzig.github.io/" target="_blank">We have a blog.</a>
</section>
<section>
<p>Two good books, one free:</p>
<img height="300px" class="plain" src="http://akamaicovers.oreilly.com/images/0636920040385/rc_cat.gif">
<img height="300px" class="plain" src="http://covers.oreillystatic.com/images/0636920040446/cat.gif">
</section>
</section>
<section>
<h1>Thank you!</h1>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
backgroundTransition: 'zoom',
center: true,
controls: true,
history: true,
progress: true,
transition: 'zoom',
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>