【Rust日報】2020-01-02 The Embedded Working Group Newsletter – 22
- 2020 年 2 月 12 日
- 筆記
The Embedded Working Group Newsletter – 22
這是 Rust Embedded WG 的第 22 期通訊,我們重點介紹新的進展,為出色的項目加油,感謝社區並宣傳需要幫助的項目!(如果您想在下一期通訊中提及,請聯繫我們。)例如:用 Rust 在樹莓派上進行作業系統開發教程:https://github.com/rust-embedded/rust-raspi3-OS-tutorials。
查看原文:https://rust-embedded.github.io/blog/newsletter-22/
reddit 參與討論:https://www.reddit.com/r/rust/comments/eiisk9/the_22nd_embedded_working_group_newsletter/
Spinlocks Considered Harmful
In this post, I will be expressing strong opinions about a topic I have relatively little practical experience with, so feel free to roast and educate me in comments (link at the end of the post) 🙂
Specifically, I』ll talk about:
- spinlocks,
- spinlocks in Rust with #[no_std],
- priority inversion,
- CPU interrupts,
- and a couple of neat/horrible systemsy Rust hacks.
Read more :https://matklad.github.io//2020/01/02/spinlocks-considered-harmful.html
reddit參與討論:https://www.reddit.com/r/rust/comments/eis1tr/blog_post_spinlocks_considered_harmful/
理解 Tokio
, pt. 1
「我想了解 Tokio 的工作方式。我的興趣涉及事物的實時性和並行性,但是我對 Tokio 本身並不了解。在引入非同步和穩定的期貨之前,我或多或少有意地避免學習它,這並不是毫無道理的認為 Tokio 是錯的,但是只有有限的時間來學習東西,學習一些新東西是一項艱巨的任務。」
「因此我寫下了這些學習 Tokio 的筆記。我沒有計劃如何學習它的內部原理,但是總的來說,當我有某種項目可以幫助我閱讀時,我會學得最好。上下文確實有幫助。我不知道我要長期構建什麼,但是一個 HTTP 負載生成器可以很好地工作,它可以擴展自身以找到伺服器每秒可以處理的最大請求,同時仍然滿足一些延遲約束。這確實意味著我需要將我的學習與另一個庫 – hyper
相結合,但是我以前使用過它,並且認為我可以將其保留為黑匣子。」
閱讀原文:https://blog.troutwine.us/2019/12/31/understanding-tokio-pt1/
面向大眾的 Rust 和 WebAssembly 教程
如果您認為 WebAssembly 最適合遊戲應用程式,Online IDE 以及其他資源密集型和佔用記憶體的應用程式,那麼您在技術上是正確的。但是我們也可以在一個簡單的應用程式中獲得 WebAssembly 的好處。
對於我們開發的普通應用程式(即始終不需要超快速響應的應用程式),有些部分需要進行性能調整。有時,我們必須刪除僅在某些瀏覽器上而不在其他瀏覽器上運行的很醜陋的程式碼。那麼 WebAssembly 是一個很好的選擇。
使用 Rust 和 WebAssembly,可以使用更快,一致的 WebAssembly 程式碼輕鬆彌補這些領域的不足。
詳情請看:https://dev.to/sendilkumarn/rust-and-webassembly-for-masses-introduction-1034
關於 Rust 程式碼測試的討論
詳情請看:https://www.reddit.com/r/rust/comments/eiji29/rust_webapps_and_testing/