See interpreter/src/bytecode.rs:293 - multiple dereferences required to fetch a single opcode.
Ideal state: an instruction pointer that is a pointer to the next opcode.
Realistically: that might not be sensible, given that we probably want to retain bounds checking; what about extending Array with a RefCell-style ArrayOpcode slice borrow? That's as close to bare pointer in safe Rust as we can get.
See
interpreter/src/bytecode.rs:293
- multiple dereferences required to fetch a single opcode.Ideal state: an instruction pointer that is a pointer to the next opcode.
Realistically: that might not be sensible, given that we probably want to retain bounds checking; what about extending
Array
with aRefCell
-styleArrayOpcode
slice borrow? That's as close to bare pointer in safe Rust as we can get.Files:
interpreter/src/bytecode.rs:293
booksrc/chapter-interp-bytecode.md