《不仅仅是内存安全:Rust 如何帮助维护高效软件.pdf》由会员分享,可在线阅读,更多相关《不仅仅是内存安全:Rust 如何帮助维护高效软件.pdf(103页珍藏版)》请在三个皮匠报告上搜索。
1、Not Just Memory SafetyHow Rust Helps Maintain Efficient SoftwareQCon London,April 9th 2024 The Rust Programming Language8 yearsMost loved language in the StackOverflow surveyMemory safetyRust prevents whole classes of vulnerabilities70%Vulnerabilities in Microsoft productsdue to memory safety issues
2、You are probably using a memory safe language!JavaScript,Python,Ruby,Swift,Java,Go.Rust enables efficient and maintainable codeAstrals UV package manager for Python10 x-115xFaster than pip215 hours/monthCI time saved by Home Assistant with UVHow can you leverage Rust?Pietro AlbiniRust Projects Infra
3、,Release and Security Previously,Rust Infra Lead and Rust Core TeamFerrocene Technical Lead at Ferrous Systems hachyderm.io/pietroalbini www.pietroalbini.orgRust is not an easy language to learnRust forces a different programming modelSingle ownership of data,borrowed to the rest of the codeOnce you
4、 internalize that mental modelRust becomes way easier to writeRust teams at Google are as productiveas ones using Go,and more thantwice as productive as teams using C+.Lars Bergstrom,Director of Engineering,Google AndroidWe all make Rust harder for ourselves to learnSqueezing every bit of performanc
5、e requiresa solid understanding of RustYoure not alone when learning Rust!The compiler is your pair programmerGood and actionable compiler errorsBad error messages are considered bugs!errorE0382:use of moved value:data-main.rs:10:11|8|let data=example.to_string();|-move occurs because data has type
6、String,which|does not implement the Copy trait9|drop(data);|-value moved here10|print(data);|value used here after move|help:consider cloning the value if the performance cost is acceptable|9|drop(data.clone();|+errorE0382:use of moved value:data-main.rs:10:1110|print(data);|value used here after mo