author | title | date |
---|---|---|
Lukas Prokop |
Rust Graz – 00 Intro |
July 25, 2019 |
After one year w/o a talk, we are going to reboot RustGraz.
- Regular talks each month.
- Starting with introductory topics in summer 2019.
- English as preferred language to include internationals.
survey via framadate.org/TeSBAMxfWoUijdEI
github.com/rust-user-group-graz
Today:
…-graz/00-intro,
…-graz/01-getting-started,
…-graz/02-datatypes-and-iterator
Why a meetup about rust? We have a bunch of other meetups going in Graz.
rust is a multi-paradigm system programming language focused on safety, especially safe concurrency (via Wikipedia) and a rich type system and ownership model guaranteeing memory-safety and thread-safety (via rust-lang.org).
Ok. But does it work?
- Mozilla Research published rust to improve Firefox (Firefox Quantum, v57, 2×speed, 30% less RAM than Chrome, 75% of Firefox's code rewritten, 5 mio. LOCs, servo project)
- pairity.io develops the “fastest and most advanced Etherum client“ (Pairity Etherum), “a framework for building blockchains and spawning decentralised innovation“ (Parity Substrate), “the next-generation platform for connecting independent blockchains together“ (Polkadot) and others.
- npm registry uses rust for its CPU-bound bottlenecks
- Several components of the Dropbox core file-storage system were written in Rust to pursue greater datacenter efficiency
- Redox (redox-os.org) is a Unix-like Operating System written in Rust, aiming to bring the innovations of Rust to a modern microkernel and full set of applications
- “Writing an OS in Rust” (os.phil-opp.com)
- Jix (jix.one) implements a SAT solver “Varisat” in rust and blogs about its design
- TLS performance: rustls versus OpenSSL (15% quicker to send data, 5% quicker to receive data, 30-70% quicker to resume a client connection, …, uses less than half the memory of OpenSSL)
- For the fourth year in a row, Rust is the most loved¹ programming language among our respondents, followed close behind by Python, the fastest-growing major language today
(stackoverflow Developer Survey Results 2019)¹ most loved means “high percentage of developers who are currently using rust express high interest in continuing to do so“
So rust is great and saves the world?
- We saw some positive sides
- Let's talk about some negative sides
Literature:
- Criticizing the Rust Language, and Why C/C++ Will Never Die by afiskon (translated to English), abridged version by Quxxy
- Rust is not a good C replacement by Drew DeVault
- Since
unsafe
exists, Rust is no better than C++ for safety. - Safe Rust is not as fast as C++, so you need to write in unsafe, thus there's no point.
- C++ has fuzzers and static checkers, and you can write tests.
- Rust has five incompatible kinds of pointers (example is that you can't go from having pointers to the heap to pointers to the stack without changing types).
Vec<Rc<RefCell<Box<Trait>>>>
- Rust doesn't insert the necessary Rcs and Boxes for you.
- Macros are a crutch and will prevent any good IDEs from existing.
- “cargo actively encourages downloading packages directly from git repositories”
- “C++ doesn't restrict programmers regarding what they can or cannot use.”
- Smart pointers aren't perfect.
- No strict description of Rust's semantics.
- “the source of troubles is usually in humans”
- There are no Rust jobs.
- “kitchen sink” programming language: language solves problems by adding more language features.
New features per year:
C → 0.73, Go → 2, C++ → 11.3, Rust → 15 - C is the most portable programming language
- C has a spec
- C has many implementations
- C has a consistent & stable ABI
- Cargo is mandatory
- Concurrency is generally a bad thing
- Safety
“Go is the result of C programmers designing a new programming language, and Rust is the result of C++ programmers designing a new programming language”
- Dec 2017–end 2019
- self-employed software developer (python, Go)
- Oct 2019+
- IAIK PhD student in infosec (interest in RISC-V)
- Others
- bachelor's degree math student
- co-organizer of PyGraz and Grazer Linuxtage
- I didn't have time to program rust for too long. Let's get serious in the next months [together]!
I don't think rust should be your first programming language. Thus, I assume familiarity with fundamental programming concepts.