#import "./template.typ": * #set math.mat(delim: "[") #set text(font: "IoskeleyMonoTerm Nerd Font") #show math.equation: set text(font: "Fira Math") #import "@preview/codly:1.3.0": * #import "@preview/codly-languages:0.1.1": * #import "@preview/cetz:0.5.2" #show: codly-init.with() #codly(languages: codly-languages) #show: slides.with( title: "La carcinización del software", subtitle: "El impacto de Rust en el mundo", date: "CodeOn 2026, 17/10/2026", corner-logo: image("./figures/rust-peru-logo.png"), authors: "Max Jacinto", affiliations: [ Max Jacinto #v(0.15em) Alex Villanueva ], ratio: 16 / 9, layout: "medium", count: "number", title-color: rgb("#f0742c"), toc: false, theme: "full", ) = Una mini presentación de la comunidad == Un poquitito sobre nosotros #grid( columns: (auto, auto), [ //#image("/figures/comunidad.jpeg", width: 90%, fit: "contain") #align(center + horizon)[ #image("/figures/f13_rust_2026.jpg", width: 85%) Un recuerdo de la F13 2026 :) ] ], [ #align(center + horizon)[ #image("/figures/rust_peru_qr.svg", width: 85%) ] ], ) = El origen del lenguaje == Trauma compartido #columns(2, gutter: -5%)[ #image("/figures/spongebob_office.jpg", width: 90%, fit: "contain") #colbreak() #image("/figures/java_error_logs.png") ] == La decisión que cambió todo #columns(2, gutter: -5%)[ #image("/figures/elevator.jpg", width: 90%, fit: "contain") #colbreak() #image("/figures/graydon.jpg") ] == Errores que nos cuestan noches sin dormir #grid( columns: (auto, auto), gutter: 1em, [ #align(center + horizon)[ ```C #include int main(void) { int num_list[4] = {1, 2, 3, 4}; for (int i = 0; i <= 4; i++) { printf("%d\n", num_list[i]); } printf("¿Qué hago acá?"); return 0; } ``` ] ], [ #align(center + horizon)[ ```rust fn main() { let num_list = [1, 2, 3, 4]; for i in 0..=4 { println!("{}", num_list[i]); } println!("¿Qué hago acá?") } ``` ] ], ) == ¡Ay caramba! #grid( columns: (auto, auto), gutter: 1em, [ #align(center + horizon)[ #image("/figures/output_c.png") ] ], [ #align(center + horizon)[ #image("/figures/output_rs.png", width: 110%) ] ], ) == De inicios humildes a recibir apoyo de gigantes #let concept-box(body) = box( width: 5cm, height: 2.25cm, inset: (x: 1em, y: 0.35em), radius: 0.45em, fill: gray.lighten(95%), stroke: 1pt + rgb("#f0742c"), )[#align(center + horizon)[#text(1.25em, weight: "bold")[#body]]] #v(2.6cm) #align(center)[ #grid( columns: (auto, auto, auto), gutter: 1em, align: horizon, concept-box([#image("/figures/mozilla_logo.svg")]), box(height: 1.75cm)[#align(center + horizon)[#text( 2em, weight: "bold", fill: rgb("#f0742c"), )[$arrow.r.long$]]], concept-box([#image("/figures/rf-logo-primary-black.png")]), ) ] = ¿Cómo logró Rust diferenciarse del resto? == Comparación con otros lenguajes #align(center + horizon)[ #table( columns: (2fr, 2fr, 2fr, 4fr), align: (left + horizon, center + horizon, center + horizon, left + horizon), stroke: 0.5pt + luma(180), fill: (x, y) => if y == 0 { rgb("f0f0f0") } else { none }, [*Lenguaje*], [*Velocidad*], [*Seguridad de memoria*], [*¿Cómo lo logra?*], [C / C++], [#text(fill: green.darken(20%), weight: "bold", "Ultrarrápido")], [#text(fill: red, weight: "bold", "Inseguro")], [Gestión manual de memoria (`malloc`/`free`, punteros).], [Java / Python / Go], [#text(fill: orange, weight: "bold", "Moderado / Lento")], [#text(fill: green.darken(20%), weight: "bold", "Seguro")], [Un *Garbage Collector (GC)* escanea la RAM en tiempo de ejecución para liberar memoria.], [Rust], [#text(fill: green.darken(20%), weight: "bold", "Ultrarrápido")], [#text(fill: green.darken(20%), weight: "bold", "Seguro")], [*Ownership* y *Borrow Checker* en tiempo de compilación. ¡Libre de GC!], ) ] == Dejando atrás el GC #image("/figures/rust_ownership_3.png", width: 90%) == Ownership & Borrow Checking == Ownership (Propiedad) - *Un único dueño:* Cada valor en memoria pertenece a una sola variable propietaria a la vez. - *Liberación automática:* Cuando el dueño sale de su ámbito (_scope_), la memoria se libera inmediatamente. - *Semántica de transferencia (_Move_):* Asignar un valor a otra variable transfiere su propiedad e inhabilita la variable original, evitando la doble liberación de memoria (_double free_). - *Cero costo en ejecución:* Toda la gestión se resuelve en tiempo de compilación. // #colbreak() == Borrow Checker (Préstamos) - *Referencias siempre válidas:* Garantiza antes de ejecutar el programa que ningún puntero apunte a memoria que ya fue liberada. - *Exclusión mutua de acceso:* Permite infinitas referencias de lectura (`&T`) *_o_* una sola referencia de escritura (`&mut T`), pero nunca ambas al mismo tiempo. - *Sin carreras de datos (_Data Races_):* Al prohibir la mutabilidad concurrente no controlada, elimina por completo errores de hilos en tiempo de compilación. - *Verificación de ciclos de vida (_Lifetimes_):* Rastrea cuánto tiempo vive cada dato para asegurar que una referencia jamás sobreviva al valor que referencia. //] = Pero, ¿en qué puede usarse Rust? #let logo-card(path, label, note: none, highlight: false) = box( width: 100%, height: 2.5cm, inset: 0.35em, radius: 0.45em, fill: if highlight { rgb("#f0742c").lighten(88%) } else { gray.lighten(95%) }, stroke: if highlight { 1.2pt + rgb("#f0742c") } else { 0.6pt + gray.lighten(70%) }, )[ #align(center + horizon)[ #image(path, height: 1.15cm, fit: "contain") #if label != none [ #v(0.15em) #text(weight: if highlight { "bold" } else { "regular" })[#label] ] #if note != none [ #v(0.15em) #text(size: 0.65em, fill: gray.darken(35%))[#note] ] ] ] == ¡Un poco de todo! #grid( columns: (1fr, 1fr), gutter: 1em, [ #align(center)[*Parte de grandes empresas*] #v(0.2em) #grid( columns: (1fr, 1fr), gutter: 0.5em, [ #v(1.2em) #align(center + horizon)[ #grid( columns: (1fr, 1fr), gutter: 0.5em, logo-card( "./figures/openai.png", none, note: [OpenAI], ), logo-card( "./figures/dropbox.png", none, note: [Dropbox], highlight: true, ), logo-card( "./figures/nasa.png", none, highlight: true, note: [NASA], ), logo-card( "./figures/aws.webp", none, note: [AWS], ), ) ] ], [ #v(1.2em) #align(center + horizon)[ #grid( columns: (1fr, 1fr), gutter: 0.5em, logo-card( "./figures/huawei.webp", none, note: [Huawei], ), logo-card( "./figures/samsung.png", none, highlight: true, note: [Samsung], ), logo-card( "./figures/Meta-Logo.png", none, note: [Meta], highlight: true, ), logo-card( "./figures/cloudflare-logo.webp", none, note: [Cloudflare], ), ) ] ], ) ], [ #align(center)[*Parte de nuestro día a día*] #v(0.2em) #align(center + horizon)[ #grid( columns: (1fr, 1fr), gutter: 0.5em, logo-card( "./figures/Microsoft-Logo.png", none, note: [Parte del kernel de Windows], ), logo-card( "./figures/LinuxKernel.png", none, note: [Parte del kernel de Linux], ), logo-card( "./figures/android-logo.png", none, note: [Gran parte del kernel de Android], ), logo-card( "./figures/macos.png", none, note: [Parte del Private Cloud Compute], ), ) ] ], ) == ¿Y cómo puedo utilizarlo yo? #align(center + horizon)[#image("./figures/gauntlet.png")] = Mitos vs No-tan-mitos == ¿Realmente Rust es tan yuca? #align(center + horizon)[#image("./figures/3roads.png")] == La impresión que se tiene #align(center + horizon)[#image("./figures/curve.png")] == Pero como con cualquier cosa... #align(center + horizon)[#image("./figures/rust-curve.jpg")] == Y una vez le agarramos la maña #align(center + horizon)[#image("./figures/rust-productivity-curve.png")] = Probando el lenguaje