kaist-cp / cs492-uarch

31 stars 1 forks source link

Implementation of the `fsm` combinator #43

Open kjh618 opened 2 weeks ago

kjh618 commented 2 weeks ago

(From the discussions on the Oct. 14 class) Instead of the fsm combinator itself being a compiler magic, would it be better to make it a thin wrapper around a magic Fsm, and comb? Then, fsm would be implemented like the following:

fn fsm(self, init, f) {
    let m_fsm = Fsm(init, f);
    self.comb(m_fsm)
}
minseongg commented 1 week ago

Good idea! I believe it is more ergonomic way to implement the fsm combinator.

Since it requires some compiler changes, we will do it later. Thank you for suggestion!