1. A system, comprising: one or more processors; and a memory comprising program instructions executable by the one or more processors to implement a portable stub generator configured to: obtain an indication of a native language function to be called from a platform-independent language program in a virtual machine implemented on the system; and generate a stub in accordance with a tokenized internal representation of the virtual machine, wherein the stub is configured to invoke the indicated native language function from a platform-independent language function at runtime of the platform-independent language program.