Browse Source

Merge branch 'master' of git.juliobiason.net:git.juliobiason.net/git/presentations

master
Julio Biason 5 years ago
parent
commit
a085078172
  1. BIN
      _images/datastream.png
  2. BIN
      _images/flink-cluster1.png
  3. BIN
      _images/flink-cluster2.png
  4. BIN
      _images/flink-cluster3.png
  5. BIN
      _images/flink1.png
  6. BIN
      _images/flink2.png
  7. BIN
      _images/flink3.png
  8. BIN
      _images/jobmanager-1.png
  9. BIN
      _images/plan_visualizer.png
  10. 285
      flink.html
  11. 220
      porque-rust.html

BIN
_images/datastream.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
_images/flink-cluster1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
_images/flink-cluster2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
_images/flink-cluster3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
_images/flink1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
_images/flink2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
_images/flink3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
_images/jobmanager-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
_images/plan_visualizer.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

285
flink.html

@ -0,0 +1,285 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Flink</title>
<meta name="description" content="Por que você deveria aprender Rust">
<meta name="author" content="Julio Biason">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/night.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<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>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<style type="text/css" media="screen">
.happy {
color: yellow;
}
.reveal section img {
border: none;
}
.reveal ul.empty {
list-style: none inside;
}
.revel ul.empty li {
display: block;
}
.cursor {
background-color: #666;
color: white;
}
img {
max-height: 90%;
}
td.seen {
font-style: italic;
font-weight: bold;
}
.semi-opaque {
background-color: rgba(0, 0, 0, 0.7);
}
img.padding {
padding: 10px;
background-color: #fff !important;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<section data-background="_images/streamprocessing-flink.png" data-header>
<h2 class="semi-opaque">Flink</h2>
</section>
</section>
<section>
<section>
<pre><code>
cat log.log | grep ERROR | cut -f2 -d: &gt; errors.txt
</code></pre>
</section>
<section>
<h4>Entrada</h4>
<h2><pre><code>cat log.log</code></pre></h2>
</section>
<section>
<h4>Processamento</h4>
<h2><pre><code>grep ERROR</code></pre></h2>
<h2>
<pre><code>cut -f2 -d:</code></pre>
</h2>
</section>
<section>
<h4>Saída</h4>
<h2>
<pre><code>&gt; errors.txt</code></pre>
</h2>
</section>
</section>
<section>
<section>
<h4>cat</h4>
<h3>Tem começo e fim</h3>
<h2 class="fragment">"bounded"</h2>
</section>
<section>
<h4>Dados "infinitos"</h4>
<h2 class="fragment">"unbounded"</h2>
</section>
</section>
<section>
<section>
<img src="_images/flink1.png" alt="" class="stretch">
</section>
<section>
<img src="_images/flink2.png" alt="" class="stretch">
</section>
<section>
<img src="_images/flink3.png" alt="" class="stretch">
</section>
<section>
<img class="stretch" src="_images/datastream.png" alt="">
</section>
<section>
<h4>Operators</h4>
<ul>
<li><code>map</code></li>
<li><code>flatMap</code></li>
<li><code>filter</code></li>
<li><code>reduce</code></li>
<li class="fragment"><code>split/select</code></li>
<li class="fragment"><code>join</code></li>
<li class="fragment"><code>keyBy</code></li>
<li class="fragment"><code>window</code></li>
</ul>
</section>
</section>
<section>
<section>
<img src="_images/unclephil-time.jpg" alt="" class="stretch">
</section>
<section>
<img src="_images/unclephil-step0.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step1.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step2.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step3.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step4.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step5.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step6.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step7.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step8.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step9.png" alt="" class="stretch padding">
</section>
<section>
<img src="_images/unclephil-step10.png" alt="" class="stretch padding">
</section>
</section>
<section>
<section>
<img src="_images/dunno.jpg" alt="" class="stretch">
</section>
<section>
<img src="_images/flink-cluster1.png" alt="" class="stretch">
</section>
<section>
<img class="stretch" src="_images/flink-cluster2.png" alt="">
</section>
<section>
<img class="stretch" src="_images/flink-cluster3.png" alt="">
</section>
</section>
<section>
<section>
<img class="stretch" src="_images/unclephil-flinkpipelinereal.png" alt="">
</section>
</section>
<section>
<section>
<img class="stretch" src="_images/jobmanager-1.png" alt="">
</section>
<section>
<img class="stretch" src="_images/plan_visualizer.png" alt="">
</section>
</section>
<section data-background='_images/thats-all-folks.jpg'>
<section></section>
</section>
</div>
</div>
<script src="reveal.js/lib/js/head.min.js"></script>
<script src="reveal.js/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
// showNotes: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'reveal.js/plugin/zoom-js/zoom.js', async: true },
{ src: 'reveal.js/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>

220
porque-rust.html

@ -111,14 +111,14 @@
<li>Criada em 2006 por Graydon Hoare.</li> <li>Criada em 2006 por Graydon Hoare.</li>
<li>Patrocinada pela Mozilla em 2009.</li> <li>Patrocinada pela Mozilla em 2009.</li>
<li>Versão 1.0 em 2015.</li> <li>Versão 1.0 em 2015.</li>
<li>Versão atual: 1.35</li> <li>Versão atual: 1.37</li>
</ul> </ul>
</section> </section>
<aside class="notes"> <aside class="notes">
Parte burocrática da apresentação. Parte burocrática da apresentação.
PS: Pode ser que, quando você essa apresentação, 1.35 PS: Pode ser que, quando você essa apresentação, 1.37
não seja mais a versão atual; a cada 6 semanas, sai uma não seja mais a versão atual; a cada 6 semanas, sai uma
nova versão do compilador. nova versão do compilador.
</aside> </aside>
@ -128,28 +128,15 @@
<section> <section>
<h2> <h2>
História História
<img class="fragment" src="_images/AYV1X0yv.png" alt="" style="width:100px;margin:0"> <img src="_images/AYV1X0yv.png" alt="" style="width:100px;margin:0">
</h2> </h2>
<p> <p>
<span class="fragment">Basic</span> Basic (com números e estruturado), dBase III Plus,
<span class="fragment"> (com números e estruturado)</span> Clipper, Pascal, Cobol, Delphi (ObjectPascal),
<span class="fragment">, dBase III Plus</span> C, C++, ActionScript (Flash), PHP, JavaScript,
<span class="fragment">, Clipper</span> Python, Objective-C, Clojure, Java, Scala
<span class="fragment">, Pascal</span> <strong>, Rust.</strong>
<span class="fragment">, Cobol</span>
<span class="fragment">, Delphi (ObjectPascal)</span>
<span class="fragment">, C</span>
<span class="fragment">, C++</span>
<span class="fragment">, ActionScript (Flash)</span>
<span class="fragment">, PHP</span>
<span class="fragment">, JavaScript</span>
<span class="fragment">, Python</span>
<span class="fragment">, Objective-C</span>
<span class="fragment">, Clojure</span>
<span class="fragment">, Java</span>
<span class="fragment">, Scala</span>
<span class="fragment"><strong>, Rust.</strong></span>
</p> </p>
<aside class="notes"> <aside class="notes">
@ -162,6 +149,7 @@
- Perl - Perl
- Ruby - Ruby
- Haskell - Haskell
- Swift
</aside> </aside>
</section> </section>
@ -200,6 +188,7 @@
<section> <section>
<section> <section>
<h2>1. A Linguagem Mais Amada</h2>
<p> <p>
<a href="https://insights.stackoverflow.com/survey/2019"> <a href="https://insights.stackoverflow.com/survey/2019">
A linguagem mais amada segundo o StackOverflow A linguagem mais amada segundo o StackOverflow
@ -223,7 +212,7 @@
<section> <section>
<section> <section>
<h2>"Low Level Language with High Level Abstractions"</h2> <h2>2. "Low Level Language with High Level Abstractions"</h2>
</section> </section>
<section> <section>
@ -257,25 +246,13 @@
pra cima e pra baixo, Rust tem todas as abstrações pra cima e pra baixo, Rust tem todas as abstrações
de alto nível que estamos acostumados com outras de alto nível que estamos acostumados com outras
linguagens. linguagens.
</aside>
</section>
<section>
<img src="_images/nope.gif" alt="" class="stretch">
<aside class="notes">
Honestamente, se surgir uma nova linguagem que Honestamente, se surgir uma nova linguagem que
tenha mais proteções de memória, com performance tenha mais proteções de memória, com performance
ainda melhor que C mas eu tiver que escrever uma ainda melhor que C mas eu tiver que escrever uma
lista encadeada mais uma vez, eu destruo todas as lista encadeada mais uma vez, eu destruo todas as
coisas tecnológicas ao meu redor... coisas tecnológicas ao meu redor...
</aside>
</section>
<section>
<img src="_images/potato-farming-300x225.jpg" alt="" class="stretch">
<aside class="notes">
E vou plantar batata. E vou plantar batata.
... porque aprendemos absolutamente NADA sobre ... porque aprendemos absolutamente NADA sobre
@ -286,15 +263,16 @@
<section> <section>
<section> <section>
<h2>Compilador Chato mas Amigável</h2> <h2>3. Compilador Chato mas Amigável</h2>
</section> </section>
<section> <section>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
fn main() { fn main() -&lt; int{
let a = 2; let a = 2;
a = 3; a = 3;
println!("{}", a); println!("{}", a);
0
} }
</code></pre> </code></pre>
@ -379,7 +357,7 @@ fn main() {
<section> <section>
<section> <section>
<h2>Borrow Checker</h2> <h2>4. Borrow Checker</h2>
<aside class="notes"> <aside class="notes">
O "Borrow Checker" é uma das principais novidades O "Borrow Checker" é uma das principais novidades
@ -569,10 +547,6 @@ fn main() {
</aside> </aside>
</section> </section>
<section>
<img class="stretch" src="_images/builds-character.png" alt="">
</section>
<section data-transition="fade"> <section data-transition="fade">
<pre><code class="hljs go" data-trim>presente := Presente { ... } <pre><code class="hljs go" data-trim>presente := Presente { ... }
canal &lt;- presente canal &lt;- presente
@ -620,15 +594,12 @@ presente.abrir()</code></pre>
<section> <section>
<section> <section>
<h2>Hora da anedota!</h2> <h3>Hora da anedota!</h3>
<img class="stretch" src="_images/senta-que-la-vem-historia.gif" alt=""> <img class="stretch" src="_images/senta-que-la-vem-historia.gif" alt="">
</section>
<section> <p class="fragment"><code>localtime</code></p>
<p>localtime</p> <p class="fragment"><code>SimpleDateFormatter</code></p>
<p class="fragment">SimpleDateFormatter</p>
<aside class="notes"> <aside class="notes">
A muito tempo atrás, eu estava ajudando uma colega A muito tempo atrás, eu estava ajudando uma colega
@ -679,7 +650,7 @@ presente.abrir()</code></pre>
<section> <section>
<section> <section>
<h2>Tipos Algébricos</h2> <h2>5. Tipos Algébricos</h2>
</section> </section>
<section> <section>
@ -703,7 +674,7 @@ enum IpAddr {
<section> <section>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
let home = IpAddr::V4(String::from("127.0.0.1"); let home = IpAddr::V4(String::from("127.0.0.1"));
match home { match home {
V4(address) =&gt; println!("IPv4 addr: {}", address), V4(address) =&gt; println!("IPv4 addr: {}", address),
@ -724,7 +695,7 @@ enum Option&lt;T&gt; {
<section> <section>
<section> <section>
<h2>Error Control</h2> <h2>6. Error Control</h2>
</section> </section>
<section> <section>
@ -808,15 +779,11 @@ OK(())
<section> <section>
<section> <section>
<h2>Macros</h2> <h2>7. Generics/Traits</h2>
<small class="fragment">?</small>
</section>
</section> </section>
<section> <section>
<section> <h3>Structs</h3>
<h2>Structs</h2>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
struct Gift { struct Gift {
@ -831,20 +798,34 @@ struct Gift {
</section> </section>
<section> <section>
<h2>Structs</h2> <h3>Structs</h3>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
let presente = Gift { "red", "A GIFT!" }; let presente = Gift { package_color: "red", content: "A GIFT!" };
</code></pre> </code></pre>
</section> </section>
</section>
<section> <section>
<h3>Structs Genéricas</h3>
<pre><code class="hljs rust" data-trim>
struct Point&lt;T&gt; {
x: T,
y: T
}
</code></pre>
</section>
<section> <section>
<h2>Traits/Generics</h2> <h3>Structs Genéricas</h3>
<pre><code class="hljs rust" data-trim>
let my_point = Point&lt;f32&gt;(x: 1.0, y: 2.0);
</code></pre>
</section> </section>
<section> <section>
<h3>Enums Generics</h3>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
enum Result&lt;T, E&gt; { enum Result&lt;T, E&gt; {
Ok(T), Ok(T),
@ -854,6 +835,8 @@ enum Result&lt;T, E&gt; {
</section> </section>
<section> <section>
<h3>Traits</h3>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
trait Summary { trait Summary {
fn summarize(&amp;self) -&gt; String; fn summarize(&amp;self) -&gt; String;
@ -863,16 +846,16 @@ trait Summary {
<section> <section>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
struct Super { struct Phrase {
phrase: String phrase: String
} }
impl Summary for Super { impl Summary for Phrase {
fn summarize(&amp;self) -&gt; String { fn summarize(&amp;self) -&gt; String {
self.phrase self.phrase
.split_whitespace() .split_whitespace()
.map(|word| word.chars().nth(0).unwrap()) .map(|word| word.chars().nth(0).unwrap())
.collect(); .collect()
} }
} }
</code></pre> </code></pre>
@ -880,21 +863,10 @@ impl Summary for Super {
<section> <section>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
fn get_summary(summarizable: T) -&gt; String fn get_summary&lt;T&gt;(summarizable: T) -&gt; String
where T: Summary where T: Summary
{ {
... ...
}
</code></pre>
</section>
<section>
<h2>Structs genéricas</h2>
<pre><code class="hljs rust" data-trim>
struct Point&lt;T&gt; {
x: T,
y: T
} }
</code></pre> </code></pre>
</section> </section>
@ -904,7 +876,7 @@ struct Point&lt;T&gt; {
<section> <section>
<h2> <h2>
<a href="https://doc.rust-lang.org/cargo/"> <a href="https://doc.rust-lang.org/cargo/">
Cargo 8. Cargo
</a> </a>
</h2> </h2>
@ -921,7 +893,7 @@ struct Point&lt;T&gt; {
<section> <section>
<section> <section>
<h2>Tests</h2> <h2>9. Tests</h2>
<pre><code class="hljs rust" data-trim> <pre><code class="hljs rust" data-trim>
#[cfg(test)] #[cfg(test)]
@ -948,100 +920,54 @@ test tests::testing ... ok
<section> <section>
<section> <section>
<h2>Crazy stuff</h2> <h2>10. Macros</h2>
</section>
<section>
<a href="https://medium.com/@shnatsel/how-rusts-standard-library-was-vulnerable-for-years-and-nobody-noticed-aebf0503c3d6">How Rust’s standard library was vulnerable for years and nobody noticed</a>
</section>
<section>
<a href="https://medium.com/@sgrif/no-the-problem-isnt-bad-coders-ed4347810270">No, the problem isn’t “bad coders”</a>
</section>
<section> <small class="fragment">?</small>
<img src="_images/rust-issues.png" alt="4.5k issues no Github" class="stretch">
</section> </section>
<section> <section>
<a href="https://rustup.rs/">rustup</a> <h3>Log-Derive</h3>
<div class="fragment">
<small>stable-x86_64-pc-windows-msvc</small>
</div>
<div class="fragment">
<small>armv7-unknown-linux-gnueabihf</small>
</div>
<div class="fragment"> <pre><code>
<small>wasm32-unknown-unknown</small> <small class="fragment">(WebAssembly)</small> #[logfn(ok = "TRACE", err = "ERROR")]
</div> fn call_isan(num: &amp;str) -&gt; Result&lt;Success, Error&gt; {
if num.len() &gt;= 10 &amp;&amp; num.len() &lt;= 15 {
Ok(Success)
} else {
Err(Error)
}
}
</code></pre>
</section> </section>
</section> </section>
<!--
<section>
<section> <section>
<h2>Falando em WASM...</h2>
</section>
<section> <section>
<h2>WASM</h2> <h2>11. Crazy stuff</h2>
<p><a href="https://rustwasm.github.io/wasm-pack/installer/">wasm-pack</a></p>
</section> </section>
<section> <section>
<h2><a href="https://wasi.dev/">WASI</a></h2> <a href="https://medium.com/@shnatsel/how-rusts-standard-library-was-vulnerable-for-years-and-nobody-noticed-aebf0503c3d6">How Rust’s standard library was vulnerable for years and nobody noticed</a>
<p>The WebAssembly System Interface</p>
</section>
</section> </section>
-->
<section> <section>
<section> <a href="https://medium.com/@sgrif/no-the-problem-isnt-bad-coders-ed4347810270">No, the problem isn’t “bad coders”</a>
<h2>Bibliotecas</h2>
</section> </section>
<section> <section>
<h3>Rayon</h3> <img src="_images/rust-issues.png" alt="4.5k issues no Github" class="stretch">
<pre><code>
fn sum_of_squares(input: &amp;[i32]) -&gt; i32 {
input.iter()
.map(|&amp;i| i * i)
.sum()
}
</code></pre>
</section> </section>
<section> <section>
<h3>Rayon</h3> <a href="https://rustup.rs/">rustup</a>
<pre><code>
fn sum_of_squares(input: &amp;[i32]) -&gt; i32 {
input.par_iter()
.map(|&amp;i| i * i)
.sum()
}
</code></pre>
</section>
<section> <div class="fragment">
<h3>Log-Derive</h3> <small>armv7-unknown-linux-gnueabihf</small>
</div>
<pre><code> <div class="fragment">
#[logfn(ok = "TRACE", err = "ERROR")] <small>wasm32-unknown-unknown</small> <small class="fragment">(WebAssembly)</small>
fn call_isan(num: &amp;str) -&gt; Result&lt;Success, Error&gt; { </div>
if num.len() &gt;= 10 &amp;&amp; num.len() &lt;= 15 {
Ok(Success)
} else {
Err(Error)
}
}
</code></pre>
</section> </section>
</section> </section>

Loading…
Cancel
Save