【Rust日报】 2019-04-12 - Rust 1.34 稳定版发布

Rust 1.34 稳定版发布

#stable_rust


$ rustup update stable

该稳定版本包括如下变动:

  • 引入了cargo registries,此功能允许你指定crates.io之外发布的crate,甚至一些闭源的crate。

  • 文档测试支持?语法

  • 过程宏中的自定义属性#[attr()],#[attr[]], 和#[attr{}] 可以接受token流。之前的unrestricted_attribute_tokens Features。

  • TryFrom和TryInto稳定

  • 弃用fn before_exec而使用unsafe fn pre_exec

  • 稳定了一些标准库API,比如Instant::checked_add/ Instant::checked_sub等

  • 支持extern crate self as foo;将当前crate的root导出为指定别名

  • 支持新的target:riscv64imac-unknown-none-elfriscv64gc-unknown-none-elf,以及powerpc64-unknown-freebsd

  • 可以使用-C linker-plugin-lto启用链接器插件LTO优化, 使得rustc将Rust代码编译为LLVM bitcode,从而允许LLVM跨C / C ++ FFI边界执行LTO优化

更多内容请看官方release notes。

https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html

https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1340-2019-04-11

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=14757b61cc384f085a63efea3002b96d



如何在Rust测试中Mock时间

#mock

https://blog.iany.me/2019/03/how-to-mock-time-in-rust-tests-and-cargo-gotchas-we-met

https://github.com/doitian/rust-mock-time-demo


「系列文章」JavaScript解析和求值

#javascript #parser

该文作者在之前分享了如何使用Rust实现一个基于状态机的高性能的JS词法分析器。这之后,又开始写系列文章分享他的心得。

https://medium.com/@retep007/javascript-lexing-for-high-performance-f9a800ec930d

https://medium.com/@retep007/javascript-evaluator-part-2-parser-and-basic-evaluator-d306ff1aec83

https://github.com/retep007/javascript-es9-parser



Atom 1.36选用了ripgrep

#ripgrep #atom

使用Ripgrep极大地提升了Atom项目内查找的性能,在文件量很大的情况下尤为明显。不过需要专门通过设置使用Rip Grep选项手动打开。

https://blog.atom.io/2019/04/09/atom-1-36.html



orange_slice: 用于研究的确定性的虚拟机管理程序

#kernel #hypervisor

https://github.com/gamozolabs/orange_slice



Crossterm 0.9 发布

#crossterm #terminal

crossterm用于跨平台的终端操作,可以与Tui-rs集成使用。

https://github.com/TimonPost/crossterm

http://atcentra.com/crossterm/



「讨论」如何解读StackOverflow上面Rust连续四年成为最受开发者喜欢语言的这一事实?

#reddit #stackoverflow

该贴作者对这个结果做出了以下可能的解释:

  • 跨越了学习曲线的人真的都喜欢Rust

  • 开发人员喜欢新的技术,即使他们还没了解Rust,但他们认为应该重视它。(这个角度来看的话,排名第二的Python看上去就比较诡异)

  • Rust社区是一个非常友好的社区

  • Rust社区营销的比较好

  • 有许多C++开发者因为Rust的安全性而选择它




到底是什么原因呢?这个话题下评论区讨论比较激烈。

(我喜欢Rust,是因为Rust这门语言恰好符合我对理想编程语言的某些预期。你是什么原因喜欢Rust呢?)

偶尔也看到一条额外信息:Apple也在使用Rust构建分布式文件系统,据说在在西雅图举行过一次小型演讲,试图招募相关人才,在网上还找不到相关信息。

https://www.reddit.com/r/rust/comments/bc46lc/understanding_rusts_popularity_on_stack_overflow/



使用Sonr构建pub/sub服务器

#sonr #pub_sub #mio

sonr建立在mio之上的网络库,相比于Tokio来说,更加轻量。

https://hagsteel.com/posts/building-a-pub-sub-with-sonr-part-1/

https://github.com/hagsteel/sonr

https://github.com/hagsteel/pubsub

https://hagsteel.com/posts/introduction-to-sonr/



chit: 可在终端查询crate信息的工具

#crate #cli

$ cargo install chit

$ chit serde

https://github.com/peterheesterman/chit



Rust编写的的ip-api命令行界面

#ip_api

ip-api是一个免费(非商用)的第三方IP地理位置API服务。

http://ip-api.com/

https://github.com/Gymmasssorla/ip-api-cli



test_double: 可以在测试中将一种类型替换为另一种类型的库

#test

https://github.com/pcsm/test_double



wasmer: 可执行wasm二进制文件的Python库

#python #wasm

https://github.com/wasmerio/python-ext-wasm



sic: 顺序导入链,一个HTML/CSS脚本注入工具

#css_injection #security #html_injection

https://github.com/d0nutptr/sic

https://medium.com/@d0nut/better-exfiltration-via-html-injection-31c72a2dae8b


From 日报小组 @Chaos

本文原文由 Markdown 写成,公众帐号编辑器不支持 md,差评。更好的效果,请点击左下角“阅读原文”。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值