Hi. I'm preparing a little dev-talk about uninitialised memory and I want to introduce a concept of an Abstract Virtual Machine. I intuitively understand what it is, but have trouble with coming up with precise definition and examples of specific rules of Rust's AVM (and C, C++ ones). Googling didn't help, because most links point to implementing Virtual Machines. For the purpose of my talk I want to concentrate on "general" Abstract Virtual Machines and maybe give a couple of examples for C, C++, and Rust ones.
Could you help to systemise my intuition and point me to precise definiotions, please? Here's what I think I know so far:
- abstract machines describe a model of some computation
- abstract virtual machine is a concept introduces by languages and describe capabilities of machines they target
- when we write programs in "higher level languages" we do not target specific CPU that will end up executing it, but this abstract virtual machine. It is the compiler's job to translate program from AVM to concrete CPU
- AVM describes for example what memory accesses a program can perform, what atomic ordering mean, how number arithmetic works (both integer and floating), etc.
- I've read somewhere that LLVM's IR describes AVM, but I'm not sure how to understand that
- Undefined Behaviour as a concept only exists in relation to AVM. Program exhibits an UB when it violates some assumption made by AVM