It's certainly not slow and gross, it's in fact how you should implement a proper dynamic language. lua, potion or self e.g. did it this way. Without any assembler or ffi tricks. apply in C is easily doable if your data is tagged.