quartz-research-note/content/mimiumの中間表現を考える.md
Tomoya Matsuura(MacBookPro) c0e01bf856
Some checks are pending
Build / build (push) Waiting to run
[obsidian] vault backup: 2024-06-08 22:50:17[
2024-06-08 22:50:17 +09:00

40 lines
1.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
date: 2024-06-08 22:40
---
#memo #mimium
まあいつものサンプルを考える
```rust
fn fbdelay(input:float,fb:float,dtime:float)->float{
return input + delay(self,dtime)*fb
}
fn twodelay (input:float,dtime:float)->float{
return fbdelay(input,dtime,0.7)+fbdelay(input,dtime*2,0.8)
}
fn dsp (input:float)->float{
return twodelay(input,400)+twodelay(input,800)
}
```
コールツリーとしては
```
 dsp
 | |
twodelay(1) twodelay(2)
| | | |
fbdelay(1) fbdelay(2) fbdelay(3) fbdelay(4)
| | | |
delay,feed, delay,feed delay,feed delay, feed
```
feedのコールツリーを持つやり方はポインタを辿ってく形になるのであんまやりたくない
- 実行中のVMから見れば、簡約されたあとにfeedの項が置き換えられて出てくるわけではない
- 関数の定義にジャンプしてみて初めてfeedが現れる
- しかし、そのfeedがどこの情報を保持しているかは呼び出し元の情報が必要