Closed breuleux closed 4 years ago
The only question I have is why not have make_cell as the primitive? Otherwise I'm ok.
The only question I have is why not have make_cell as the primitive?
Essentially, because it is simpler for optimization purposes if only one primitive sets things in the universe. For example, we can simplify getitem(setitem(U, h, v), h)
to v
, but if make_cell
was a primitive we would also need to consider U2, h = make_cell(U1, v); getitem(U2, h)
, and so on.
handle
primitive becomesmake_handle
and is changed.universe_setitem
must be called to do so.make_handle
takes a universe and a type and returns a new universe and a handle, which allows us to order calls tomake_handle
and guarantee that CSE cannot merge similar handles.RefCreate
.make_cell
composite behaves likehandle
used to.handle_get
andhandle_set
composites are renamed tocell_get
andcell_set
.