C is a subtle language. Today I learnt that array parameters always have pointer size, even for fixed size arrays!
miniblog.
Related Posts
Today I learnt that Cell<T> has the size of a pointer (i.e. probably 64 bits) in Rust, regardless of the size of T.
It's a common pattern for making struct fields mutable, but the T isn't actually stored inside the struct.
Is there any way of doing tagged references in safe Rust?
I've been looking at tagged pointers (the crate https://docs.rs/tagged-pointer/latest/tagged_pointer/ looks excellent) but it gives you back a raw pointer.
I'm not sure if you can create a safe wrapper for references using tagged pointers.
A decent part of VMs being faster than AST interpreters is just memory layout AIUI.
VM instructions are largely flat arrays, so there's less pointer chasing.