【Rust 日報】2020-12-05 rust-gpu 發布 v0.2

2021-02-14 Rust語言中文社區
rust-gpu 發布 v0.2目前可以編譯並運行非常簡單的著色器,而且核心庫的很大一部分也可以編譯。但是,很多功能還沒有實現:例如,還不支持循環和開關!這意味著,儘管該項目在技術上可用,但遠未達到可以投入生產使用。

#[spirv(entry = "fragment")]
pub fn main_fs(input: Input<Vec4>, mut output: Output<Vec4>) {
let dir: Vec3 = input.load().truncate();

let cs_pos = Vec4(dir.0, -dir.1, 1.0, 1.0);
let ws_pos = {
let p = clip_to_world.mul_vec4(cs_pos);
p.truncate() / p.3
};
let dir = (ws_pos - eye_pos).normalize();

// evaluate Preetham sky model
let color = sky(dir, sun_pos);

output.store(color.extend(0.0))
}

v0.2的 Github Release 連結:https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.2
rust-analyzer 測量 Rust 的內存使用情況這篇文章記錄了在 rust-analyzer 中用於測量內存消耗的一些有趣技巧。通常,有兩種廣泛的方法可以分析程序的內存使用情況。第一種方法是基於堆的解析(heap parsing),第二種方法是基於對分配和釋放進程的調用檢測。詳細可以參見原文。文章連結,https://rust-analyzer.github.io/blog/2020/12/04/measuring-memory-usage-in-rust.htmlRAUI,將 UI 視為另一種數據RAUI,受到 React 聲明式 UI 組成和 UE4 Slate 小部件組件系統的極大啟發。RAUI 體系結構的主要思想是將 UI 視為另一種數據,你可以將其轉換為目標呈現引擎選擇的目標可呈現數據格式。

