or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
那些Rust裡好用的抽象與實用語法火力展示 - Wayne Tsai
tags:
COSCUP2021
zh-tw
COSCUP2021
COSCUP 主議程軌
RB105 - Main Track
歡迎來到 https://hackmd.io/@coscup/2021 共筆
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。
Slido: https://app.sli.do/event/tdafbkfk
關於本日演講的Slide
演講Slide連結
分享裡用於對照的相關JS/TS Library如下:
https://github.com/rametta/pratica
https://ramdajs.com/
補充:
53、54頁這邊是說rust的迭代器在做collect的時候,collect方法底下會執行到fromIterator,所以在這個時候可以做到型態轉換,實際上在使用時,只要指定要轉換的對應型別就可以將Vec裡的Result型態翻轉過來。
最後面的範例處理巢狀的struct時使用了clone,繞過了一些編譯的問題。在rust中處理struct野會有下面連結提到的問題,在rust 2021 edition會解決。
https://blog.rust-lang.org/2021/05/11/edition-2021.html#disjoint-capture-in-closures
限於時長的關係,講者把一些幫助剛接觸的朋友理解Rust的相關slide與內容做了幾次的刪減,後面才錄製了一個28min的影片,語速大概是平常的1.x倍,講者盡力了,還請見諒
m () m。
部分刪減前的slide也已上傳,Coscup2021-rust-toturial
原本的slide刪減過的內容整理後抽出來,包含簡單的TS跟Rust的基本對照,主要藉由對比來強調一些語法上的差異處。
可以注意下
後面有marco的使用,rust裡在處理使用不定參數函數的需求時,需要用到macro。
P.S. ownership的部分因為時間關係,所以沒有一開始沒有被放在下面的slide,但是還是應該知道的,所有學習rust的人都應該了解所有權跟借用的規則。
問答部分
更多Rust生態系裡跟錯誤處理相關的library,可以參考 蚂蚁集团 CeresDB 团队 | 关于 Rust 错误处理的思考 一文的介紹。