Rust es un lenguaje de programación de código abierto desarrollado por Mozilla Research. Fue diseñado para ser seguro, concurrente y eficiente. Algunas características clave de Rust incluyen la seguridad de memoria garantizada, abstracciones de cero costo y un tiempo de ejecución mínimo. Rust se usa en proyectos como el motor de navegador paralelo Servo y el compilador Rustc. Es financiado por organizaciones como Mozilla y Samsung.
2. ARKHO Innova
Meetup series
Gracias por su asistencia!!!
• Un espacio para compartir experiencias y conocimiento
• Un espacio para hacer relaciones entre personas y
equipos con intereses afines
• Un espacio para pasarla bien
4. Historia
• 2006: Graydon Hoare empieza escribir Rust como side-project
• 2009: Mozilla se involucra en el proyecto
• 2010: Mozilla lo anuncia
• 2011: Rust se auto-compila con éxito
• 2015: Primera versión estable
• 2017: Rust 1.20
16. Algunas características
• Type Inference
• Immutability by default
• Private by default
• Strings UTF8 by default
• Short key words
• Snake case
• Generics
• Traits
• Macros
• Annotations
• Matching Patterns
19. No hay NULL
•Option<T>
•Result<R, E>
I call it my billion-dollar mistake. At that time, I was designing the first comprehensive type
system for references in an object-oriented language. My goal was to ensure that all use of
references should be absolutely safe, with checking performed automatically by the compiler.
But I couldn't resist the temptation to put in a null reference, simply because it was so easy to
implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have
probably caused a billion dollars of pain and damage in the last forty years.
Tony Hoare, the inventor of null
Pero,
Existen:
23. Ownership & Borrowing
• Como Rust maneja la memoria
• Es lo que hace Rust difícil al principio
• Es lo que lo hace rápido y seguro (incluyendo thread safe)
• Requiere entender como funciona la memoria en un programa (Stack / Heap)
• Ownership
• Cada valor en Rust tiene una variable llamado su dueño (owner)
• Solo puede tener un dueño al mismo tiempo
• Cuando el dueño sale del scope, su valor esta suprimida
• Borrowing
• Cuando se pasa por referencia un valor, se llama prestar (borrow)
• Una nueva familia de errores de compilación
• Fallar al compilar > Fallar al ejecutar
28. ¿Con ganas de más?
• Source code Demo
• rest-in-rust - Rest API in Rust with Iron
https://github.com/arkhotech/rest-in-rust
• tokio-echo - Tokio Echo Server in Rust
https://github.com/arkhotech/tokio-echo
• Contribute to micropoc development by creating an account on GitHub.
https://github.com/arkhotech/micropoc/tree/master/OrderService