本文譯自 Julio Merino 2018 年七月撰寫的 Rust vs. Go 一文。Julio Merino 是 G 社僱員,在 G 社工作超過 8 年,無論工作內外,都接觸開發不少 Go 語言,並撰寫 [Rust 點評][rust-review]系列文,來聽聽他對 Rust 與 Go 的想法吧。
Thanks Julio Merino for this awesome article!
本文譯自 [Tokio internals: Understanding Rust's asynchronous I/O framework from the bottom up][tokio-internals]。
Thanks [David Simmons][david-simmons] for this awesome article!
[Tokio][tokio] 是 Rust 的開發框架,用於開發非同步 I/O 程式(asynchronous I/O,一種事件驅動的作法,可實現比傳統同步 I/O 更好的延伸性、效能與資源利用)。可惜的是,Tokio 過於精密的抽象設計,招致難以學習的惡名。即使我讀完教程後,依然不認為自己充分內化這些抽象層,以便推斷實際發生的事情。
從前的非同步 I/O 相關開發經驗甚至阻礙我學習 Tokio。我習慣使用作業系統提供的 selection 工具(例如 Linux epoll)當作起點,再轉移至 dispatch、state machine 等等。倘若直接從 Tokio 抽象層出發,卻沒有清楚了解 epoll_wait()
在何處及如何發生,我會覺得難以連結每個概念。Tokio 與 future-driven 的方法就好像一個黑盒子。
RustConf 是 Rust 社群年度最重要的研討會之一,從 [Rust 在 2015 年 1.0 版正式發布][rust-1.0]之後,[2016][2016]、[2017][2017]、[2018][2018] 連續三年都在美國舉辦,今年當然不例外,八月底在 NBA 球迷稱作 Rip City 的波特蘭舉行。由於歷史悠久,加上 Rust 社群在美國較為活躍,許多 Rust Core Team 成員都會共襄盛舉,這場研討會是 Rust 開發者絕對不能錯過的盛事。
RustConf 歷年來皆由 [Tilde Inc.][tilde] 旗下的 [Skylight][skylight] 主辦,Skylight 是一個 Rails profiler in production 的解決方案,產品中關鍵的模組用了不少 Rust。
好了,介紹完背景,這篇文章主要是紀錄小弟我「在 YouTube 上」觀看演講的心得分享,當然,RustConf 除了主要的演講軌,還有不少場邊工作坊等小活動,這就留給看倌明年到實地考察啦!
About two month ago, I started making a React Native app ["PyConTW 17"][pycontw-mobile] for the biggest annual Python conference in Taiwan ([PyCon Taiwan][pycontw]). The app is quite simple, but still took some efforts for me to build. As a complete React newbie, I would like to share some of my thoughts about React Native.
(written on 2017-07-30, based on React Native 0.44.2)
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from PIL import Image, ImageDraw | |
im = Image.open('img_original.png') | |
def interpolate(f_co, t_co, interval): | |
det_co =[(t - f) / interval for f , t in zip(f_co, t_co)] | |
for i in range(interval): |
# http://editorconfig.org | |
root = true | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
由於高度封裝與抽象,JavaScript 的執行效率比不上 C 的語言。例如 JavaScript 的 Array 下標(subscript)是根據 hash key 而非實體記憶體位址 offset 取值,雖然方便,卻多了效能開銷。當 Canvas、WebGL、WebVR 開始走紅,效能越來越受重視,如何讓 JavaScript 達到如同 C 指標般操作 binary data 變得至關重要。
存在許久但最近才變為 ES6 標準「Typed Array」就是解放 JavaScript 操作 binary data 能力的好工具!一起來了解 Typed Array 吧!
(撰於 2017-09-03,基於 ECMAScript 6+,Node.js 8.3)
Last week, a new version (1.17) of Visual Studio Code was released. While there are many fascinating improvements and features introduced, the one that cought my eyes is "Integrated Terminal performance" section. Let's check out what they've done!
(written on 2017-10-12, based on Xterm.js v3, VS Code 1.17)