<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">

        <title>Rust LATAM 2019</title>

        <meta name="description" content="Rust Latam 2019">
        <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 outside;
            }

            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);
            }
        </style>
    </head>

    <body>
        <div class="reveal">
            <div class="slides">
                <section>
                    <section data-background="_images/rustlatam.png" data-header>
                        <h1 class="semi-opaque">Rust Latam 2019</h1>
                    </section>
                </section>

                <section>
                    <section>
                        <img src="_images/avatar-20170726.png" alt="Me" style="float:left;width:200px;" class="no-border">

                        <div>
                            <ul class="empty">
                                <li>Júlio Biason</li>
                                <li>https://functional.cafe/@juliobiason</li>
                                <li>julio.biason@pm.me</li>
                                <li><a href="http://presentations.juliobiason.net">http://presentations.juliobiason.net</a></li>
                            </ul>
                        </div>
                    </section>
                </section>

                <section>
                    <section>
                        <img src="_images/rustlatam-travel.png" alt="" class="stretch">

                        <aside class="notes">
                            O Rust Latam foi o primeiro evento de Rust na América
                            Latina e aconteceu em Montevidéo, a 815km de Porto
                            Alegre.
                        </aside>
                    </section>

                    <section>
                        <img src="_images/several-song-filled-hours-later.jpg" alt="" class="stretch">
                    </section>
                </section>

                <section>
                    <section>
                        <h2>Workshops</h2>

                        <h4>
                            <a href="https://rustwasm.github.io/book/game-of-life/implementing.html">
                                Learning WebAssembly and Rust
                            </a>
                        </h4>

                        <aside class="notes">
                            No primeiro dia, eu fui no workshop de webassembly.
                            Foi uma apresentação bem introdutória, inclusive
                            para quem não conhecia Rust, mas que me ajudou um
                            bocado a entender o Borrow Checker.

                            A apresentação das ferramentas foi bem completa,
                            mas a parte de webassembly foi totalmente "chupada"
                            do livro do RustWasm.

                            Mesmo assim, foi uma baita apresentação.
                        </aside>
                    </section>
                </section>

                <section>
                    <section>
                        <img class="stretch" src="_images/the-next-day.jpg" alt="">
                    </section>

                    <section>
                        <h2>Talks Day</h2>
                    </section>
                </section>

                <section>
                    <section>
                        <h2>
                            <a href="https://nikomatsakis.github.io/rust-latam-2019/#1">
                                Opening Keynote
                            </a>
                        </h2>

                        <h3>Niko Matsakis</h3>
                    </section>

                    <section>
                        <p>História do Rust</p>
                    </section>

                    <section>
                        <img class="stretch" src="_images/rustlatam-openingkeynote1.png" alt="">
                    </section>

                    <section>
                        <img class="stretch" src="_images/rustlatam-openingkeynote2.png" alt="">
                    </section>

                    <section>
                        <img class="stretch" src="_images/rustlatam-openingkeynote3.png" alt="">
                    </section>

                    <section>
                        <img class="stretch" src="_images/rustlatam-openingkeynote4.png" alt="">
                    </section>

                    <section>
                        <p>"Rust is Open"</p>
                    </section>
                </section>

                <section>
                    <section>
                        <h2>
                            <a href="https://docs.google.com/presentation/d/140eKS9HLAfpb1Qi5J9xBpUcuxIhGDIejH7B8N2pmW5M/edit#slide=id.p1">
                                Defense Against The Wrong Logic: Proactive Rust Coding
                            </a>
                        </h2>
                        <h3>Michael Gattozzi</h3>
                    </section>

                    <section>
                        <p><code>type</code> é para áliases.</p>

                        <pre><code class="hljs rust" data-trim>
type Farenheit = i32;
type Celsius = i32;

fn is_it_hot(t: Farenheit) -&gt; bool;

let temp: Celsius = 32;
is_it_hot(temp);
                        </code></pre>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
struct Celsius(i32);
struct Farenheit(i32);
                        </code></pre>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
impl Into&lt;Celsius&gt; for Farenheit {
    fn into(c: Celsius) -&gt; Self {
        Self(((c.0 + 9) / 5) as i32 + 32);
    }
}

is_it_hot(temp.into());
                        </code></pre>
                    </section>

                    <section>
                        <img class="stretch" src="_images/rustlatam-defensive.png" alt="">
                    </section>
                </section>

                <section>
                    <section>
                        <h2>
                            <a href="https://slides.com/otaviopace/deck-5#/">
                                Interop with Android, IOS and WASM in the same project
                            </a>
                        </h2>
                        <h3>Otávio Pace</h3>
                    </section>

                    <section>
                        <h3>FFI</h3>

                        <table>
                            <thead>
                                <tr>
                                    <th>OS</th>
                                    <th>How?</th>
                                </tr>
                            </thead>

                            <tbody>
                                <tr>
                                    <td>iOS</td>
                                    <td>C integration</td>
                                </tr>

                                <tr>
                                    <td>Android</td>
                                    <td>JNI</td>
                                </tr>

                                <tr>
                                    <td>Web</td>
                                    <td>WASM</td>
                                </tr>
                            </tbody>
                        </table>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
