没有合适的资源?快使用搜索试试~ 我知道了~
Rust是Mozilla开发的注重安全、性能和并发性的编程语言。“Rust”,由web语言的领军人物Brendan Eich(js之父),Dave Herman以及Mozilla公司的Graydon Hoare 合力开发
资源推荐
资源详情
资源评论
A language design
prelude
2
•
We designed Rust to bridge the performance gap
between safe and unsafe languages.
•
Design choices that seem complicated or
surprising on first glance are mostly choices that
fell out of that requirement.
•
Rust’s compiler and all language tools are open-
source (MIT/Apache dual license).
CC-BY-NC-SA image, Pamela Rentz
2
Tuesday, June 25, 13
this is mostly a talk about how to write code, but I couldn’t resist putting in some language design content,
because to explain Rust it’s important to understand the problems we faced designing for a domain where
performance concerns mean you can’t just do things like boxing/gc’ing everything
Systems Programming
•
Efficient code operating in resource-
constrained environments with direct control
over hardware
•
C and C++ are dominant; systems
programmers care about very small
performance margins
•
For most applications we don’t care about
the last 10-15% of performance, but for
systems we do
3
CC-BY-NC-SA image, Tom Ryan
3
Tuesday, June 25, 13
ask for show of hands, how many people are C hackers, how many primarily in Java-ish languages
“what is systems programming?” (point 1)
“there’s a good reason why C is dominant”;
I argue that the look & feel of the language necessarily follow from designing so as to bring safety to systems
programming
Well, what’s wrong with
C, then?
4
“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
buffer overflows
null pointer dereferences
memory
leaks
dangling pointers
format string errors
double frees
array bounds errors
4
Tuesday, June 25, 13
(This gives you more confidence that Rust programs will be reliable, not absolute
confidence. Compilers and runtime systems may have bugs. Unsafe code voids the warranty. Offer not valid in
Nebraska.)
buffer overflows
null pointer dereferences
memory
leaks
dangling pointers
format string errors
double frees
array bounds errors
“Well-typed programs
don’t go wrong”
•
What would it mean to go wrong?
•
Rust’s type system is designed to be
sound, which means:
•
We can predict program behavior
independently of language
implementation
5
Milner, “A theory of type
polymorphism in programming”,
1978
5
Tuesday, June 25, 13
剩余69页未读,继续阅读
资源评论
sinat_32723015
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- js基础但是这个烂怂东西要求标题不能少于10个字才能上传然后我其实还没有写完之后再修订吧.md
- electron-tabs-master
- Unity3D 布朗运动算法插件 Brownian Motion
- 鼎微R16中控升级包R16-4.5.10-20170221及强制升级方法
- 鼎微R16中控升级包公版UI 2015及强制升级方法,救砖包
- 基于CSS与JavaScript的积分系统设计源码
- 生物化学作业_1_生物化学作业资料.pdf
- 基于libgdx引擎的Java开发连连看游戏设计源码
- 基于MobileNetV3的SSD目标检测算法PyTorch实现设计源码
- 基于Java JDK的全面框架设计源码学习项目
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功