let mut application = Application::new();
let tree = widget! {
(app {
title = (title_bar: {"Hello".to_owned()})
content = (vertical_box [
(#{"hi"} button: {"Say hi!".to_owned()})
(#{"exit"} button: {"Close".to_owned()})
])
})
};
let mut renderer = HtmlRenderer::default();
application.apply(tree);
if let Ok(output) = application.render(&mut renderer) {
println!("{}", output);
}

Github 連結,https://github.com/PsichiX/raui200 行 Rust 代碼解釋 Futures本書旨在通過示例驅動的方法來解釋 Rust 中的 Futures,探索為什麼它們被設計成這樣,以及它們是如何工作的。還介紹了一些在編程中處理並發時的替代方案。英文原版連結,https://cfsamson.github.io/books-futures-explained/introduction.html

中文版本連結,https://stevenbai.top/rust/futures_explained_in_200_lines_of_rust/

一起成長

相關焦點

  • 【Rust日報】2020-12-3 SHADERed可以在線編輯rust-gpu!
    rust-gpu現在可以直接在SHADERed網站上在線編輯了。Read More: https://shadered.org/blog?id=4rust-gpu book (Wip): https://embarkstudios.github.io/rust-gpu/book/introduction.htmlripgrep-allrga是ripgrep的一個擴展版本,和ripgrep用法類似,但是可以搜索的文件格式更多,目前有:pdf, docx, sqlite, jpg, 視頻格式(mkv
  • 【Rust日報】2020-12-17 Rust 2020調查問卷結果出爐!
    /12/16/rust-survey-2020.htmltxtai - 一個AI驅動的搜尋引擎txtai是一個AI驅動的搜尋引擎,這個github代碼庫包含了該引擎api的rust綁定。Read More: https://sequoia-pgp.org/blog/2020/12/16/202012-1.0/Read More: https://github.com/arijit79/minus/blob/main/CHANGELOG.md#v201-2020-12-16Raph Levien 大神最新的blog
  • 【Rust日報】2020-12-31 2020年最後一次日報
    新年祝願2020最後一天日報!
  • 【Rust日報】2020-07-16 - tokio 0.3發布
    Announcing Tokio 0.3 and the path to 1.0Tokio發布了0.3版,並預計2020
  • 【Rust日報】2021-01-05 Rust 1.49.0 正式發布
    Rust 1.49.0在又經過六周的迭代開發,Rust 1.49.0 現在已經發布了!
  • 【Rust日報】2020-08-21 RustConf研討會在線舉辦
    $PWD/data:/data -p 7878:7878 oxigraph/oxigraph -b 0.0.0.0:7878 -f /data ### build and run the wikibase server $ cargo install oxigraph_wikibase $ cargo build --release
  • 【Rust日報】 2020-11-12 探索 Rust 編譯器的 PGO
    這篇文章恰好探討了這個問題,更多詳情請看:https://blog.rust-lang.org/inside-rust/2020/11/11/exploring-pgo-for-the-rust-compiler.html新加坡shopee garena母公司sea group招聘開發這邊是 shopee 和 garena 的集團總部Sea infrastructure
  • 【Rust日報】 2019-08-21:「官方」async_await將在Rust 1.39穩定版中發布
    Read More: https://github.com/rust-lang/rust/pull/63209#issuecomment-523113079宣告:async-std 異步標準庫的測試版#async_std並打算在2019年9月26日前發布1.0版。該庫附帶了一本書和完善的應用編程接口文檔,並將很快提供一個穩定的接口來支持異步庫和應用程式。
  • 【Rust日報】2020-10-12 蜜月期之後的 Rust
    兩年過去了, 如同作者說:除此之外,作者還列舉了很多大大小小的細節,來說明為什麼他仍然最愛 Rust:數字字面量 例如 0b0000_1011_1000_0000gimli 和 goblin 這是兩個 crates, gimli 是用來消費 DWARF數據,從而可以製作調試工具.
  • 【Rust日報】2020-10-02 行動作業系統SailfishOS支持Rust了
    行動作業系統SailfishOS支持Rust了連結:https://forum.sailfishos.org/t/release-notes-pallas-yllastunturi-3-4-0/2258Let's Encrypt在招SRE工程師(主要語言為Rust,Go和Python)連結:https://www.abetterinternet.org/careers/le-sre-sw2/深入了解Ringbahn的driversRingbahn是無船同志(without boats)基於io-uring 的 安全Rust
  • 【Rust 日報】2021-8-12 (包含原始碼)用Rust重寫我的移動遊戲,並支持WASM
    如果你發現了一個反常規或你認為可以用更簡單或更優雅的方式來完成的東西,我很樂意聽到。我最終使用了大量的Rc+內部可變性,因為這使得代碼更容易翻譯/管理/歸納。與瀏覽器的渲染瓶頸相比,這些模式對性能的影響似乎可以忽略不計(僅僅是使用WASM而不是Javascript,我就得到了很多執行遊戲邏輯的空間),所以我在添加一些Rc的地方之前沒有多想,這將使我的生活更輕鬆 :P 談到性能,我做了一些工作來改善安卓版Firefox上的東西(當我第一次發布時,遊戲在那裡運行得很慢),這似乎有很大的影響:在我的手機上,幀數從20到40。
  • 回溯 Rust 2020:正在成為最受歡迎的程式語言
    51K,Reddit Fans 則漲至 125 K,全年合併 PR 有 8114 個。這些數據無不在說明,Rust 正成為最受歡迎的程式語言。當今世界科技發展日新月異,2015 年 5 月 15 日,Rust 1.0 版本正式面世,在這五年多的時間中,Rust 改變了許多,憑藉自身的優勢,Rust 也連續四年成為開發者最受歡迎的程式語言。目前,也有越來越多的項目及企業開始選擇使用 Rust 作為其應用及工具開發語言。
  • 回溯 Rust 2020:正成為最受歡迎的程式語言
    主要版本分別如下:1.41.0  2020.1.30 發布1.42.0   2020.3.12 發布1.43.0  2020.4.23 發布1.44.0  2020.6.4 發布1.45.0  2020.7.16 發布1.46.0  2020.8.27 發布1.47.0  2020.10.8 發布
  • 【Rust日報】2020-08-27 在Arduino Uno上面跑 Rust 程序
    並且包含了一本新書 The AVR-Rust Guidebook :https://book.avr-rust.com/rust-avr 項目官網:https://www.avr-rust.com/https://dev.to/creativcoder/how-to-run-rust-on-arduino-uno-40c0via https://t.me/rust_daily_news/4495
  • 【Rust日報】 2020-02-24 Rust/WinRT即將到來
    ; visual.set_offset(Vector3 { x: 1.0, y: 2.0, z: 3.0, })?;assert!(visual.offset()? == Vector3 { x: 1.0, y: 2.0, z: 3.0 });在這裡您可以看到我們正在創建一個合成器。
  • 【Rust日報】 2020-06-12 了解 Fuchsia 的 Rust 開發
    了解 Fuchsia 的 Rust 開發Fuchsia 是 Google 正在開發的一個開源作業系統,最近 fuchsia.dev 上最近更新了很多開發文檔,其中 Rust 開發文檔最近於 2020在已經開放的開發文檔裡面,Rust 文檔相對來說還是比較豐富的,相應的公開討論頻道在:rust@fuchsia.com。
  • 【Rust日報】2020-07-30 fixed_vec減少Rust數組冗餘邊界檢查
    具體內容: https://github.com/Torrencem/fixed_vec/blob/master/post.md在文末有提到了性能差距,如果只想看看效果如何的,可以直接跳到文末use fixed_vec::{name, FixedVec};let v = vec![0u32; 10];let v = name!
  • 【Rust日報】2019-10-14 - Rust十月倫敦會談
    = "0.3.0";示例use rxrust::{ ops::{ Filter, Merge, Fork }, prelude::*,};let mut numbers = observable::from_iter!
  • 【Rust日報】 2019-12-17 hyper v0.13.0的最終版本現已準備就緒
    這篇文章會教你如何用Rust來完成提取(https://pudymody.netlify.com/blog/2019-12-15-converting-gifs-to-powerpoint-with-rust/).並將圖片保存到PowerPoint.現在網上有很多這樣的提取圖片的網站, 有興趣的話,用Rust實現一個在線動態圖片提出服務吧.
  • 【Rust日報】2020-12-27 Rust 開發 Windows 驅動程序
    Read More: https://blog.iota.org/stronghold-alpha-release/【文章】嵌入式和 RISC-VRead More: https://blog.cecton.com/posts/rust-and-riscv/EGUI 發布 0.60 版本Read More: https://github.com