mod common;

#[cfg(target_os = "android")]
mod android;

#[cfg(target_os = "ios")]
mod ios;

#[cfg(target_arch = "wasm32")]
mod wasm;
                        </code></pre>
                    </section>
                </section>

                <section>
                    <section>
                        <h2>Rebuilding the Stack for Serverless</h2>
                        <h3>Sergio Benitez</h3>
                    </section>

                    <section>
                        <h4>Cold Start Preformance</h4>

                        <table>
                            <thead>
                                <tr>
                                    <th>Service</th>
                                    <th>Time</th>
                                </tr>
                            </thead>

                            <tbody>
                                <tr>
                                    <td>AWS Lambda</td>
                                    <td>~1.5s</td>
                                </tr>

                                <tr>
                                    <td>Google Cloud Functions</td>
                                    <td>&gt;2s</td>
                                </tr>

                                <tr>
                                    <td>Fastly Terrarium (WASM)</td>
                                    <td>~500ms</td>
                                </tr>

                                <tr>
                                    <td>$2.50 VPS + NGINX</td>
                                    <td>~30ms</td>
                                </tr>
                            </tbody>
                        </table>

                    </section>

                    <section>
                        <h4>Idea</h4>

                        <ul>
                            <li>Load executable directly into memory</li>
                            <li>Run code</li>
                        </ul>
                    </section>
                </section>

                <section>
                    <section>
                        <h2>WebAssembly with Rust</h2>
                        <h3>Kevin Hoffman</h3>
                    </section>

                    <section>
                        <p>
                            Autor do livro
                            <a href="https://pragprog.com/book/khrust/programming-webassembly-with-rust">Programming WebAssembly with Rust</a>
                        </p>
                    </section>

                    <section>
                        <img class="stretch" src="_images/rustlatam-asmjs.jpg" alt="">
                    </section>
                </section>

                <section>
                    <section>
                        <h2>
                            <a href="https://estebank.github.io/rust/">
                                Friendly Ferris: Developing Kind Compiler Errors
                            </a>
                        </h2>
                        <h3>Esteban Kuber</h3>
                    </section>
                </section>

                <section>
                    <section>
                        <h2>
                            <a href="https://rustlatam.org/assets/slides/proc-macros-sliced-bread.pdf">
                                Procedural Macros vs Sliced Bread
                            </a>
                        </h2>
                        <h3>Alex Crichton</h3>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
#[proc_macro]
pub fn println(input: TokenStream) -&gt; TokenStream
{
   // ???
}
                        </code></pre>
                    </section>
                </section>

                <section>
                    <section>
                        <h2><a href="https://speakerdeck.com/skade/the-power-of-the-where-clause">The Power of the "Where" Clause</a></h2>
                        <h3>Florian Gilcher</h3>
                    </section>

                    <section>
                        <p>"Don't start out very generic, refactor towards it!"</p>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
fn debug_iter&lt;I&gt;(iter: I) 
where
    I: Iterator,
    I::Item: Debug
{
    // ...
}
                        </code></pre>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
trait State { }
trait TerminalState { }
                        </code></pre>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
trait TransitionTo&lt;S&gt;
where S: State,
      Self: State
{
    fn transition(self) -&gt; S;
}

trait Terminate
where Self: TerminalState
{
    fn terminate(self);
}
                        </code></pre>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
struct Start;
impl State for Start {}

struct Loop;
impl State for Loop {}

struct Stop;
impl State for Stop {}
impl TerminalState for Stop {}
                        </code></pre>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
impl TransitionTo&lt;Loop&gt; for Start {
    fn transition(self) -&gt; Loop { ... }
}

impl TransitionTo&lt;Loop&gt; for Loop {
    fn transition(self) -&gt; Loop { ... }
}

impl TransitionTo&lt;End&gt; for Loop {
    fn transition(self) -&gt; End { ... }
}

impl Terminate for End {
    fn terminate(self) { ... }
}
                        </code></pre>
                    </section>

                    <section>
                        <pre><code class="hljs rust" data-trim>
fn main() {
    let initial = Start;
    let next: Loop = initial.transition();
    let next: Loop = next.transition();
    let next: End = next.transition();
    next.terminate();
}
                        </code></pre>
                    </section>
                </section>

                <section>
                    <section>
                        <h2>Closing Keynote</h2>
                        <h3>Without Boats</h3>
                    </section>

                    <section>
                        <p>Estado geral do <code>async</code> em Rust.</p>
                    </section>

                    <section>
                        <img class="stretch" src="_images/rustlatam-async1.jpg" alt="">
                    </section>

                    <section>
                        <img class="stretch" src="_images/rustlatam-async2.jpg" 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>