I built a 'slice of function pointers' bytecode interpreter in Go in 2019 for the Algorand VM (Blockchain smart contract stuff) and before that the same pattern in C for a toy JVM around 2005.
It's a good pattern!
The Algorand VM was focused on low overhead running thousands of tiny programs per second. Version 1 had no loops and a 1000 instruction limit.
The JVM was focused on low memory, towards possible embedded microcontroller use.
So, 'array of function pointers' is nothing new, but it is a good pattern.
It's a good pattern!
The Algorand VM was focused on low overhead running thousands of tiny programs per second. Version 1 had no loops and a 1000 instruction limit.
The JVM was focused on low memory, towards possible embedded microcontroller use.
So, 'array of function pointers' is nothing new, but it is a good pattern.