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.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Swift Actor 實作探索 - John Lin
tags:
COSCUP2021
zh-tw
COSCUP2021
帶您讀源碼
TR212
歡迎來到 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/bsywjdkd
- 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 →slide: https://tinyurl.com/3ur2stp8
Actor Model:
非同步運算模型、even C language can implement
Actor:
Unit of operation, a computer that can make another computer
Message:
How actor model work
- 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 →like person write mail to another person, required sender and receiver
swift
same gen as Go, Rust
open source
swift feature
every C feature can be done by swift
FP: map, high order fn, 1st class fn, lamda, closure
swift async await
async let y = fetch() // give y a promise
Swift Actor
if call inc() on mulit-thread, will cause race condition
actor solove that
swift actor message passig
method can type check, message can't
in swift, every message passing, become method(auto)
Demo
for update UI
before actor, using LIB dispatch to change thread to main thread
after actor, actor change for you
Complier gen actor
Grammer tree -> SIL (SSA Form)
SSA Form is var only assign once.
SIL -> IR
ACtor
SIL of actor
Counter
8 lines of code -> 360 lines of code
IR –> 1k+ lines
recap