【Rust每日新闻】 2018-12-24
在2018 edition中不在需要serde_derive
只需要在Cargo.toml中引入:
serde = { version = "1.0", features = ["derive"] }
然后在代码中导入Serialize和Deserialize即可。
use serde::{Serialize, Deserialize};
「深度学习」简单神经网络:Rust vs Python
本文通过实现一个简单的Kohonen-Grossberg神经网络,来比较Python和Rust。该神经网络用Python实现需要60行代码。然后作者使用Rust移植Python实现。
性能比较:
Python Rust Lines
72.114 13.1077 24
117.7726 18.2308 48
141.9611 18.8265 100
476.7803 21.0633 500
884.6529 23.1228 1000
4243.2031 66.7547 4999
124274.4748 1751.4639 150000
当然是Rust性能好啦。处理15w行数据,Rust只需要大约1751毫秒,而Python需要124274毫秒。按这个数据看,Rust大概比Python快71倍左右。
有的人可能会有疑问:为什么要用Rust和Python比?怎么不和C++比?大概有三点原因:
- python在神经网络中应用比较广。
- Rust的语言表达力和Python有得一拼。看看文章中代码实现就知道了。
- Rust和C++的性能比拼,每天都有人做。
XORcism:破解xor加密文件的Rust命令行工具
可以在命令行对rotating-xor之类加密的数据进行解密。
*-sys系列库使用教程
* -sys是帮助Rust程序使用C(“System”)库的crate命名约定,例如: libz-sys,kernel32-sys,lcms2-sys。 sys crates的任务是向Rust(FFI)公开一个最小的底层C接口,并告诉Cargo如何与库链接。
WebAssembly和Rust实现的虚拟dom
Rust实现的玩具版Erlang VM
未来的目标也打算支持elixir
用于管理Specs中的组件
「小项目」bashdoc: 可以为自定义的bash生成文档
Rust中数组的初始化方法
这篇文章罗列了Rust中几乎所有的数组初始化方法,并且介绍了自己实现的宏
「安全」 lachesis: web服务批量扫描工具
每日新闻订阅地址:
欢迎通过GitHub issues投稿。
Leave 【Rust每日新闻】 2018-12-24 to:
Read more #rust posts
Best Posts From ChaosBot
We have not curated any of blackanger's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From ChaosBot
- 【Rust日报】 2019-09-06
- 【Rust日报】 2019-09-05
- 【Rust日报】2019-09-04
- 【Rust日报】 2019-09-03
- 【Rust日报】 2019-09-01
- 【Rust日报】 2019-08-30
- 【Rust日报】 2019-08-29
- 【Rust日报】 2019-08-28
- 【Rust日报】 2019-08-27
- 【Rust日报】2019-08-26
- 【Rust日报】 2019-08-25
- 【Rust日报】 2019-08-24
- 【Rust日报】 2019-08-23
- 【Rust日报】 2019-08-22
- 【Rust日报】 2019-08-21
- 【Rust日报】2019-08-20
- 【Rust日报】2019-08-19
- 【Rust日报】2019-08-18
- 【Rust日报】 2019-08-17
- 【Rust日报】 2019-08-16