Snips(一家作音频识别的创业公司) 出品。在神经网络领域,如今基本已经被 TensorFlow 和 PyTorch 给占了。可是对于移动设备或IoT这些性能受限的设备,还有不少空间能够尝试。TensorFlow组推出了 TensorFlow Lite,微软的 ONNX 看上去也颇有前景。一些硬件厂商也推出了他们本身的方案 Android NN API, ARM NN SDK , Apple BNNS 等等。可是它们都只能知足一些特定领域的需求。node
因而就有了 tract。在各个平台的性能评测,性能是 TensorFlow Lite 1.2 倍到 4.2 倍。看得人有点心动。程序员
Read More
Reporedis
Deno 是一个 JavaScript/TypeScript 运行时,做者其实就是 Node.js 做者。他以为 nodejs 生态已经没办法再提升质量了,就建立了这个新项目 deno。下面是 Rafał Pocztarski 的视频分享。数据库
Video编程
这是官方的 Rust SDK。Couchbase 是一个商业的 NOSQL 数据库。缓存
Repo安全
这篇文章做者很是喜欢 Rust,分析了一下目前 Rust 中的机器学习生态的状况。好比:网络
const-genericsapp
generic-array机器学习
packed_simd
RustaCUDA
rsmpi
rayon
ndarray
ndarray-linalg
ndarray-stats
最后,做者打赌 Rust 在 ML/DL 领域能大展宏图。进一步的讨论能够进 rust-ml 进行。
Read More
目的是研究 parakernel。
Repo
job link
用 Rust 开发机器人?好诱惑。
能够在线玩儿:Online Play。
这篇文章详细讲述了这个游戏的技术选型发展过程。目前,它综合使用了:ggez, WASM, itch.io, visuals, AI, campaign, tests 等技术。文章写得很是好,强烈推荐阅读。
问题出在手动实现 Error::type_id 和 Error::downcast 家族函数的交互上。
即将立刻发布 1.34.2 进行修补。
Read More
主要讲解了如何经过RESP实现一个redis client,并用rust实现了一个简单的demo,目前只实现了set和get命令,能够很方便的添加命令,项目地址以下redis-simple-rs欢迎你们完善。
@readlnh 投稿
Repo
Pr
这个的意思是,之后能够指示 cargo 去本地找依赖包缓存。而不是每次都检查网络了。很是实用的进展。
等等稳定版的发布,到时有使用说明。
听起来好像很厉害?
Repo
link 在这里讨论的,如今我来整理一下,下面的都是零开销的抽象:
tuple
gererics
traits
Option - 编译器最后(视状况)会把这一层包装优化掉
Vec
Box
Range
for-loops
mod
zero-sized types (C++ can't do that because every value needs to have an address)
enum discriminant optimizations which I hope are done for Option and friends (storing None as 0)
链式迭代器能够产生更快的代码,有时比for循环还快
await和Futures的实现估计也会比C++的实现消耗更少的内存分配,await不是零开销的,可是会保持不多
宏、构建脚本和常量初始化能够输出结构化的值,也是零开销
...
不是零开销的部分:
&dyn Trait
..
有人总结得好:
zero-cost does not mean no cost, it means no extra cost over manually writting code that does not use the abstraction, but emulates instead.
零开销不是指没有开销,而是指与不用(Rust给出的)抽象而用手动直接模拟实现相比,没有额外的开销。
In general: when Rust has a feature F which implements a programming aspect A, and your program requires implementing aspect A, just picking feature F is typically going to be the right choice; reimplementing A yourself (either in Rust or in C or ...) will not yield better performance
一般来说:当 Rust 有一个特性 F,它实现了一个编程的方面(解决了那样一种问题) A,如今你的程序要实现方面 A(解决那样一种问题),通常来讲,只须要直接拿起 F 使用就对了,你手动从新实现(用 Rust 或 C 或其它语言),并不能带来更好的性能。
C++ implementations obey the zero-overhead principle: What you don't use, you don't pay for [Stroustrup, 1994]. And further: What you do use, you couldn't hand code any better.
-- Stroustrup
C++的实现听从零开销原则:你用不到的东西,不会为其付出代价。更进一步:对于你用到的东西,你无法再作得更好。
-- Stroustrup
In the case of Rust, this applies even more since most of the optimization is offloaded to the compiler. In other words, in practice it is far easier to write slow C++ than slow Rust. In the case you are describing, tuples are slower because they are implemented above the compiler level and thus optimizations are left to the programmer. In Rust on the other hand, tuples are first-class citizens and they are optimized away by the compiler automatically.
对于Rust的状况来讲,编译器会承担大部分的优化工做,因此在这方面(相对于C++来讲)走得更远。换句话说,实践中每每更容易写出慢的C++代码,而不是慢的Rust代码。对于你描述的状况,元组慢是由于它们实如今编译器的上面一层,所以优化工做留给了程序员来作。而在Rust中,元组是一等公民,它们会被编译器自动优化掉。